Nix configurations for my homelab
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable-small";
4 nixpkgs-stable.url = "github:NixOS/nixpkgs?ref=nixos-25.05-small";
5 nixpkgs-unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
6
7 impermanence.url = "github:nix-community/impermanence";
8 sops-nix.url = "github:Mic92/sops-nix";
9
10 yemou-dotfiles = {
11 url = "git+https://tangled.org/did:plc:c6qso2k5s2quybbinxtkbskq";
12 flake = false;
13 };
14
15 yemou-scripts = {
16 url = "git+https://tangled.org/did:plc:jqjbwsvh6dn6qinef67niuze";
17 inputs.nixpkgs.follows = "nixpkgs";
18 };
19
20 home-manager = {
21 url = "github:nix-community/home-manager";
22 inputs.nixpkgs.follows = "nixpkgs";
23 };
24
25 nix-minecraft.url = "github:Infinidoge/nix-minecraft";
26 tangled.url = "git+https://tangled.org/did:plc:j5hmlfdrwkvtxm7cjmu7j2is?ref=refs/tags/v1.15.0-alpha";
27 };
28
29 outputs =
30 {
31 self,
32 nixpkgs,
33 impermanence,
34 sops-nix,
35 home-manager,
36 ...
37 }@inputs:
38 let
39 genSystemConfigs = nixpkgs.lib.genAttrs [
40 "lily"
41 "lutea"
42 ];
43 systems = [ "x86_64-linux" ];
44 forSystems = func: nixpkgs.lib.genAttrs systems (system: func (import nixpkgs { inherit system; }));
45 in
46 {
47 formatter = forSystems (p: p.nixfmt-tree.override { settings.formatter.nixfmt.options = [ "-w 120" ]; });
48 nixosConfigurations = genSystemConfigs (
49 hostname:
50 nixpkgs.lib.nixosSystem {
51 specialArgs = inputs;
52 modules = [
53 impermanence.nixosModules.impermanence
54 ./${hostname}/config.nix
55 sops-nix.nixosModules.sops
56 home-manager.nixosModules.home-manager
57 {
58 home-manager = {
59 extraSpecialArgs = inputs;
60 useGlobalPkgs = true;
61 useUserPackages = true;
62 users.mou = import ./${hostname}/home.nix;
63 };
64 }
65 ];
66 }
67 );
68 };
69}