modularise flake config: fix and modularise home-manager config generation
unfortunately, homeConfigurations do not follow the pattern of having system-specific sub-attrs and thus are dependent on a specific system per-se.
This commit is contained in:
parent
993308a2d3
commit
27100bacb7
45
flake.nix
45
flake.nix
|
@ -26,7 +26,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{ self, nixpkgs, nur, lanzaboote, flake-utils, ... }@inputs:
|
{ self, nixpkgs, nur, lanzaboote, flake-utils, home-manager, ... }@inputs:
|
||||||
let
|
let
|
||||||
# FIXME: allow different systems
|
# FIXME: allow different systems
|
||||||
systems = flake-utils.lib.system;
|
systems = flake-utils.lib.system;
|
||||||
|
@ -39,31 +39,34 @@
|
||||||
modules = defaultModules ++ extraModules;
|
modules = defaultModules ++ extraModules;
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
mkHomeManager = confName: user: system: # unfortunately, home-manager configs are still system-specific
|
||||||
|
# FIXME: this is thus still linux-x86_64 specific
|
||||||
|
home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
nur.hmModules.nur
|
||||||
|
# TODO: $name can be utilised to conditionally load other config files
|
||||||
|
./home/home.nix
|
||||||
|
];
|
||||||
|
# extends the home config
|
||||||
|
home.username = user;
|
||||||
|
home.homeDirectory = "/home/${user}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
# Optionally use extraSpecialArgs
|
||||||
|
# to pass through arguments to home.nix
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs system;
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ];
|
thinknix = mkSystem systems.x86_64-linux [ ./hosts/thinknix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440s lanzaboote.nixosModules.lanzaboote ];
|
||||||
framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ];
|
framenix = mkSystem systems.x86_64-linux [ ./hosts/framenix inputs.nixos-hardware.nixosModules.framework-13-7040-amd lanzaboote.nixosModules.lanzaboote ];
|
||||||
};
|
};
|
||||||
# FIXME: see mkHomemanager
|
homeConfigurations.spiollinux = mkHomeManager "spiollinux" "spiollinux" systems.x86_64-linux;
|
||||||
homeConfigurations.spiollinux = inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
nur.hmModules.nur
|
|
||||||
./home/home.nix
|
|
||||||
];
|
|
||||||
# extends the home config
|
|
||||||
home.username = "spiollinux";
|
|
||||||
home.homeDirectory = "/home/spiollinux";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
# Optionally use extraSpecialArgs
|
|
||||||
# to pass through arguments to home.nix
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue