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 yemou-scripts = {
15 url = "git+https://tangled.org/did:plc:jqjbwsvh6dn6qinef67niuze";
16 inputs.nixpkgs.follows = "nixpkgs";
17 };
18 home-manager = {
19 url = "github:nix-community/home-manager";
20 inputs.nixpkgs.follows = "nixpkgs";
21 };
22
23 nix-minecraft.url = "github:Infinidoge/nix-minecraft";
24 roc-lang.url = "github:roc-lang/roc";
25 tangled.url = "git+https://tangled.org/did:plc:j5hmlfdrwkvtxm7cjmu7j2is?ref=refs/tags/v1.14.0-alpha";
26 };
27
28 outputs =
29 {
30 self,
31 nixpkgs,
32 impermanence,
33 sops-nix,
34 home-manager,
35 ...
36 }@inputs:
37 let
38 genSystemConfigs = nixpkgs.lib.genAttrs [
39 "lily"
40 "lutea"
41 ];
42 systems = [ "x86_64-linux" ];
43 forSystems = func: nixpkgs.lib.genAttrs systems (system: func (import nixpkgs { inherit system; }));
44 in
45 {
46 formatter = forSystems (p: p.nixfmt-tree.override { settings.formatter.nixfmt.options = [ "-w 120" ]; });
47 nixosConfigurations = genSystemConfigs (
48 hostname:
49 nixpkgs.lib.nixosSystem {
50 specialArgs = inputs;
51 modules = [
52 impermanence.nixosModules.impermanence
53 ./${hostname}/config.nix
54 sops-nix.nixosModules.sops
55 home-manager.nixosModules.home-manager
56 {
57 home-manager = {
58 extraSpecialArgs = inputs;
59 useGlobalPkgs = true;
60 useUserPackages = true;
61 users.mou = import ./${hostname}/home.nix;
62 };
63 }
64 ];
65 }
66 );
67 };
68}