Files
nixos/flake.nix
Alexander Wainwright a76299e62f Refactor
Move more stuff into home manager as appropriate.  Use 'personal'
instead of 'home' for non-work stuff.
2025-12-24 17:37:06 +10:00

85 lines
2.7 KiB
Nix

{
description = "NixOS configuration";
inputs = {
# NixOS official package source
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
# the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs.
inputs.nixpkgs.follows = "nixpkgs";
};
locutus.url = "git+https://git.figtree.dev/alex/locutus";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
# Shared Home Manager configuration function
mkHomeManagerConfig = { extraModules ? [] }: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.alex = {
imports = [ ./alex/core.nix ] ++ extraModules;
};
home-manager.extraSpecialArgs = { inherit inputs; };
};
in {
nixosConfigurations = {
case = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/case/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { extraModules = [ ./alex/desktop.nix ./alex/personal.nix ]; })
];
};
count = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/count/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { extraModules = [ ./alex/desktop.nix ./alex/personal.nix ]; })
];
};
armitage = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/armitage/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { extraModules = [ ./alex/desktop.nix ]; })
];
};
alt = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/alt/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig {})
];
};
nightcity = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nightcity/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig {})
];
};
# other hosts...
};
};
}