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=push-ksrsmmytwuul"; 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 colmenaHive = colmena.lib.makeHive { 31 meta = { 32 nixpkgs = nixpkgs.legacyPackages.x86_64-linux; 33 specialArgs = { 34 nixery-pkgs = import nixery-flake.outPath { 35 pkgs = import nixpkgs { system = "x86_64-linux"; }; 36 }; 37 commonArgs = import ./common/ssh.nix; 38 }; 39 }; 40 41 defaults = { pkgs, ... }: { 42 environment.systemPackages = [ 43 pkgs.curl 44 ]; 45 }; 46 nixery = { pkgs, ... }: { 47 deployment = { 48 targetHost = "nixery.tangled.sh"; 49 targetPort = 22; 50 targetUser = "tangler"; 51 buildOnTarget = true; 52 }; 53 nixpkgs.system = "x86_64-linux"; 54 55 imports = [ 56 disko.nixosModules.disko 57 tangled.nixosModules.spindle 58 ./hosts/nixery/configuration.nix 59 ./hosts/nixery/services/nginx.nix 60 ./hosts/nixery/services/nixery.nix 61 ]; 62 time.timeZone = "Europe/Helsinki"; 63 }; 64 }; 65 }; 66}