nix-flake/flake.nix
satr14 2940656cf1
Some checks failed
Activate Homelab Configuration / rebuild (push) Failing after 2m45s
mc server
2026-05-02 18:41:49 +07:00

74 lines
2 KiB
Nix

{
description = "satr14's nix flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
hm = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
gl.url = "github:nix-community/nixGL";
ctp.url = "github:catppuccin/nix";
mc.url = "github:Infinidoge/nix-minecraft";
};
outputs = inputs: let
pkgs = import inputs.nixpkgs {
system = "x86_64-linux";
overlays = [ inputs.gl.overlay ];
config = {
allowUnfree = true;
permittedInsecurePackages = [ "ventoy-qt5-1.1.12" ];
};
};
args = {
inherit inputs;
} // import ./lib/options.nix;
nixosConfig = host: inputs.nixpkgs.lib.nixosSystem {
inherit pkgs;
specialArgs = args // { hostname = host; };
modules = [
./hosts/${host}/config.nix
inputs.ctp.nixosModules.catppuccin
];
};
nixosConfigWithHome = host: inputs.nixpkgs.lib.nixosSystem {
inherit pkgs;
specialArgs = args // { hostname = host; };
modules = [
./hosts/${host}/config.nix
inputs.ctp.nixosModules.catppuccin
inputs.hm.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = args // { hostname = host; };
backupFileExtension = ".hm-backup";
users.${args.username} = import ./hosts/${host}/home.nix;
sharedModules = [ inputs.ctp.homeModules.catppuccin ];
};
}
];
};
homeConfig = host: inputs.hm.lib.homeManagerConfiguration {
extraSpecialArgs = args // { hostname = host; };
inherit pkgs;
modules = [
./hosts/${host}/home.nix
inputs.ctp.homeModules.catppuccin
];
};
in {
nixosConfigurations = {
thinkpad = nixosConfigWithHome "thinkpad";
homelab = nixosConfigWithHome "homelab";
bootstrap = nixosConfig "bootstrap";
};
homeConfigurations = {
bootstrap = homeConfig "bootstrap";
};
};
}