Compare commits
No commits in common. "5341235bc3435efa4cf3015954e06ca278570c1f" and "2352a1a9177fbb7d3fed042cc74f80e079196020" have entirely different histories.
5341235bc3
...
2352a1a917
22 changed files with 1066 additions and 1208 deletions
34
deploy.nix
34
deploy.nix
|
@ -1,26 +1,26 @@
|
||||||
{
|
{ self, deploy-rs, ... }:
|
||||||
self,
|
let
|
||||||
deploy-rs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
deployArch = "x86_64-linux";
|
deployArch = "x86_64-linux";
|
||||||
mkDeployNodes = nodeDef:
|
mkDeployNodes = nodeDef:
|
||||||
builtins.mapAttrs
|
builtins.mapAttrs
|
||||||
(name: machine: nodeDef name machine)
|
(name: machine: nodeDef name machine)
|
||||||
self.machines.${deployArch};
|
self.machines.${deployArch};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
deploy = {
|
deploy = {
|
||||||
sshUser = "root";
|
sshUser = "root";
|
||||||
user = "root";
|
user = "root";
|
||||||
|
|
||||||
nodes = mkDeployNodes (name: machine: let
|
nodes = mkDeployNodes (name: machine:
|
||||||
nixosConfiguration = self.nixosConfigurations.${name};
|
let
|
||||||
in {
|
nixosConfiguration = self.nixosConfigurations.${name};
|
||||||
hostname = nixosConfiguration.config.networking.fqdn;
|
in
|
||||||
profiles.system = {
|
{
|
||||||
remoteBuild = machine.arch != deployArch;
|
hostname = nixosConfiguration.config.networking.fqdn;
|
||||||
path = deploy-rs.lib.${machine.arch}.activate.nixos nixosConfiguration;
|
profiles.system = {
|
||||||
};
|
remoteBuild = machine.arch != deployArch;
|
||||||
});
|
path = deploy-rs.lib.${machine.arch}.activate.nixos nixosConfiguration;
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
116
flake.lock
generated
116
flake.lock
generated
|
@ -109,22 +109,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_4": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
|
@ -179,27 +163,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"kubenix": {
|
"kubenix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
|
@ -299,22 +262,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1720386169,
|
|
||||||
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-24.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable_2": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729357638,
|
"lastModified": 1729357638,
|
||||||
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
|
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
|
||||||
|
@ -362,45 +309,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1726871744,
|
|
||||||
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat_4",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs-unstable"
|
|
||||||
],
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1729104314,
|
|
||||||
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"deploy-rs": "deploy-rs",
|
"deploy-rs": "deploy-rs",
|
||||||
|
@ -413,9 +321,7 @@
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
"sops-nix": "sops-nix"
|
||||||
"sops-nix": "sops-nix",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
|
@ -423,7 +329,7 @@
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729775275,
|
"lastModified": 1729775275,
|
||||||
|
@ -504,24 +410,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs_3"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730025913,
|
|
||||||
"narHash": "sha256-Y9NtFmP8ciLyRsopcCx1tyoaaStKeq+EndwtGCgww7I=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "bae131e525cc8718da22fbeb8d8c7c43c4ea502a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
"utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
|
|
18
flake.nix
18
flake.nix
|
@ -17,12 +17,6 @@
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
||||||
|
|
||||||
pre-commit-hooks = {
|
|
||||||
url = "github:cachix/git-hooks.nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
|
||||||
|
|
||||||
disko = {
|
disko = {
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
|
@ -55,11 +49,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs =
|
||||||
nixpkgs,
|
inputs@{ nixpkgs, flake-utils, ... }:
|
||||||
flake-utils,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-utils.lib.meld inputs [
|
flake-utils.lib.meld inputs [
|
||||||
./scripts
|
./scripts
|
||||||
./deploy.nix
|
./deploy.nix
|
||||||
|
@ -67,6 +58,7 @@
|
||||||
./shell.nix
|
./shell.nix
|
||||||
./utils
|
./utils
|
||||||
./machines
|
./machines
|
||||||
./formatter.nix
|
] // (flake-utils.lib.eachDefaultSystem (system: {
|
||||||
];
|
formatter = nixpkgs.legacyPackages.${system}.nixfmt;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
nixpkgs,
|
|
||||||
treefmt-nix,
|
|
||||||
flake-utils,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-utils.lib.eachDefaultSystem (
|
|
||||||
system: let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
|
||||||
in {
|
|
||||||
formatter = treefmtEval.config.build.wrapper;
|
|
||||||
}
|
|
||||||
)
|
|
|
@ -1,13 +1,9 @@
|
||||||
{
|
{ nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||||
nixpkgs,
|
let
|
||||||
flake-utils,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
|
||||||
machineOpts = {config, ...}: {
|
machineOpts = { config, ... }: {
|
||||||
options = {
|
options = {
|
||||||
arch = lib.mkOption {
|
arch = lib.mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -23,7 +19,7 @@ flake-utils.lib.eachDefaultSystem (system: let
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModule = lib.mkOption {
|
nixosModule = lib.mkOption {
|
||||||
default = {...}: {};
|
default = { ... }: { };
|
||||||
type = lib.types.anything;
|
type = lib.types.anything;
|
||||||
description = ''
|
description = ''
|
||||||
Customized configuration for this machine in the form of a NixOS module.
|
Customized configuration for this machine in the form of a NixOS module.
|
||||||
|
@ -47,19 +43,17 @@ flake-utils.lib.eachDefaultSystem (system: let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
machines =
|
{
|
||||||
(lib.modules.evalModules {
|
machines = (lib.modules.evalModules {
|
||||||
modules = [
|
modules = [
|
||||||
allOpts
|
allOpts
|
||||||
./warwick.nix
|
./warwick.nix
|
||||||
./atlas.nix
|
./atlas.nix
|
||||||
./jefke.nix
|
./jefke.nix
|
||||||
./lewis.nix
|
./lewis.nix
|
||||||
# ./talos.nix
|
# ./talos.nix
|
||||||
# ./pikvm.nix
|
# ./pikvm.nix
|
||||||
];
|
];
|
||||||
})
|
}).config.machines;
|
||||||
.config
|
|
||||||
.machines;
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
arch = "aarch64-linux";
|
arch = "aarch64-linux";
|
||||||
isRaspberryPi = true;
|
isRaspberryPi = true;
|
||||||
|
|
||||||
nixosModule = {
|
nixosModule = { config, inputs, lib, ... }: {
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
# imports = [ "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ];
|
# imports = [ "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" ];
|
||||||
lab = {
|
lab = {
|
||||||
storage.profile = "pi";
|
storage.profile = "pi";
|
||||||
|
@ -22,7 +17,7 @@
|
||||||
v4l-utils
|
v4l-utils
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];
|
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
machines.talos = {
|
machines.talos = {
|
||||||
arch = "x86_64-linux";
|
arch = "x86_64-linux";
|
||||||
|
|
||||||
nixosModule = {lib, ...}: {
|
nixosModule = { lib, ... }: {
|
||||||
lab.storage.profile = "normal";
|
lab.storage.profile = "normal";
|
||||||
|
|
||||||
# boot.loader.systemd-boot.enable = lib.mkForce false;
|
# boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.backups;
|
cfg = config.lab.backups;
|
||||||
|
|
||||||
borgmaticConfig = pkgs.writeTextFile {
|
borgmaticConfig = pkgs.writeTextFile {
|
||||||
name = "borgmatic-config.yaml";
|
name = "borgmatic-config.yaml";
|
||||||
|
|
||||||
text = lib.generators.toYAML {} {
|
text = lib.generators.toYAML { } {
|
||||||
source_directories = ["/mnt/longhorn/persistent/longhorn-backup"];
|
source_directories = [ "/mnt/longhorn/persistent/longhorn-backup" ];
|
||||||
|
|
||||||
repositories = [
|
repositories = [
|
||||||
{
|
{
|
||||||
|
@ -31,7 +27,8 @@
|
||||||
encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/borgPassphrase".path}";
|
encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/borgPassphrase".path}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.lab.backups = {
|
options.lab.backups = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -51,13 +48,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs; [borgbackup];
|
environment.systemPackages = with pkgs; [ borgbackup ];
|
||||||
# Converted from:
|
# Converted from:
|
||||||
# https://github.com/borgmatic-collective/borgmatic/tree/84823dfb912db650936e3492f6ead7e0e0d32a0f/sample/systemd
|
# https://github.com/borgmatic-collective/borgmatic/tree/84823dfb912db650936e3492f6ead7e0e0d32a0f/sample/systemd
|
||||||
systemd.services.borgmatic = {
|
systemd.services.borgmatic = {
|
||||||
description = "borgmatic backup";
|
description = "borgmatic backup";
|
||||||
wants = ["network-online.target"];
|
wants = [ "network-online.target" ];
|
||||||
after = ["network-online.target"];
|
after = [ "network-online.target" ];
|
||||||
unitConfig.ConditionACPower = true;
|
unitConfig.ConditionACPower = true;
|
||||||
preStart = "${pkgs.coreutils}/bin/sleep 10s";
|
preStart = "${pkgs.coreutils}/bin/sleep 10s";
|
||||||
|
|
||||||
|
@ -78,7 +75,7 @@ in {
|
||||||
|
|
||||||
systemd.timers.borgmatic = {
|
systemd.timers.borgmatic = {
|
||||||
description = "Run borgmatic backup";
|
description = "Run borgmatic backup";
|
||||||
wantedBy = ["timers.target"];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "*-*-* 3:00:00";
|
OnCalendar = "*-*-* 3:00:00";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
|
@ -87,8 +84,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"borg/borgPassphrase" = {};
|
"borg/borgPassphrase" = { };
|
||||||
"borg/borgbasePrivateKey" = {};
|
"borg/borgbasePrivateKey" = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
{
|
{ lib, config, ... }:
|
||||||
lib,
|
let
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.data-sharing;
|
cfg = config.lab.data-sharing;
|
||||||
|
|
||||||
nfsShares = [
|
nfsShares = [
|
||||||
|
@ -16,12 +13,13 @@
|
||||||
|
|
||||||
nfsExports = lib.strings.concatLines (
|
nfsExports = lib.strings.concatLines (
|
||||||
builtins.map
|
builtins.map
|
||||||
(
|
(share:
|
||||||
share: "${share} 192.168.30.0/16(rw,sync,no_subtree_check,no_root_squash) 127.0.0.1/8(rw,sync,no_subtree_check,no_root_squash) 10.0.0.0/8(rw,sync,no_subtree_check,no_root_squash)"
|
"${share} 192.168.30.0/16(rw,sync,no_subtree_check,no_root_squash) 127.0.0.1/8(rw,sync,no_subtree_check,no_root_squash) 10.0.0.0/8(rw,sync,no_subtree_check,no_root_squash)"
|
||||||
)
|
)
|
||||||
nfsShares
|
nfsShares
|
||||||
);
|
);
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.lab.data-sharing = {
|
options.lab.data-sharing = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -1,27 +1,17 @@
|
||||||
{
|
{ self, pkgs, config, lib, inputs, machine, ... }: {
|
||||||
self,
|
imports = [
|
||||||
pkgs,
|
./storage.nix
|
||||||
config,
|
./backups.nix
|
||||||
lib,
|
./networking
|
||||||
inputs,
|
./data-sharing.nix
|
||||||
machine,
|
./monitoring
|
||||||
...
|
./k3s
|
||||||
}: {
|
./tailscale.nix
|
||||||
imports =
|
machine.nixosModule
|
||||||
[
|
inputs.disko.nixosModules.disko
|
||||||
./storage.nix
|
inputs.sops-nix.nixosModules.sops
|
||||||
./backups.nix
|
inputs.nix-snapshotter.nixosModules.nix-snapshotter
|
||||||
./networking
|
] ++ lib.lists.optional (machine.isRaspberryPi) inputs.nixos-hardware.nixosModules.raspberry-pi-4;
|
||||||
./data-sharing.nix
|
|
||||||
./monitoring
|
|
||||||
./k3s
|
|
||||||
./tailscale.nix
|
|
||||||
machine.nixosModule
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
inputs.nix-snapshotter.nixosModules.nix-snapshotter
|
|
||||||
]
|
|
||||||
++ lib.lists.optional (machine.isRaspberryPi) inputs.nixos-hardware.nixosModules.raspberry-pi-4;
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
@ -41,9 +31,7 @@
|
||||||
i18n = {
|
i18n = {
|
||||||
defaultLocale = "en_US.UTF-8";
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
extraLocaleSettings = let
|
extraLocaleSettings = let extraLocale = "nl_NL.UTF-8"; in {
|
||||||
extraLocale = "nl_NL.UTF-8";
|
|
||||||
in {
|
|
||||||
LC_ADDRESS = extraLocale;
|
LC_ADDRESS = extraLocale;
|
||||||
LC_IDENTIFICATION = extraLocale;
|
LC_IDENTIFICATION = extraLocale;
|
||||||
LC_MEASUREMENT = extraLocale;
|
LC_MEASUREMENT = extraLocale;
|
||||||
|
@ -109,12 +97,12 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = lib.mkIf (! machine.isRaspberryPi) {
|
boot = lib.mkIf (! machine.isRaspberryPi) {
|
||||||
kernelModules = ["kvm-intel"];
|
kernelModules = [ "kvm-intel" ];
|
||||||
extraModulePackages = [];
|
extraModulePackages = [ ];
|
||||||
kernel.sysctl."fs.inotify.max_user_instances" = 256;
|
kernel.sysctl."fs.inotify.max_user_instances" = 256;
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
kernelModules = [];
|
kernelModules = [ ];
|
||||||
|
|
||||||
availableKernelModules = [
|
availableKernelModules = [
|
||||||
"ahci"
|
"ahci"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{kubenix, ...}: {
|
{ kubenix, ... }: {
|
||||||
imports = [kubenix.modules.k8s];
|
imports = [ kubenix.modules.k8s ];
|
||||||
kubernetes.resources.clusterRoleBindings.cluster-admins = {
|
kubernetes.resources.clusterRoleBindings.cluster-admins = {
|
||||||
roleRef = {
|
roleRef = {
|
||||||
apiGroup = "rbac.authorization.k8s.io";
|
apiGroup = "rbac.authorization.k8s.io";
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
{
|
{ self, inputs, pkgs, lib, config, ... }:
|
||||||
self,
|
let
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.k3s;
|
cfg = config.lab.k3s;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.lab.k3s = {
|
options.lab.k3s = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -67,66 +62,68 @@ in {
|
||||||
address = "/run/nix-snapshotter/nix-snapshotter.sock";
|
address = "/run/nix-snapshotter/nix-snapshotter.sock";
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = let
|
plugins =
|
||||||
k3s-cni-plugins = pkgs.buildEnv {
|
let
|
||||||
name = "k3s-cni-plugins";
|
k3s-cni-plugins = pkgs.buildEnv {
|
||||||
paths = with pkgs; [
|
name = "k3s-cni-plugins";
|
||||||
cni-plugins
|
paths = with pkgs; [
|
||||||
cni-plugin-flannel
|
cni-plugins
|
||||||
];
|
cni-plugin-flannel
|
||||||
};
|
];
|
||||||
in {
|
|
||||||
"io.containerd.grpc.v1.cri" = {
|
|
||||||
stream_server_address = "127.0.0.1";
|
|
||||||
stream_server_port = "10010";
|
|
||||||
enable_selinux = false;
|
|
||||||
enable_unprivileged_ports = true;
|
|
||||||
enable_unprivileged_icmp = true;
|
|
||||||
disable_apparmor = true;
|
|
||||||
disable_cgroup = true;
|
|
||||||
restrict_oom_score_adj = true;
|
|
||||||
sandbox_image = "rancher/mirrored-pause:3.6";
|
|
||||||
containerd.snapshotter = "nix";
|
|
||||||
|
|
||||||
cni = {
|
|
||||||
conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d/";
|
|
||||||
bin_dir = "${k3s-cni-plugins}/bin";
|
|
||||||
};
|
};
|
||||||
};
|
in
|
||||||
|
{
|
||||||
|
"io.containerd.grpc.v1.cri" = {
|
||||||
|
stream_server_address = "127.0.0.1";
|
||||||
|
stream_server_port = "10010";
|
||||||
|
enable_selinux = false;
|
||||||
|
enable_unprivileged_ports = true;
|
||||||
|
enable_unprivileged_icmp = true;
|
||||||
|
disable_apparmor = true;
|
||||||
|
disable_cgroup = true;
|
||||||
|
restrict_oom_score_adj = true;
|
||||||
|
sandbox_image = "rancher/mirrored-pause:3.6";
|
||||||
|
containerd.snapshotter = "nix";
|
||||||
|
|
||||||
"io.containerd.transfer.v1.local".unpack_config = [
|
cni = {
|
||||||
{
|
conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d/";
|
||||||
|
bin_dir = "${k3s-cni-plugins}/bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"io.containerd.transfer.v1.local".unpack_config = [{
|
||||||
platform = "linux/amd64";
|
platform = "linux/amd64";
|
||||||
snapshotter = "nix";
|
snapshotter = "nix";
|
||||||
}
|
}];
|
||||||
];
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
nix-snapshotter.enable = true;
|
nix-snapshotter.enable = true;
|
||||||
|
|
||||||
k3s = let
|
k3s =
|
||||||
serverFlagList = [
|
let
|
||||||
"--image-service-endpoint=unix:///run/nix-snapshotter/nix-snapshotter.sock"
|
serverFlagList = [
|
||||||
"--snapshotter=overlayfs"
|
"--image-service-endpoint=unix:///run/nix-snapshotter/nix-snapshotter.sock"
|
||||||
"--container-runtime-endpoint=unix:///run/containerd/containerd.sock"
|
"--snapshotter=overlayfs"
|
||||||
"--tls-san=${config.networking.fqdn}"
|
"--container-runtime-endpoint=unix:///run/containerd/containerd.sock"
|
||||||
"--disable=servicelb"
|
"--tls-san=${config.networking.fqdn}"
|
||||||
"--cluster-cidr=10.42.0.0/16,2001:cafe:42::/56"
|
"--disable=servicelb"
|
||||||
"--service-cidr=10.43.0.0/16,2001:cafe:43::/112"
|
"--cluster-cidr=10.42.0.0/16,2001:cafe:42::/56"
|
||||||
];
|
"--service-cidr=10.43.0.0/16,2001:cafe:43::/112"
|
||||||
|
];
|
||||||
|
|
||||||
serverFlags = builtins.concatStringsSep " " serverFlagList;
|
serverFlags = builtins.concatStringsSep " " serverFlagList;
|
||||||
in {
|
in
|
||||||
enable = true;
|
{
|
||||||
role = cfg.role;
|
enable = true;
|
||||||
tokenFile = config.sops.secrets."k3s/serverToken".path;
|
role = cfg.role;
|
||||||
extraFlags = lib.mkIf (cfg.role == "server") (lib.mkForce serverFlags);
|
tokenFile = config.sops.secrets."k3s/serverToken".path;
|
||||||
clusterInit = cfg.clusterInit;
|
extraFlags = lib.mkIf (cfg.role == "server") (lib.mkForce serverFlags);
|
||||||
serverAddr = lib.mkIf (! (cfg.serverAddr == null)) cfg.serverAddr;
|
clusterInit = cfg.clusterInit;
|
||||||
};
|
serverAddr = lib.mkIf (! (cfg.serverAddr == null)) cfg.serverAddr;
|
||||||
|
};
|
||||||
|
|
||||||
# Required for Longhorn
|
# Required for Longhorn
|
||||||
openiscsi = {
|
openiscsi = {
|
||||||
|
@ -146,14 +143,11 @@ in {
|
||||||
k3s-bootstrap = lib.mkIf (cfg.role == "server") {
|
k3s-bootstrap = lib.mkIf (cfg.role == "server") {
|
||||||
text = (
|
text = (
|
||||||
let
|
let
|
||||||
k3sBootstrapFile =
|
k3sBootstrapFile = (inputs.kubenix.evalModules.x86_64-linux {
|
||||||
(inputs.kubenix.evalModules.x86_64-linux {
|
module = import ./bootstrap.nix;
|
||||||
module = import ./bootstrap.nix;
|
}).config.kubernetes.result;
|
||||||
})
|
in
|
||||||
.config
|
''
|
||||||
.kubernetes
|
|
||||||
.result;
|
|
||||||
in ''
|
|
||||||
mkdir -p /var/lib/rancher/k3s/server/manifests
|
mkdir -p /var/lib/rancher/k3s/server/manifests
|
||||||
ln -sf ${k3sBootstrapFile} /var/lib/rancher/k3s/server/manifests/k3s-bootstrap.json
|
ln -sf ${k3sBootstrapFile} /var/lib/rancher/k3s/server/manifests/k3s-bootstrap.json
|
||||||
''
|
''
|
||||||
|
@ -172,16 +166,18 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets = let
|
sops.secrets =
|
||||||
keyPathBase = "/var/lib/rancher/k3s/server/tls";
|
let
|
||||||
in {
|
keyPathBase = "/var/lib/rancher/k3s/server/tls";
|
||||||
"k3s/serverToken" = {};
|
in
|
||||||
"k3s/keys/clientCAKey".path = "${keyPathBase}/client-ca.key";
|
{
|
||||||
"k3s/keys/requestHeaderCAKey".path = "${keyPathBase}/request-header-ca.key";
|
"k3s/serverToken" = { };
|
||||||
"k3s/keys/serverCAKey".path = "${keyPathBase}/server-ca.key";
|
"k3s/keys/clientCAKey".path = "${keyPathBase}/client-ca.key";
|
||||||
"k3s/keys/serviceKey".path = "${keyPathBase}/service.key";
|
"k3s/keys/requestHeaderCAKey".path = "${keyPathBase}/request-header-ca.key";
|
||||||
"k3s/keys/etcd/peerCAKey".path = "${keyPathBase}/etcd/peer-ca.key";
|
"k3s/keys/serverCAKey".path = "${keyPathBase}/server-ca.key";
|
||||||
"k3s/keys/etcd/serverCAKey".path = "${keyPathBase}/etcd/server-ca.key";
|
"k3s/keys/serviceKey".path = "${keyPathBase}/service.key";
|
||||||
};
|
"k3s/keys/etcd/peerCAKey".path = "${keyPathBase}/etcd/peer-ca.key";
|
||||||
|
"k3s/keys/etcd/serverCAKey".path = "${keyPathBase}/etcd/server-ca.key";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
{
|
{ lib, config, machines, ... }:
|
||||||
lib,
|
let
|
||||||
config,
|
|
||||||
machines,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.monitoring;
|
cfg = config.lab.monitoring;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
lab.monitoring = {
|
lab.monitoring = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
|
@ -21,9 +18,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
networking.firewall.allowedTCPPorts =
|
networking.firewall.allowedTCPPorts = [ config.services.prometheus.exporters.node.port ]
|
||||||
[config.services.prometheus.exporters.node.port]
|
++ lib.lists.optionals cfg.server.enable [ 80 ];
|
||||||
++ lib.lists.optionals cfg.server.enable [80];
|
|
||||||
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = cfg.server.enable;
|
enable = cfg.server.enable;
|
||||||
|
@ -36,15 +32,12 @@ in {
|
||||||
|
|
||||||
scrapeConfigs = lib.mkIf cfg.server.enable (
|
scrapeConfigs = lib.mkIf cfg.server.enable (
|
||||||
let
|
let
|
||||||
generated =
|
generated = lib.attrsets.mapAttrsToList
|
||||||
lib.attrsets.mapAttrsToList
|
|
||||||
(name: machine: {
|
(name: machine: {
|
||||||
job_name = name;
|
job_name = name;
|
||||||
static_configs = [
|
static_configs = [{
|
||||||
{
|
targets = [ "${name}.dmz:${toString config.services.prometheus.exporters.node.port}" ];
|
||||||
targets = ["${name}.dmz:${toString config.services.prometheus.exporters.node.port}"];
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
})
|
})
|
||||||
machines;
|
machines;
|
||||||
|
|
||||||
|
@ -60,14 +53,12 @@ in {
|
||||||
password = "admin";
|
password = "admin";
|
||||||
};
|
};
|
||||||
|
|
||||||
static_configs = [
|
static_configs = [{
|
||||||
{
|
targets = [ "pikvm.dmz" ];
|
||||||
targets = ["pikvm.dmz"];
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
generated ++ [pikvm]
|
generated ++ [ pikvm ]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
{
|
{ lib, machine, ... }: {
|
||||||
lib,
|
|
||||||
machine,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = {
|
config = {
|
||||||
networking = {
|
networking = {
|
||||||
domain = "dmz";
|
domain = "dmz";
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
{
|
{ lib, config, ... }:
|
||||||
lib,
|
let
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.storage;
|
cfg = config.lab.storage;
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
|
@ -10,7 +7,7 @@
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/NIXOS_SD";
|
device = "/dev/disk/by-label/NIXOS_SD";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
options = ["noatime"];
|
options = [ "noatime" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -90,7 +87,7 @@
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "ext4";
|
format = "ext4";
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
mountOptions = ["defaults"];
|
mountOptions = [ "defaults" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -148,7 +145,7 @@
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "ext4";
|
format = "ext4";
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
mountOptions = ["defaults"];
|
mountOptions = [ "defaults" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -158,7 +155,8 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = modules;
|
imports = modules;
|
||||||
|
|
||||||
options.lab.storage = {
|
options.lab.storage = {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
{
|
{ lib, config, ... }:
|
||||||
lib,
|
let
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
cfg = config.lab.tailscale;
|
cfg = config.lab.tailscale;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options = {
|
options = {
|
||||||
lab.tailscale = {
|
lab.tailscale = {
|
||||||
enable = lib.mkEnableOption "tailscale";
|
enable = lib.mkEnableOption "tailscale";
|
||||||
|
@ -23,17 +21,15 @@ in {
|
||||||
useRoutingFeatures = "server";
|
useRoutingFeatures = "server";
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
|
||||||
extraUpFlags =
|
extraUpFlags = [
|
||||||
[
|
"--accept-dns=false"
|
||||||
"--accept-dns=false"
|
"--hostname=${config.networking.hostName}"
|
||||||
"--hostname=${config.networking.hostName}"
|
] ++ lib.lists.optional cfg.advertiseExitNode "--advertise-exit-node"
|
||||||
]
|
++ lib.lists.optional cfg.advertiseExitNode "--advertise-routes=192.168.30.0/24";
|
||||||
++ lib.lists.optional cfg.advertiseExitNode "--advertise-exit-node"
|
|
||||||
++ lib.lists.optional cfg.advertiseExitNode "--advertise-routes=192.168.30.0/24";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets."tailscale/authKey" = {};
|
sops.secrets."tailscale/authKey" = { };
|
||||||
|
|
||||||
systemd.network.wait-online.ignoredInterfaces = ["tailscale0"];
|
systemd.network.wait-online.ignoredInterfaces = [ "tailscale0" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
21
nixos.nix
21
nixos.nix
|
@ -1,26 +1,23 @@
|
||||||
{
|
{ self, nixpkgs, ... }@inputs:
|
||||||
self,
|
let
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
} @ inputs: let
|
|
||||||
deployArch = "x86_64-linux";
|
deployArch = "x86_64-linux";
|
||||||
machines = self.machines.${deployArch};
|
machines = self.machines.${deployArch};
|
||||||
mkNixosSystems = systemDef:
|
mkNixosSystems = systemDef:
|
||||||
builtins.mapAttrs
|
builtins.mapAttrs
|
||||||
(
|
(name: machine:
|
||||||
name: machine:
|
|
||||||
nixpkgs.lib.nixosSystem (systemDef name machine)
|
nixpkgs.lib.nixosSystem (systemDef name machine)
|
||||||
)
|
)
|
||||||
machines;
|
machines;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixosConfigurations = mkNixosSystems (name: machine: {
|
nixosConfigurations = mkNixosSystems (name: machine: {
|
||||||
system = machine.arch;
|
system = machine.arch;
|
||||||
|
|
||||||
specialArgs = {inherit self inputs machine machines;};
|
specialArgs = { inherit self inputs machine machines; };
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
"${self}/modules"
|
"${self}/modules"
|
||||||
{networking.hostName = name;}
|
{ networking.hostName = name; }
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,23 @@
|
||||||
{
|
{ nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||||
nixpkgs,
|
let
|
||||||
flake-utils,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
createScript = {
|
createScript = { name, runtimeInputs, scriptPath, extraWrapperFlags ? "", ... }:
|
||||||
name,
|
let
|
||||||
runtimeInputs,
|
script = (pkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
|
||||||
scriptPath,
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
extraWrapperFlags ? "",
|
});
|
||||||
...
|
in
|
||||||
}: let
|
|
||||||
script = (pkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
|
|
||||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
|
||||||
});
|
|
||||||
in
|
|
||||||
pkgs.symlinkJoin {
|
pkgs.symlinkJoin {
|
||||||
inherit name;
|
inherit name;
|
||||||
paths = [script] ++ runtimeInputs;
|
paths = [ script ] ++ runtimeInputs;
|
||||||
buildInputs = [pkgs.makeWrapper];
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
postBuild = "wrapProgram $out/bin/${name} --set PATH $out/bin ${extraWrapperFlags}";
|
postBuild = "wrapProgram $out/bin/${name} --set PATH $out/bin ${extraWrapperFlags}";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
packages.bootstrap = createScript {
|
packages.bootstrap = createScript {
|
||||||
name = "bootstrap";
|
name = "bootstrap";
|
||||||
runtimeInputs = with pkgs; [sops coreutils nixos-anywhere];
|
runtimeInputs = with pkgs; [ sops coreutils nixos-anywhere ];
|
||||||
scriptPath = ./bootstrap.sh;
|
scriptPath = ./bootstrap.sh;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
13
shell.nix
13
shell.nix
|
@ -1,12 +1,9 @@
|
||||||
{
|
{ flake-utils, nixpkgs, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||||
flake-utils,
|
let
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [ansible];
|
buildInputs = with pkgs; [ ansible ];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{...}: {
|
|
||||||
projectRootFile = "flake.nix";
|
|
||||||
programs.alejandra.enable = true;
|
|
||||||
}
|
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{ nixpkgs, flake-utils, ... }:
|
||||||
nixpkgs,
|
|
||||||
flake-utils,
|
let
|
||||||
...
|
systemAttrs = flake-utils.lib.eachDefaultSystem (system:
|
||||||
}: let
|
let
|
||||||
systemAttrs = flake-utils.lib.eachDefaultSystem (system: let
|
pkgs = nixpkgs.legacypackages.${system};
|
||||||
pkgs = nixpkgs.legacypackages.${system};
|
lib = pkgs.lib;
|
||||||
lib = pkgs.lib;
|
in
|
||||||
in {
|
{
|
||||||
net = import ./net.nix lib;
|
net = import ./net.nix lib;
|
||||||
});
|
});
|
||||||
|
|
||||||
nonSystemAttrs = {
|
nonSystemAttrs = {
|
||||||
globals = import ./globals.nix;
|
globals = import ./globals.nix;
|
||||||
|
@ -16,4 +16,4 @@
|
||||||
|
|
||||||
allAttrs = systemAttrs // nonSystemAttrs;
|
allAttrs = systemAttrs // nonSystemAttrs;
|
||||||
in
|
in
|
||||||
allAttrs
|
allAttrs
|
||||||
|
|
1613
utils/net.nix
1613
utils/net.nix
File diff suppressed because it is too large
Load diff
Reference in a new issue