Compare commits
2 commits
3cf6a49a2a
...
de72f9a869
Author | SHA1 | Date | |
---|---|---|---|
de72f9a869 | |||
253b46eee0 |
6 changed files with 34 additions and 10 deletions
|
@ -1,9 +1,11 @@
|
|||
{ lib, ... }:
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib.attrsets) concatMapAttrs;
|
||||
cfg = config.flake;
|
||||
inherit (lib.attrsets) mapAttrs concatMapAttrs;
|
||||
in
|
||||
{
|
||||
flake.lib = {
|
||||
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
|
||||
forAllUsers = f: mapAttrs f cfg.manifest.users;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ let
|
|||
};
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
system.stateVersion = "25.05";
|
||||
networking = { inherit hostName; };
|
||||
};
|
||||
in
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
{ inputs, ... }:
|
||||
{ inputs, config, ... }:
|
||||
let
|
||||
inherit (cfg.lib) flattenAttrs;
|
||||
cfg = config.flake;
|
||||
hm = inputs.home-manager;
|
||||
globalCfg = {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [
|
||||
(flattenAttrs (cfg.modules.homeManager or { }))
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ hm.flakeModules.home-manager ];
|
||||
flake.modules.nixos.default.imports = [ hm.nixosModules.home-manager ];
|
||||
flake.modules.nixos.default.config = globalCfg;
|
||||
flake.modules.nixos.default.config.home-manager = globalCfg;
|
||||
}
|
||||
|
|
10
nix/modules/system.nix
Normal file
10
nix/modules/system.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
flake.modules.nixos.default = {
|
||||
system.stateVersion = "25.11";
|
||||
};
|
||||
flake.modules.homeManager.default =
|
||||
{ osConfig, ... }:
|
||||
{
|
||||
home.stateVersion = osConfig.system.stateVersion;
|
||||
};
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.flake.lib) flattenAttrs;
|
||||
cfg = config.flake;
|
||||
inherit (config.flake.lib) forAllUsers flattenAttrs;
|
||||
inherit (lib.attrsets) filterAttrs;
|
||||
owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) config.flake.manifest.users);
|
||||
owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) cfg.manifest.users);
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.default =
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
#TODO: move sudo/security options elsewhere
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
@ -26,5 +27,12 @@ in
|
|||
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