summaryrefslogtreecommitdiff
path: root/hosts/common.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-05 02:44:22 -0400
committerseth <[email protected]>2023-05-05 02:44:22 -0400
commit3051d75c5ebe4284a6d50f1ea2b3a2f39e01a38d (patch)
tree913db0783129b37a76a538cf9743afc2365dbee8 /hosts/common.nix
parent4f1cc719a12ed27b23f2830489db3845c36c88ed (diff)
flake: restructure a lot
Diffstat (limited to 'hosts/common.nix')
-rw-r--r--hosts/common.nix87
1 files changed, 87 insertions, 0 deletions
diff --git a/hosts/common.nix b/hosts/common.nix
new file mode 100644
index 0000000..df9e6f0
--- /dev/null
+++ b/hosts/common.nix
@@ -0,0 +1,87 @@
+{
+ inputs,
+ self,
+}: let
+ inherit (inputs) getchoo home-manager nixpkgs nixpkgsUnstable nur ragenix;
+in {
+ personal = {
+ system = "x86_64-linux";
+ builder = nixpkgsUnstable.lib.nixosSystem;
+
+ dir = ./.;
+
+ modules = [
+ ragenix.nixosModules.default
+ home-manager.nixosModules.home-manager
+ nur.nixosModules.nur
+
+ self.nixosModules.getchoo
+ ../users/seth
+
+ {
+ age = {
+ identityPaths = ["/etc/age/key"];
+ secrets = let
+ baseDir = "${self}/secrets/shared";
+ in {
+ rootPassword.file = "${baseDir}/rootPassword.age";
+ sethPassword.file = "${baseDir}/sethPassword.age";
+ };
+ };
+
+ nixpkgs = {
+ overlays = [nur.overlay getchoo.overlays.default];
+ config.allowUnfree = true;
+ };
+
+ nix = {
+ registry = {
+ getchoo.flake = getchoo;
+ nixpkgs.flake = nixpkgsUnstable;
+ };
+
+ settings = {
+ trusted-substituters = [
+ "https://getchoo.cachix.org"
+ "https://nix-community.cachix.org"
+ "https://hercules-ci.cachix.org"
+ "https://wurzelpfropf.cachix.org"
+ ];
+
+ trusted-public-keys = [
+ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ "hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0="
+ "wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
+ ];
+ };
+ };
+
+ getchoo.nixos.enable = true;
+ system.stateVersion = "23.05";
+ }
+ ];
+
+ specialArgs = inputs;
+ };
+
+ server = {
+ builder = nixpkgs.lib.nixosSystem;
+
+ dir = ./.;
+
+ modules = [
+ ragenix.nixosModules.default
+ ../modules/base
+ ../modules/nixos
+ ../modules/server
+
+ {
+ getchoo.server.enable = true;
+ nix.registry.nixpkgs.flake = nixpkgs;
+ }
+ ];
+
+ specialArgs = inputs;
+ };
+}