Compare commits

..

No commits in common. "0b6d72a4b630935becaa8b4b78fad01a6f94cac9" and "a938b33679575ae5870e7f73af24e318a034084c" have entirely different histories.

7 changed files with 51 additions and 140 deletions

View file

@ -21,7 +21,7 @@ The canonical location for this repository is https://git.qenya.tel/qenya/nixfil
### Building ### Building
To build locally, run `nixos-rebuild switch --flake .#[hostname]` as root. To build locally, run `colmena apply-local` as root.
To build the remote machines, run `colmena apply`. See the [colmena documentation](https://colmena.cli.rs/) for command-line options. Notable options include: To build the remote machines, run `colmena apply`. See the [colmena documentation](https://colmena.cli.rs/) for command-line options. Notable options include:
* `--on [hostname]`: build a specific machine only * `--on [hostname]`: build a specific machine only

View file

@ -6,7 +6,6 @@
./environment.nix ./environment.nix
./home-manager.nix ./home-manager.nix
./nginx.nix ./nginx.nix
./nix.nix
./openssh.nix ./openssh.nix
./security.nix ./security.nix
./steam.nix ./steam.nix

View file

@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
nix.settings.experimental-features = "nix-command flakes";
nix.nixPath = [ "nixpkgs=flake:nixpkgs" ];
nixpkgs.config.allowUnfree = true;
}

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, inputs, ... }: { config, lib, pkgs, ... }:
let keys = import ../../keys.nix; let keys = import ../../keys.nix;
in { in {
@ -11,6 +11,4 @@ in {
}; };
programs.zsh.enable = true; programs.zsh.enable = true;
home-manager.users."qenya" = inputs.self.homeManagerModules."qenya";
} }

View file

@ -39,60 +39,6 @@
"url": "https://git.qenya.tel/qenya/birdsong" "url": "https://git.qenya.tel/qenya/birdsong"
} }
}, },
"colmena": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"stable": "stable"
},
"locked": {
"lastModified": 1711386353,
"narHash": "sha256-gWEpb8Hybnoqb4O4tmpohGZk6+aerAbJpywKcFIiMlg=",
"owner": "zhaofengli",
"repo": "colmena",
"rev": "cd65ef7a25cdc75052fbd04b120aeb066c3881db",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "colmena",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -121,11 +67,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726592409, "lastModified": 1720042825,
"narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=", "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594", "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -137,11 +83,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726447378, "lastModified": 1725001927,
"narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -151,29 +97,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgsSmall": {
"locked": {
"lastModified": 1726611721,
"narHash": "sha256-oSDOQ5c7CTVzkaG5A19UW3Yxsv9TLNFNcrvQT9F4Pz0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a51a2cef87fc37c7e31d3a5345bc493e5f7a5f6e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1726681508, "lastModified": 1725486293,
"narHash": "sha256-xz858EXcKZjWR6TPyU84BTeMHIPewGW68DutnxghaR4=", "narHash": "sha256-XRWbx8JcTCVoGxr3P2YL/tK4s4HzZBhUqlxr91zLOZs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "59c5c2575c0cae6bc98b9de8161731cfb8cdc1f0", "rev": "444e1f3fdf23aa476489b0038e0738c6f4d9df85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -192,11 +122,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726509788, "lastModified": 1725914634,
"narHash": "sha256-PmCmO8NDKzwHrTp9Ox/rcLiCYivqIpZlnLk8wZRjv2I=", "narHash": "sha256-U74hu15xSb6JNySMOwyJrsh4uk1DVa182bdHLeHdYMc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "plasma-manager", "repo": "plasma-manager",
"rev": "5a0c70a007837e2db01e0bb68971792e8653d32c", "rev": "60becd0e994e25b372c8d0500fc944396f6c1085",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -209,30 +139,12 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"birdsong": "birdsong", "birdsong": "birdsong",
"colmena": "colmena",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgsSmall": "nixpkgsSmall",
"nur": "nur", "nur": "nur",
"plasma-manager": "plasma-manager" "plasma-manager": "plasma-manager"
} }
}, },
"stable": {
"locked": {
"lastModified": 1696039360,
"narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "32dcb45f66c0487e92db8303a798ebc548cadedc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View file

@ -2,8 +2,6 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgsSmall.url = "github:NixOS/nixpkgs/nixos-24.05-small";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -25,16 +23,39 @@
}; };
}; };
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
birdsong.url = "git+https://git.qenya.tel/qenya/birdsong?ref=main"; birdsong.url = "git+https://git.qenya.tel/qenya/birdsong?ref=main";
}; };
outputs = inputs@{ self, nixpkgs, nixpkgsSmall, home-manager, plasma-manager, nur, agenix, colmena, birdsong, ... }: { outputs = inputs@{ self, nixpkgs, home-manager, plasma-manager, nur, agenix, birdsong, ... }: {
nixosConfigurations = (colmena.lib.makeHive self.outputs.colmena).nodes; nixosModules.default = {
nix.settings.experimental-features = "nix-command flakes";
nix.nixPath = [ "nixpkgs=flake:nixpkgs" ];
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ nur.overlay ];
# TODO: make this or something like it work without infinite recursion
# home-manager.users."qenya" = lib.mkIf (config.users.users ? "qenya") self.homeManagerModules."qenya";
home-manager.users."qenya" = self.homeManagerModules."qenya";
imports = [
home-manager.nixosModules.home-manager
nur.nixosModules.nur
agenix.nixosModules.default
birdsong.nixosModules.default
./common
./services
];
};
# TODO: simplify
nixosConfigurations = {
"kilgharrah" = nixpkgs.lib.nixosSystem { modules = [ ./hosts/kilgharrah self.nixosModules.default ]; };
"tohru" = nixpkgs.lib.nixosSystem { modules = [ ./hosts/tohru self.nixosModules.default ]; };
"yevaud" = nixpkgs.lib.nixosSystem { modules = [ ./hosts/yevaud self.nixosModules.default ]; };
"orm" = nixpkgs.lib.nixosSystem { modules = [ ./hosts/orm self.nixosModules.default ]; };
"kalessin" = nixpkgs.lib.nixosSystem { modules = [ ./hosts/kalessin self.nixosModules.default ]; };
};
# The name of this output type is not standardised. I have picked # The name of this output type is not standardised. I have picked
# "homeManagerModules" as the discussion here suggests it's the most common: # "homeManagerModules" as the discussion here suggests it's the most common:
@ -54,26 +75,11 @@
colmena = { colmena = {
meta = { meta = {
nixpkgs = import nixpkgs { system = "x86_64-linux"; }; nixpkgs = import nixpkgs { system = "x86_64-linux"; };
nodeNixpkgs = { nodeNixpkgs = builtins.mapAttrs (name: value: value.pkgs) self.nixosConfigurations;
kilgharrah = import nixpkgs { system = "x86_64-linux"; };
tohru = import nixpkgs { system = "x86_64-linux"; };
yevaud = import nixpkgsSmall { system = "x86_64-linux"; };
orm = import nixpkgsSmall { system = "x86_64-linux"; };
kalessin = import nixpkgsSmall { system = "aarch64-linux"; };
};
specialArgs = { inherit inputs; };
}; };
defaults.imports = [ # TODO: eliminate duplication with nixosConfigurations
home-manager.nixosModules.home-manager defaults.imports = [ self.nixosModules.default ];
nur.nixosModules.nur
{ nixpkgs.overlays = [ nur.overlay ]; }
agenix.nixosModules.default
birdsong.nixosModules.default
./common
./services
];
kilgharrah.imports = [ ./hosts/kilgharrah ]; kilgharrah.imports = [ ./hosts/kilgharrah ];
tohru.imports = [ ./hosts/tohru ]; tohru.imports = [ ./hosts/tohru ];
yevaud.imports = [ ./hosts/yevaud ]; yevaud.imports = [ ./hosts/yevaud ];

View file

@ -38,7 +38,10 @@ in
"nix.serverSettings".nil = { "nix.serverSettings".nil = {
diagnostics.ignored = [ "unused_binding" "unused_with" ]; diagnostics.ignored = [ "unused_binding" "unused_with" ];
formatting.command = [ "nixpkgs-fmt" ]; formatting.command = [ "nixpkgs-fmt" ];
nix.flake.autoArchive = true; nix.flake = {
autoArchive = true;
autoEvalInputs = true;
};
}; };
"terminal.integrated.allowChords" = false; "terminal.integrated.allowChords" = false;
"terminal.integrated.defaultProfile.linux" = "zsh"; "terminal.integrated.defaultProfile.linux" = "zsh";