Files
nixos/flake.nix
Alexander Wainwright f9238bb576 Refactor flake.nix
And add backup extension.
2025-12-23 10:19:21 +10:00

83 lines
2.6 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 = { isDesktop }: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.alex = import ./alex/home.nix;
home-manager.extraSpecialArgs = { inherit inputs isDesktop; };
};
in {
nixosConfigurations = {
case = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/case/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { isDesktop = true; })
];
};
count = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/count/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { isDesktop = true; })
];
};
armitage = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/armitage/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { isDesktop = true; })
];
};
alt = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/alt/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { isDesktop = false; })
];
};
nightcity = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nightcity/configuration.nix
home-manager.nixosModules.home-manager
(mkHomeManagerConfig { isDesktop = false; })
];
};
# other hosts...
};
};
}