refactor(nix): migrate to flake-parts, drop specialArgs ♻️
- Convert flake.nix to flake-parts.lib.mkFlake; split each host into its own module under nixos/flake-modules/. - Replace zen-browser specialArgs plumbing with a nixpkgs overlay so home.nix can just reference pkgs.zen-browser.
This commit is contained in:
parent
b667f7c247
commit
c434a479a5
9 changed files with 158 additions and 128 deletions
31
nixos/flake-modules/daniel-macbook-air.nix
Normal file
31
nixos/flake-modules/daniel-macbook-air.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ inputs, ... }: {
|
||||
flake.darwinConfigurations."Daniel-Macbook-Air" = inputs.nix-darwin.lib.darwinSystem {
|
||||
modules = [
|
||||
# Overlay: make zen-browser available as pkgs.zen-browser
|
||||
{ nixpkgs.overlays = [ (final: prev: {
|
||||
zen-browser = inputs.zen-browser.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
}) ];
|
||||
}
|
||||
|
||||
../hosts/daniel-macbook-air.nix
|
||||
../fish.nix
|
||||
|
||||
# Home Manager on macOS
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
({ lib, ... }: {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
# Automatically backup files before home-manager overwrites them
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.users.danny = { ... }: {
|
||||
# Force an absolute path even if another module sets a bad value.
|
||||
home.username = "danny";
|
||||
home.homeDirectory = lib.mkForce "/Users/danny";
|
||||
imports = [
|
||||
../home/danny/home.nix
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
11
nixos/flake-modules/installer-iso.nix
Normal file
11
nixos/flake-modules/installer-iso.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ inputs, self, ... }: {
|
||||
# Custom minimal installer ISO (build with: nix build .#installer-iso).
|
||||
# Optional: add ./installer-wifi.nix (gitignored) to modules for live WiFi.
|
||||
flake.nixosConfigurations.installer-iso = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ../installer-iso.nix ];
|
||||
};
|
||||
|
||||
flake.packages.x86_64-linux.installer-iso =
|
||||
self.nixosConfigurations.installer-iso.config.system.build.isoImage;
|
||||
}
|
||||
22
nixos/flake-modules/phantom-ship.nix
Normal file
22
nixos/flake-modules/phantom-ship.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ inputs, ... }: {
|
||||
flake.nixosConfigurations.phantom-ship = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
inputs.nix-openclaw.nixosModules.openclaw-gateway
|
||||
../hosts/phantom-ship.nix
|
||||
|
||||
# Home Manager on NixOS
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
({ lib, ... }: {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.users.danny = { ... }: {
|
||||
home.username = "danny";
|
||||
home.homeDirectory = lib.mkForce "/home/danny";
|
||||
home.stateVersion = "25.11";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
11
nixos/flake-modules/server-install.nix
Normal file
11
nixos/flake-modules/server-install.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ inputs, ... }: {
|
||||
# For disko-install: LUKS + WiFi; hostname/WiFi via --system-config.
|
||||
flake.nixosConfigurations.server-install = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
inputs.disko.nixosModules.disko
|
||||
../disko-server.nix
|
||||
../hosts/server-install.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
21
nixos/flake-modules/sunken-ship.nix
Normal file
21
nixos/flake-modules/sunken-ship.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ inputs, ... }: {
|
||||
flake.nixosConfigurations.sunken-ship = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
../hosts/sunken-ship.nix
|
||||
|
||||
# Home Manager on NixOS
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
({ lib, ... }: {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.users.danny = { ... }: {
|
||||
home.username = "danny";
|
||||
home.homeDirectory = lib.mkForce "/home/danny";
|
||||
home.stateVersion = "25.11";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
24
nixos/flake-modules/wsl.nix
Normal file
24
nixos/flake-modules/wsl.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ inputs, ... }: {
|
||||
flake.nixosConfigurations.wsl = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.vscode-server.nixosModules.default
|
||||
../hosts/wsl.nix
|
||||
../fish.nix
|
||||
|
||||
# Home Manager on WSL
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
({ lib, ... }: {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.users.dth = { ... }: {
|
||||
home.username = "dth";
|
||||
home.homeDirectory = lib.mkForce "/home/dth";
|
||||
imports = [ ../home/danny/home.nix ];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue