81 lines
1.9 KiB
Nix
81 lines
1.9 KiB
Nix
{
|
|
description = "My NixOS configuration with flakes and home-manager";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-26.05";
|
|
|
|
disko = {
|
|
url = "github:nix-community/disko";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, home-manager, disko, ... }@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
mkHost = { hostname, username, system ? "x86_64-linux", extraModules ? [ ] }:
|
|
nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
|
|
specialArgs = {
|
|
inherit inputs;
|
|
hostname = hostname;
|
|
username = username;
|
|
};
|
|
|
|
modules = [
|
|
./hosts/default/configuration.nix
|
|
./hosts/${hostname}/configuration.nix
|
|
|
|
disko.nixosModules.disko
|
|
|
|
{
|
|
disko.devices = import ./hosts/${hostname}/disko.nix;
|
|
}
|
|
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
|
|
users.${username} = import ./home/users/${username}.nix;
|
|
|
|
extraSpecialArgs = {
|
|
inherit inputs;
|
|
hostname = hostname;
|
|
};
|
|
};
|
|
}
|
|
] ++ extraModules;
|
|
};
|
|
|
|
in {
|
|
nixosConfigurations = {
|
|
thek4n = mkHost {
|
|
hostname = "thek4n";
|
|
username = "thek4n";
|
|
extraModules = [
|
|
./hosts/thek4n/hardware.nix
|
|
];
|
|
};
|
|
};
|
|
|
|
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
|
|
buildInputs = with nixpkgs.legacyPackages.${system}; [
|
|
nixpkgs-fmt
|
|
nixd
|
|
git
|
|
];
|
|
};
|
|
};
|
|
}
|