Compare commits
No commits in common. "de72f9a869183b1b214a94eb7b2ca496084fc004" and "3cf6a49a2a898efdaa7d54f810c1a07807bbdfe1" have entirely different histories.
de72f9a869
...
3cf6a49a2a
6 changed files with 10 additions and 34 deletions
|
@ -1,11 +1,9 @@
|
||||||
{ lib, config, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.flake;
|
inherit (lib.attrsets) concatMapAttrs;
|
||||||
inherit (lib.attrsets) mapAttrs concatMapAttrs;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.lib = {
|
flake.lib = {
|
||||||
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
|
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
|
||||||
forAllUsers = f: mapAttrs f cfg.manifest.users;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ let
|
||||||
};
|
};
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
system.stateVersion = "25.05";
|
||||||
networking = { inherit hostName; };
|
networking = { inherit hostName; };
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,18 +1,13 @@
|
||||||
{ inputs, config, ... }:
|
{ inputs, ... }:
|
||||||
let
|
let
|
||||||
inherit (cfg.lib) flattenAttrs;
|
|
||||||
cfg = config.flake;
|
|
||||||
hm = inputs.home-manager;
|
hm = inputs.home-manager;
|
||||||
globalCfg = {
|
globalCfg = {
|
||||||
useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
sharedModules = [
|
|
||||||
(flattenAttrs (cfg.modules.homeManager or { }))
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ hm.flakeModules.home-manager ];
|
imports = [ hm.flakeModules.home-manager ];
|
||||||
flake.modules.nixos.default.imports = [ hm.nixosModules.home-manager ];
|
flake.modules.nixos.default.imports = [ hm.nixosModules.home-manager ];
|
||||||
flake.modules.nixos.default.config.home-manager = globalCfg;
|
flake.modules.nixos.default.config = globalCfg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
flake.modules.nixos.default = {
|
|
||||||
system.stateVersion = "25.11";
|
|
||||||
};
|
|
||||||
flake.modules.homeManager.default =
|
|
||||||
{ osConfig, ... }:
|
|
||||||
{
|
|
||||||
home.stateVersion = osConfig.system.stateVersion;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,13 +1,12 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.flake;
|
inherit (config.flake.lib) flattenAttrs;
|
||||||
inherit (config.flake.lib) forAllUsers flattenAttrs;
|
|
||||||
inherit (lib.attrsets) filterAttrs;
|
inherit (lib.attrsets) filterAttrs;
|
||||||
owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) cfg.manifest.users);
|
owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) config.flake.manifest.users);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos.default =
|
flake.modules.nixos.default =
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
#TODO: move sudo/security options elsewhere
|
#TODO: move sudo/security options elsewhere
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
@ -27,12 +26,5 @@ in
|
||||||
openssh.authorizedKeys.keys = [ owner.pubkey ];
|
openssh.authorizedKeys.keys = [ owner.pubkey ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home-manager.users = forAllUsers (
|
|
||||||
name: _: {
|
|
||||||
#TODO: move into nixos/darwin config - should not apply to homeConfigurations
|
|
||||||
home.username = name;
|
|
||||||
home.homeDirectory = config.users.users.${name}.home;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue