summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-09-17 22:07:16 -0400
committerFreya Murphy <freya@freyacat.org>2025-09-17 22:07:16 -0400
commit68d03fe362b7e0df11662d8d6a1e01eac0bfae77 (patch)
treea76abd05f662f73b4083ddb0d8bf0d72c29e5a74 /flake.nix
parentupdate commits (diff)
downloaddotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.gz
dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.tar.bz2
dotfiles-nix-68d03fe362b7e0df11662d8d6a1e01eac0bfae77.zip
refactor: remove modules folder, fully split home and system modules
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;
}
);