Tangled infrastructure definitions in Nix
1{ 2 description = "nix infra for tangled"; 3 inputs = { 4 nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; 5 tangled.url = "git+https://tangled.sh/@tangled.sh/core?ref=master"; 6 colmena.url = "github:zhaofengli/colmena/release-0.4.x"; 7 disko = { 8 url = "github:nix-community/disko"; 9 inputs.nixpkgs.follows = "nixpkgs"; 10 }; 11 nixery-flake = { 12 type = "github"; 13 owner = "tazjin"; 14 repo = "nixery"; 15 flake = false; 16 }; 17 }; 18 19 outputs = 20 { nixpkgs, disko, colmena, nixery-flake, tangled, ... }: 21 { 22 nixosConfigurations.nixery = nixpkgs.lib.nixosSystem { 23 system = "x86_64-linux"; 24 modules = [ 25 disko.nixosModules.disko 26 tangled.nixosModules.spindle 27 ./hosts/nixery/configuration.nix 28 ]; 29 }; 30 nixosConfigurations.pds = nixpkgs.lib.nixosSystem { 31 system = "x86_64-linux"; 32 modules = [ 33 disko.nixosModules.disko 34 ./hosts/pds/configuration.nix 35 ]; 36 }; 37 38 colmenaHive = colmena.lib.makeHive { 39 meta = { 40 nixpkgs = nixpkgs.legacyPackages.x86_64-linux; 41 specialArgs = { 42 nixery-pkgs = import nixery-flake.outPath { 43 pkgs = import nixpkgs { system = "x86_64-linux"; }; 44 }; 45 commonArgs = import ./common/ssh.nix; 46 }; 47 }; 48 49 defaults = { pkgs, ... }: { 50 environment.systemPackages = [ 51 pkgs.curl 52 ]; 53 }; 54 pds = { pkgs, ... }: { 55 deployment = { 56 targetHost = "tngl.sh"; 57 targetPort = 22; 58 targetUser = "tangler"; 59 buildOnTarget = true; 60 }; 61 nixpkgs.system = "x86_64-linux"; 62 63 imports = [ 64 disko.nixosModules.disko 65 ./hosts/pds/configuration.nix 66 ./hosts/pds/services/nginx.nix 67 ./hosts/pds/services/pds.nix 68 ]; 69 time.timeZone = "Europe/Helsinki"; 70 }; 71 72 nixery = { pkgs, ... }: { 73 deployment = { 74 targetHost = "nixery.tangled.sh"; 75 targetPort = 22; 76 targetUser = "tangler"; 77 buildOnTarget = true; 78 }; 79 nixpkgs.system = "x86_64-linux"; 80 81 imports = [ 82 disko.nixosModules.disko 83 tangled.nixosModules.spindle 84 ./hosts/nixery/configuration.nix 85 ./hosts/nixery/services/nginx.nix 86 ./hosts/nixery/services/openbao/openbao.nix 87 ./hosts/nixery/services/openbao/proxy.nix 88 ./hosts/nixery/services/nixery.nix 89 ]; 90 time.timeZone = "Europe/Helsinki"; 91 }; 92 }; 93 }; 94}