···
description = "nix infra for tangled";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
tangled.url = "git+https://tangled.org/@tangled.org/core";
···
20
-
{ nixpkgs, disko, colmena, nixery-flake, tangled, ... }:
22
-
nixosConfigurations.nixery = nixpkgs.lib.nixosSystem {
23
-
system = "x86_64-linux";
25
-
disko.nixosModules.disko
26
-
tangled.nixosModules.spindle
27
-
./hosts/nixery/configuration.nix
30
-
nixosConfigurations.pds = nixpkgs.lib.nixosSystem {
31
-
system = "x86_64-linux";
33
-
commonArgs = import ./common/ssh.nix;
36
-
disko.nixosModules.disko
37
-
./hosts/pds/configuration.nix
40
-
nixosConfigurations.appview = nixpkgs.lib.nixosSystem {
41
-
system = "x86_64-linux";
43
-
commonArgs = import ./common/ssh.nix;
46
-
disko.nixosModules.disko
47
-
./hosts/appview/configuration.nix
20
+
outputs = { nixpkgs, disko, colmena, nixery-flake, tangled, ... }:
22
+
system = "x86_64-linux";
23
+
commonArgs = import ./common/ssh.nix;
51
-
colmenaHive = colmena.lib.makeHive {
53
-
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
55
-
nixery-pkgs = import nixery-flake.outPath {
56
-
pkgs = import nixpkgs { system = "x86_64-linux"; };
58
-
commonArgs = import ./common/ssh.nix;
25
+
# Helper function to create nixosConfiguration
26
+
mkHost = hostname: extraModules:
27
+
nixpkgs.lib.nixosSystem {
29
+
specialArgs = { inherit commonArgs; };
31
+
disko.nixosModules.disko
32
+
./hosts/${hostname}/configuration.nix
62
-
defaults = { pkgs, ... }: {
63
-
environment.systemPackages = [
67
-
appview = { pkgs, ... }: {
36
+
# Helper function to create colmena host
37
+
mkColmenaHost = hostname: targetHost: extraModules:
69
-
targetHost = "alpha.tangled.sh";
74
-
nixpkgs.system = "x86_64-linux";
45
+
nixpkgs.system = system;
46
+
time.timeZone = "Europe/Helsinki";
49
+
./hosts/${hostname}/configuration.nix
53
+
# Host configurations
tangled.nixosModules.appview
78
-
./hosts/appview/configuration.nix
./hosts/appview/services/appview.nix
./hosts/appview/services/nginx-alpha.nix
82
-
time.timeZone = "Europe/Helsinki";
61
+
target = "alpha.tangled.sh";
84
-
pds = { pkgs, ... }: {
86
-
targetHost = "tngl.sh";
88
-
targetUser = "tangler";
89
-
buildOnTarget = true;
91
-
nixpkgs.system = "x86_64-linux";
94
-
disko.nixosModules.disko
95
-
./hosts/pds/configuration.nix
./hosts/pds/services/nginx.nix
./hosts/pds/services/pds.nix
99
-
time.timeZone = "Europe/Helsinki";
102
-
nixery = { pkgs, ... }: {
104
-
targetHost = "nixery.tangled.sh";
106
-
targetUser = "tangler";
107
-
buildOnTarget = true;
109
-
nixpkgs.system = "x86_64-linux";
112
-
disko.nixosModules.disko
tangled.nixosModules.spindle
114
-
./hosts/nixery/configuration.nix
./hosts/nixery/services/nginx.nix
./hosts/nixery/services/openbao/openbao.nix
./hosts/nixery/services/openbao/proxy.nix
./hosts/nixery/services/nixery.nix
120
-
time.timeZone = "Europe/Helsinki";
80
+
target = "nixery.tangled.sh";
85
+
# nixos-anywhere and nixos-rebuild use these
86
+
nixosConfigurations = {
87
+
appview = mkHost "appview" hosts.appview.modules;
88
+
pds = mkHost "pds" hosts.pds.modules;
89
+
nixery = mkHost "nixery" hosts.nixery.modules;
93
+
colmenaHive = colmena.lib.makeHive {
95
+
nixpkgs = nixpkgs.legacyPackages.${system};
98
+
nixery-pkgs = import nixery-flake.outPath {
99
+
pkgs = import nixpkgs { inherit system; };
104
+
defaults = { pkgs, ... }: {
105
+
environment.systemPackages = [ pkgs.curl ];
108
+
appview = mkColmenaHost "appview" hosts.appview.target hosts.appview.modules;
109
+
pds = mkColmenaHost "pds" hosts.pds.target hosts.pds.modules;
110
+
nixery = mkColmenaHost "nixery" hosts.nixery.target hosts.nixery.modules;