summaryrefslogtreecommitdiff
path: root/machines
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2024-12-10 13:24:51 -0500
committerKleidi Bujari <mail@4kb.net>2024-12-10 13:24:51 -0500
commitf5ed731abbc38d765333b005b9815a5f6d3e59c2 (patch)
treeff4b4f0c4aa1a51742fcefac3f40e05cddceb60e /machines
parentf08f3812f40322b6098d75573413ed83f358871f (diff)
downloaddepot-f5ed731abbc38d765333b005b9815a5f6d3e59c2.tar.gz
depot-f5ed731abbc38d765333b005b9815a5f6d3e59c2.tar.bz2
depot-f5ed731abbc38d765333b005b9815a5f6d3e59c2.zip
Finalize working configs and prior to adding secrets
System configurations in a known good state. Secrets still have to be integrated, at this point the nixos-anywhere project will likely handle this to keep the bootstrap completely automatic since it can copy ssh host keys to the host prior to install/activation. This would work nicely with the sops secret module, but a good way to manage host keys for each machine still has to be decided.
Diffstat (limited to 'machines')
-rw-r--r--machines/flake-module.nix39
-rw-r--r--machines/iridium/default.nix28
-rw-r--r--machines/iso/default.nix2
-rw-r--r--machines/t1/default.nix20
-rw-r--r--machines/t480/default.nix10
5 files changed, 79 insertions, 20 deletions
diff --git a/machines/flake-module.nix b/machines/flake-module.nix
index d06bfc2..8d9dd2c 100644
--- a/machines/flake-module.nix
+++ b/machines/flake-module.nix
@@ -2,6 +2,7 @@
let
inherit (lib) nixosSystem;
inherit (self.nixosModules) xnet xlib;
+ inherit (self) inputs;
in
{
flake.nixosConfigurations = {
@@ -16,14 +17,34 @@ in
modules = [ ./iso ];
};
- # t1 = nixosSystem {
- # system = "x86_64-linux";
- # modules = [ ./t1 ];
- # };
- #
- # iridium = nixosSystem {
- # system = "x86_64-linux";
- # modules = [ ./iridium ];
- # };
+ t1 = nixosSystem {
+ system = "x86_64-linux";
+ modules = [ ./t1 xnet ];
+ };
+
+ iridium = nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = { inherit inputs; };
+ modules = [ ./iridium xnet ];
+ };
+ };
+
+ perSystem = { pkgs, inputs', ... }: {
+ packages.xinstall =
+ let
+ disko = inputs'.disko.packages.disko-install;
+
+ configs = builtins.concatStringsSep " "
+ (builtins.filter (x: x != "iso")
+ (builtins.attrNames self.nixosConfigurations));
+ in
+ pkgs.writeShellScriptBin "xinstall" ''
+ set -euo pipefail
+
+ FLAKE="github:kbujari/depot"
+ TARGET=$(${pkgs.gum}/bin/gum choose ${configs})
+
+ # ${disko}/bin/disko-install --help
+ '';
};
}
diff --git a/machines/iridium/default.nix b/machines/iridium/default.nix
index c915eb0..8a3edd0 100644
--- a/machines/iridium/default.nix
+++ b/machines/iridium/default.nix
@@ -1 +1,27 @@
-{ ... }: { }
+{ inputs, lib, ... }: {
+ system.stateVersion = "24.11";
+
+ users.mutableUsers = false;
+ users.users.root = {
+ initialPassword = "test";
+ };
+
+ xnet = {
+ disk = {
+ enable = true;
+ device = "/dev/nvme0n1";
+ };
+ net = {
+ sshd.enable = true;
+ };
+ users.enable = [ "kle" ];
+ gitServer = {
+ enable = true;
+ gitweb.enable = true;
+ keys = builtins.filter (x: x != "")
+ (lib.strings.splitString "\n" (builtins.readFile inputs.sshKeys));
+ };
+ };
+
+ nix.registry.nixpkgs.flake = inputs.nixpkgs;
+}
diff --git a/machines/iso/default.nix b/machines/iso/default.nix
index d7d5861..d27b26e 100644
--- a/machines/iso/default.nix
+++ b/machines/iso/default.nix
@@ -16,7 +16,7 @@
(writeShellScriptBin "xinstall" ''
set -euo pipefail
- FLAKE="github:kbujari/depot/scaffolding"
+ FLAKE="github:kbujari/depot/xnet"
TARGET=$(
nix flake show "$FLAKE" --json 2>/dev/null \
diff --git a/machines/t1/default.nix b/machines/t1/default.nix
index c915eb0..31a652e 100644
--- a/machines/t1/default.nix
+++ b/machines/t1/default.nix
@@ -1 +1,19 @@
-{ ... }: { }
+{ ... }: {
+ system.stateVersion = "24.11";
+
+ xnet = {
+ desktop.enable = true;
+ users.enable = [ "kle" ];
+ disk = {
+ enable = true;
+ device = "/dev/nvme0n1";
+ };
+ };
+
+ networking = {
+ hostName = "t1";
+ };
+
+ # override default from xnet
+ programs.light.enable = false;
+}
diff --git a/machines/t480/default.nix b/machines/t480/default.nix
index d17899e..cdc0756 100644
--- a/machines/t480/default.nix
+++ b/machines/t480/default.nix
@@ -3,16 +3,10 @@
xnet = {
desktop.enable = true;
+ users.enable = [ "kle" ];
disk = {
enable = true;
- device = "nvme0n1";
- extraDatasets = {
- "persist/usr" = {
- type = "zfs_fs";
- mountpoint = "/home/k6";
- options.mountpoint = "legacy";
- };
- };
+ device = "/dev/nvme0n1";
};
};