refactor(flake): integrate home-manager into nixos configuration
This commit is contained in:
53
flake.nix
53
flake.nix
@@ -44,6 +44,7 @@
|
||||
"${hostname}" = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
nur.modules.nixos.default
|
||||
|
||||
./system/common.nix
|
||||
@@ -53,43 +54,28 @@
|
||||
{
|
||||
system.stateVersion = stateVersion;
|
||||
networking.hostName = hostname;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
makeHome = hostname:
|
||||
let
|
||||
extractModules = map
|
||||
(module:
|
||||
let hm = module.homeManagerModules;
|
||||
in hm.${lib.head (lib.attrNames hm)});
|
||||
in
|
||||
{
|
||||
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration
|
||||
{
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [ nur.overlays.default ];
|
||||
};
|
||||
home-manager.users.${username} = {
|
||||
imports = [
|
||||
./home/${hostname}.nix
|
||||
./home/common.nix
|
||||
] ++ (map
|
||||
(module:
|
||||
let hm = module.homeManagerModules;
|
||||
in hm.${lib.head (lib.attrNames hm)})
|
||||
[ nixvim nethack plasma-manager ]);
|
||||
|
||||
modules = (extractModules [
|
||||
nixvim
|
||||
nethack
|
||||
plasma-manager
|
||||
]) ++ [
|
||||
nur.modules.homeManager.default
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/home/${username}";
|
||||
stateVersion = stateVersion;
|
||||
};
|
||||
|
||||
./home/${hostname}.nix
|
||||
./home/common.nix
|
||||
|
||||
{
|
||||
news.display = "show";
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.stateVersion = stateVersion;
|
||||
news.display = "show";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -98,6 +84,5 @@
|
||||
forEachHost = fn: lib.mergeAttrsList (map fn hostnames);
|
||||
in {
|
||||
nixosConfigurations = forEachHost makeSystem;
|
||||
homeConfigurations = forEachHost makeHome;
|
||||
};
|
||||
}
|
||||
|
@@ -48,8 +48,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home = {
|
||||
packages = with pkgs; let
|
||||
sent' = sent.overrideAttrs (oldAttrs: {
|
||||
@@ -88,9 +86,5 @@
|
||||
sessionVariables = {
|
||||
ANI_CLI_PLAYER = "mpv";
|
||||
};
|
||||
|
||||
file = {
|
||||
".config/nixpkgs/config.nix".text = "{ allowUnfree = true; }";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user