summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-03-08 17:42:39 +0530
committersinanmohd <sinan@sinanmohd.com>2024-03-08 19:19:44 +0530
commit3ea06b0f61da129b6cd6a4f4d8648f051c30a74c (patch)
tree3143ab50492a892f785b2db71ea791b6abd46e19 /flake.nix
parent74cf6b4fc52e6662c95163f17786ff0599889e06 (diff)
home-manager: init
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix26
1 files changed, 20 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 8c63e01..30bd680 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,14 +8,20 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
+
+ home-manager = {
+ url = "github:nix-community/home-manager";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
- outputs = { self, nixpkgs, sops-nix }: let
+ outputs = { self, nixpkgs, sops-nix, home-manager }: let
lib = nixpkgs.lib;
- makeHost = host: system: lib.nixosSystem {
+ makeNixos = host: system: lib.nixosSystem {
inherit system;
modules = [
+ ./userdata.nix
{ networking.hostName = host; }
./nixos/${host}/configuration.nix
@@ -23,12 +29,20 @@
];
};
- makeX86 = hosts: lib.genAttrs hosts (
- host: makeHost host "x86_64-linux"
- );
+ makeHome = useType: system: home-manager.lib.homeManagerConfiguration {
+ pkgs = nixpkgs.legacyPackages.${system};
+ modules = [
+ ./userdata.nix
+ ./home-manager/${useType}/home.nix
+ ];
+ };
in
{
nixosConfigurations =
- makeX86 [ "cez" "kay" "lia" "fscusat" "dspace" ];
+ lib.genAttrs [ "cez" "kay" "lia" "fscusat" "dspace" ]
+ (host: makeNixos host "x86_64-linux");
+ homeConfigurations =
+ lib.genAttrs [ "common" ]
+ (host: makeHome host "x86_64-linux");
};
}