From 53271d1d4cca7fe310fd6364f60327e8cf8a0b5c Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Mon, 18 Aug 2025 21:56:14 +0200 Subject: [PATCH] feat: add host PABU --- flake.nix | 1 + hosts/PABU/default.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 hosts/PABU/default.nix diff --git a/flake.nix b/flake.nix index af46636..79aa79d 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,7 @@ "APPA" "IROH" "MOMO" + "PABU" "T430" ] mkSystem ); diff --git a/hosts/PABU/default.nix b/hosts/PABU/default.nix new file mode 100644 index 0000000..2de692b --- /dev/null +++ b/hosts/PABU/default.nix @@ -0,0 +1,42 @@ +{ lib, pkgs, modulesPath, ... }: { + imports = [ (modulesPath + "/profiles/minimal.nix") ]; + + # Installing a new system within the nspawn means that the /sbin/init script + # just needs to be updated, as there is no bootloader. + system.build.installBootLoader = pkgs.writeScript "install-sbin-init.sh" '' + #!${pkgs.runtimeShell} + ${pkgs.coreutils}/bin/ln -fs "$1/init" /sbin/init + ''; + + system.activationScripts.installInitScript = lib.mkForce '' + ${pkgs.coreutils}/bin/ln -fs $systemConfig/init /sbin/init + ''; + + boot.isContainer = true; + networking.hostName = "PABU"; + + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + }; + + users.groups.gandalf = { + gid = 1000; + }; + + users.users.gandalf = { + isNormalUser = true; + home = "/home/gandalf"; + createHome = true; + group = "gandalf"; + extraGroups = [ "wheel" ]; + }; + + security.sudo.wheelNeedsPassword = false; + + environment.systemPackages = with pkgs; [ git neovim ]; + + system.stateVersion = "24.05"; +}