summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix46
1 files changed, 30 insertions, 16 deletions
diff --git a/flake.nix b/flake.nix
index a97f031..8121cc8 100644
--- a/flake.nix
+++ b/flake.nix
@@ -59,9 +59,9 @@
outputs = {
self,
nixpkgs,
+ home-manager,
...
} @ inputs: let
- options = import ./options.nix;
systems = ["x86_64-linux"];
perSystem = func:
builtins.listToAttrs (map (
@@ -73,41 +73,55 @@
}
)
systems);
- buildSystem = file: system:
- inputs.nixpkgs.lib.nixosSystem {
+ mkSystem = file: system:
+ nixpkgs.lib.nixosSystem {
inherit system;
- specialArgs = {inherit self inputs system;};
+ specialArgs = {inherit inputs;};
modules = [
- options
- ./home
- ./modules
./system
+ ./options.nix
file
];
};
+ mkHome = file: system: let
+ hostModule = mkSystem file system;
+ in
+ home-manager.lib.homeManagerConfiguration {
+ inherit (hostModule) pkgs;
+ extraSpecialArgs = {inherit inputs;};
+ modules = [
+ ./home
+ ./options.nix
+ (self.lib.customConfig hostModule.config)
+ {
+ nixpkgs.config.allowUnfree = true;
+ }
+ ];
+ };
in rec {
nixosConfigurations = {
- shinji = buildSystem ./hosts/shinji "x86_64-linux";
- kaworu = buildSystem ./hosts/kaworu "x86_64-linux";
- thinkpad = buildSystem ./hosts/thinkpad "x86_64-linux";
- wsl = buildSystem ./hosts/wsl "x86_64-linux";
+ shinji = mkSystem ./hosts/shinji "x86_64-linux";
+ kaworu = mkSystem ./hosts/kaworu "x86_64-linux";
+ thinkpad = mkSystem ./hosts/thinkpad "x86_64-linux";
+ wsl = mkSystem ./hosts/wsl "x86_64-linux";
};
homeConfigurations = {
- shinji = nixosConfigurations.shinji.config.home-manager.users.${options.user}.home;
- kaworu = nixosConfigurations.kaworu.config.home-manager.users.${options.user}.home;
- thinkpad = nixosConfigurations.thinkpad.config.home-manager.users.${options.user}.home;
+ shinji = mkHome ./hosts/shinji "x86_64-linux";
+ kaworu = mkHome ./hosts/kaworu "x86_64-linux";
+ thinkpad = mkHome ./hosts/thinkpad "x86_64-linux";
+ wsl = mkHome ./hosts/wsl "x86_64-linux";
};
lib = import ./lib {
- inherit inputs options;
+ inherit inputs;
inherit (nixpkgs) lib;
};
packages = perSystem (
pkgs: system:
import ./pkgs {
- inherit pkgs inputs system options;
+ inherit pkgs inputs system;
inherit (nixpkgs) lib;
}
);