Compare commits

..

No commits in common. "de72f9a869183b1b214a94eb7b2ca496084fc004" and "3cf6a49a2a898efdaa7d54f810c1a07807bbdfe1" have entirely different histories.

6 changed files with 10 additions and 34 deletions

View file

@ -1,11 +1,9 @@
{ lib, config, ... }:
{ lib, ... }:
let
cfg = config.flake;
inherit (lib.attrsets) mapAttrs concatMapAttrs;
inherit (lib.attrsets) concatMapAttrs;
in
{
flake.lib = {
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
forAllUsers = f: mapAttrs f cfg.manifest.users;
};
}

View file

@ -8,6 +8,7 @@ let
};
nixpkgs.hostPlatform = "x86_64-linux";
boot.loader.systemd-boot.enable = true;
system.stateVersion = "25.05";
networking = { inherit hostName; };
};
in

View file

@ -1,18 +1,13 @@
{ inputs, config, ... }:
{ inputs, ... }:
let
inherit (cfg.lib) flattenAttrs;
cfg = config.flake;
hm = inputs.home-manager;
globalCfg = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [
(flattenAttrs (cfg.modules.homeManager or { }))
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
};
in
{
imports = [ hm.flakeModules.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;
}

View file

@ -1,10 +0,0 @@
{
flake.modules.nixos.default = {
system.stateVersion = "25.11";
};
flake.modules.homeManager.default =
{ osConfig, ... }:
{
home.stateVersion = osConfig.system.stateVersion;
};
}

View file

@ -1,13 +1,12 @@
{ config, lib, ... }:
let
cfg = config.flake;
inherit (config.flake.lib) forAllUsers flattenAttrs;
inherit (config.flake.lib) flattenAttrs;
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
{
flake.modules.nixos.default =
{ pkgs, config, ... }:
{ pkgs, ... }:
{
#TODO: move sudo/security options elsewhere
security.sudo.wheelNeedsPassword = false;
@ -27,12 +26,5 @@ 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;
}
);
};
}