From 4c07edf6dede6ab739f00468d533eca901305dc3 Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Wed, 13 Nov 2024 00:47:45 +0100 Subject: [PATCH] Init --- .gitignore | 9 + TODO.md | 12 + client/default.nix | 35 ++ client/desktop.nix | 37 ++ client/gpu.nix | 11 + client/hardware.nix | 91 +++++ client/home.nix | 21 + client/programs.nix | 28 ++ client/sound.nix | 11 + client/users.nix | 91 +++++ flake.lock | 494 +++++++++++++++++++++++ flake.nix | 153 +++++++ machines/installer/default.nix | 28 ++ machines/installer/hardware.nix | 65 +++ machines/installer/installer/default.nix | 59 +++ machines/installer/netinstall.nix | 38 ++ machines/installer/secrets/cache.crt | 1 + machines/installer/secrets/cache.key | 24 ++ machines/ldap/default.nix | 27 ++ machines/ldap/hardware.nix | 65 +++ machines/ldap/ldap.nix | 226 +++++++++++ machines/ldap/secrets/ldap.tls.crt | 24 ++ machines/ldap/secrets/ldap.tls.key | 24 ++ machines/ldap/secrets/ldap.yaml | 36 ++ machines/nfs/default.nix | 27 ++ machines/nfs/hardware.nix | 65 +++ machines/nfs/nfs.nix | 13 + shared/default.nix | 21 + shared/network.nix | 28 ++ shared/nix.nix | 69 ++++ shared/system.nix | 14 + shared/users.nix | 31 ++ sops-config.nix | 78 ++++ 33 files changed, 1956 insertions(+) create mode 100644 .gitignore create mode 100644 TODO.md create mode 100644 client/default.nix create mode 100644 client/desktop.nix create mode 100644 client/gpu.nix create mode 100644 client/hardware.nix create mode 100644 client/home.nix create mode 100644 client/programs.nix create mode 100644 client/sound.nix create mode 100644 client/users.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 machines/installer/default.nix create mode 100644 machines/installer/hardware.nix create mode 100644 machines/installer/installer/default.nix create mode 100644 machines/installer/netinstall.nix create mode 100644 machines/installer/secrets/cache.crt create mode 100644 machines/installer/secrets/cache.key create mode 100644 machines/ldap/default.nix create mode 100644 machines/ldap/hardware.nix create mode 100644 machines/ldap/ldap.nix create mode 100644 machines/ldap/secrets/ldap.tls.crt create mode 100644 machines/ldap/secrets/ldap.tls.key create mode 100644 machines/ldap/secrets/ldap.yaml create mode 100644 machines/nfs/default.nix create mode 100644 machines/nfs/hardware.nix create mode 100644 machines/nfs/nfs.nix create mode 100644 shared/default.nix create mode 100644 shared/network.nix create mode 100644 shared/nix.nix create mode 100644 shared/system.nix create mode 100644 shared/users.nix create mode 100644 sops-config.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f920593 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/result + +/.direnv +/.envrc + +/*-efi-vars.fd + +# nixago: ignore-linked-files +/.sops.yaml diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..4a09330 --- /dev/null +++ b/TODO.md @@ -0,0 +1,12 @@ +# Tasks +- Configure user env on client (using envfs?) +- A fancy background image? +- Make installer work +- Move ldap to subdomain +- Switch to HS nameservers +- Check external SSH access +- Remove x-tools like xterm + +# Issuse +- Cleartext password in sssd/ldap config + diff --git a/client/default.nix b/client/default.nix new file mode 100644 index 0000000..734acdd --- /dev/null +++ b/client/default.nix @@ -0,0 +1,35 @@ +{ lib, ... }: + +with lib; + +{ + imports = [ + ./hardware.nix + ./gpu.nix + ./home.nix + ./users.nix + ./desktop.nix + ./programs.nix + ]; + + deployment = { + targetHost = "10.32.45.150"; + }; + + networking = { + useDHCP = mkForce true; + }; + + services.hardware.bolt.enable = true; + + security.rtkit.enable = true; + + services.avahi = { + enable = true; + nssmdns4 = true; + nssmdns6 = true; + }; + + system.stateVersion = "24.05"; +} + diff --git a/client/desktop.nix b/client/desktop.nix new file mode 100644 index 0000000..424a2d3 --- /dev/null +++ b/client/desktop.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: + +{ + services.xserver = { + enable = true; + displayManager.gdm = { + enable = true; + wayland = true; + }; + desktopManager.gnome.enable = true; + xkb.layout = "de"; + }; + + environment.gnome.excludePackages = with pkgs; [ + epiphany + gnome-online-accounts-gtk + gnome-tour + gnome.geary + gnome.gnome-calendar + gnome.gnome-contacts + ]; + + programs.dconf = { + enable = true; + profiles.user.databases = [ + { + settings = { + # Set the color scheme to dark. + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + + "org/gnome/desktop/wm/keybindings".close = [ "q" ]; + }; + } + ]; + }; +} + diff --git a/client/gpu.nix b/client/gpu.nix new file mode 100644 index 0000000..a82ccf8 --- /dev/null +++ b/client/gpu.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + hardware.opengl = { + enable = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + ]; + }; +} + diff --git a/client/hardware.nix b/client/hardware.nix new file mode 100644 index 0000000..f6a6ed4 --- /dev/null +++ b/client/hardware.nix @@ -0,0 +1,91 @@ +{ modulesPath, ... }: + +{ + imports = [ + "${modulesPath}/installer/scan/not-detected.nix" + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + consoleLogLevel = 3; + + initrd = { + systemd.enable = true; + verbose = false; + availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ata_piix" + "mptsas" + "usb_storage" + "usbhid" + "sd_mod" + "sr_mod" + ]; + }; + + kernelParams = [ + "quiet" + "udev.log_level=3" + ]; + + plymouth = { + enable = true; + theme = "bgrt"; + }; + }; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + + disko.devices = { + disk = { + root = { + type = "disk"; + device = "/dev/sda"; + imageSize = "32G"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + end = "-8G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + swap = { + size = "100%"; + content = { + type = "swap"; + randomEncryption = true; + resumeDevice = false; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/client/home.nix b/client/home.nix new file mode 100644 index 0000000..68e2bd3 --- /dev/null +++ b/client/home.nix @@ -0,0 +1,21 @@ +{ config, ...}: + +{ + services.cachefilesd = { + enable = true; + }; + + fileSystems."home" = { + mountPoint = "/home"; + device = "nfs.${config.networking.domain}:/home"; + fsType = "nfs"; + options = [ + "nfsvers=4.2" + "noauto" + "fsc" + "x-systemd.automount" + ]; + }; + +} + diff --git a/client/programs.nix b/client/programs.nix new file mode 100644 index 0000000..9a935ec --- /dev/null +++ b/client/programs.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: + +{ + programs = { + vim.defaultEditor = true; +# zsh = { +# enable = true; +# autosuggestions.enable = true; +# syntaxHighlighting.enable = true; +# }; + chromium.enable = true; + firefox.enable = true; + fish.enable = true; + git.enable = true; + htop.enable = true; + mtr.enable = true; + }; + + environment.systemPackages = with pkgs; [ + bat + eza + nil + fd + ripgrep + vscode + ]; +} + diff --git a/client/sound.nix b/client/sound.nix new file mode 100644 index 0000000..cb089c0 --- /dev/null +++ b/client/sound.nix @@ -0,0 +1,11 @@ +{ + hardware.pulseaudio.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} + diff --git a/client/users.nix b/client/users.nix new file mode 100644 index 0000000..45aeaeb --- /dev/null +++ b/client/users.nix @@ -0,0 +1,91 @@ +{ pkgs, lib, config, ... }: + +with lib; + +let + baseDN = concatMapStringsSep "," + (part: "dc=${part}") + (splitString "." "informatik.hs-fulda.de"); + +in +{ + security.pam.services = { + sshd = { + makeHomeDir = true; + sssdStrictAccess = true; + unixAuth = lib.mkForce true; + }; + login = { + makeHomeDir = true; + sssdStrictAccess = true; + unixAuth = lib.mkForce true; + }; + systemd-user = { + makeHomeDir = true; + sssdStrictAccess = true; + unixAuth = lib.mkForce true; + }; + }; + + services.sssd = { + enable = true; + config = '' + [sssd] + config_file_version = 2 + services = nss, pam, ssh, ifp + domains = hsfd + + debug_level = 8 + + [nss] + override_homedir = /home/%u + override_shell = /run/current-system/sw/bin/bash + + filter_users = root + filter_groups = root + + reconnection_retries = 3 + + [pam] + + [domain/hsfd] + id_provider = ldap + access_provider = ldap + auth_provider = ldap + + # TODO: ldap_uri = ldaps://ldap${config.networking.domain}/ + ldap_uri = ldaps://ldap-linuxlab.informatik.hs-fulda.de/ + ldap_search_base = ou=users,${baseDN} + + ldap_tls_reqcert = demand + ldap_id_use_start_tls = true + + ldap_default_bind_dn = cn=login,dc=informatik,dc=hs-fulda,dc=de + ldap_default_authtok_type = password + ldap_default_authtok = TXyk&6G?Ta/B[DZ2^g'KmpUw + + ldap_access_order = filter + ldap_access_filter = (objectClass=*) + + ldap_user_object_class = posixAccount + ldap_user_name = cn + + override_gid = ${toString config.users.groups."users".gid} + + cache_credentials = true + + min_id = 1000 + enumerate = false + ''; + }; + + users.users."root".packages = with pkgs; [ + sss-cli + ]; + + #sops.secrets."ldap/login/password" = { + # owner = "nslcd"; + # sopsFile = ./secrets.yaml; + #}; +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3df5e3a --- /dev/null +++ b/flake.lock @@ -0,0 +1,494 @@ +{ + "nodes": { + "colmena": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": [ + "flake-utils" + ], + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nixpkgs" + ], + "stable": "stable" + }, + "locked": { + "lastModified": 1731249827, + "narHash": "sha256-04iOZoJ0D+y3xhZtaCgSBOz8T4hED7oMVkuAOzXT8vU=", + "owner": "zhaofengli", + "repo": "colmena", + "rev": "a2193487bcf70bbb998ad1a25a4ff02b8d55db7a", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "colmena", + "type": "github" + } + }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731274291, + "narHash": "sha256-cZ0QMpv5p2a6WEE+o9uu0a4ma6RzQDOQTbm7PbixWz8=", + "owner": "nix-community", + "repo": "disko", + "rev": "486250f404f4a4f4f33f8f669d83ca5f6e6b7dfc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "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-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-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" + } + }, + "ldap-sync": { + "flake": false, + "locked": { + "lastModified": 1705328305, + "narHash": "sha256-PPc16Obzg53YVLSMP2pCOXBF6+q7/BIG6FF7EiI0st8=", + "ref": "refs/heads/main", + "rev": "49edeafeaf7fbadbfe59e4763223593cab989317", + "revCount": 14, + "type": "git", + "url": "https://gogs.informatik.hs-fulda.de/fooker/ldap-sync.git" + }, + "original": { + "type": "git", + "url": "https://gogs.informatik.hs-fulda.de/fooker/ldap-sync.git" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "colmena", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixago": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixago-exts": "nixago-exts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714086354, + "narHash": "sha256-yKVQMxL9p7zCWUhnGhDzRVT8sDgHoI3V595lBK0C2YA=", + "owner": "jmgilman", + "repo": "nixago", + "rev": "5133633e9fe6b144c8e00e3b212cdbd5a173b63d", + "type": "github" + }, + "original": { + "owner": "jmgilman", + "repo": "nixago", + "type": "github" + } + }, + "nixago-exts": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixago": "nixago_2", + "nixpkgs": [ + "nixago", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1676070308, + "narHash": "sha256-QaJ65oc2l8iwQIGWUJ0EKjCeSuuCM/LqR8RauxZUUkc=", + "owner": "nix-community", + "repo": "nixago-extensions", + "rev": "e5380cb0456f4ea3c86cf94e3039eb856bf07d0b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixago-extensions", + "type": "github" + } + }, + "nixago-exts_2": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixago": "nixago_3", + "nixpkgs": [ + "nixago", + "nixago-exts", + "nixago", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1655508669, + "narHash": "sha256-BDDdo5dZQMmwNH/GNacy33nPBnCpSIydWFPZs0kkj/g=", + "owner": "nix-community", + "repo": "nixago-extensions", + "rev": "3022a932ce109258482ecc6568c163e8d0b426aa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixago-extensions", + "type": "github" + } + }, + "nixago_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixago-exts": "nixago-exts_2", + "nixpkgs": [ + "nixago", + "nixago-exts", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1676070010, + "narHash": "sha256-iYzJIWptE1EUD8VINAg66AAMUajizg8JUYN3oBmb8no=", + "owner": "nix-community", + "repo": "nixago", + "rev": "d480ba6c0c16e2c5c0bd2122852d6a0c9ad1ed0e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "rename-config-data", + "repo": "nixago", + "type": "github" + } + }, + "nixago_3": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": [ + "nixago", + "nixago-exts", + "nixago", + "nixago-exts", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1655405483, + "narHash": "sha256-Crd49aZWNrpczlRTOwWGfwBMsTUoG9vlHDKQC7cx264=", + "owner": "nix-community", + "repo": "nixago", + "rev": "e6a9566c18063db5b120e69e048d3627414e327d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixago", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730963269, + "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1730602179, + "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "colmena": "colmena", + "disko": "disko", + "flake-utils": "flake-utils", + "git-hooks": "git-hooks", + "ldap-sync": "ldap-sync", + "nixago": "nixago", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", + "sops": "sops" + } + }, + "sops": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1731213149, + "narHash": "sha256-jR8i6nFLmSmm0cIoeRQ8Q4EBARa3oGaAtEER/OMMxus=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "f1675e3b0e1e663a4af49be67ecbc9e749f85eb7", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stable": { + "locked": { + "lastModified": 1730883749, + "narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..57ffeae --- /dev/null +++ b/flake.nix @@ -0,0 +1,153 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + + flake-utils.url = "github:numtide/flake-utils"; + + git-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + colmena = { + url = "github:zhaofengli/colmena"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixago = { + url = "github:jmgilman/nixago"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + + sops = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + ldap-sync = { + type = "git"; + url = "https://gogs.informatik.hs-fulda.de/fooker/ldap-sync.git"; + flake = false; + }; + }; + + outputs = + { self + , nixpkgs + , flake-utils + , colmena + , git-hooks + , nixago + , ... + }@inputs: + let + + # List of all machine names as defined in the machines directory + machines = builtins.attrNames (builtins.readDir ./machines); + + in + { + colmena = { + meta = { + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + }; + + specialArgs = { + inherit inputs; + }; + }; + + defaults = { + imports = [ + inputs.disko.nixosModules.disko + inputs.sops.nixosModules.sops + + ./shared + ]; + + deployment.replaceUnknownProfiles = false; + }; + + "client" = ./client; + + } // (builtins.listToAttrs (builtins.map + (name: { + inherit name; + value = ./machines/${name}; + }) + machines)); + + } // flake-utils.lib.eachDefaultSystem (system: { + checks = { + pre-commit = git-hooks.lib.${system}.run { + src = ./.; + hooks = { + nixpkgs-fmt.enable = true; + statix.enable = true; + shellcheck.enable = true; + }; + }; + }; + + devShells.default = + let + pkgs = nixpkgs.legacyPackages.${system}; + + sops-config = nixago.lib.${system}.make { + data = (pkgs.callPackage ./sops-config.nix { + inherit machines; + }).config; + output = ".sops.yaml"; + format = "yaml"; + }; + + in + pkgs.mkShell { + buildInputs = + self.checks.${system}.pre-commit.enabledPackages ++ + [ colmena.packages.${system}.colmena ] ++ + (with pkgs; [ + bash + gitAndTools.git + sops + age + openssh + ssh-to-age + ]); + + shellHook = '' + ${self.checks.${system}.pre-commit.shellHook} + ${sops-config.shellHook} + ''; + }; + + packages.disks = + let + pkgs = nixpkgs.legacyPackages.${system}; + hive = colmena.lib.makeHive self.outputs.colmena; + + in pkgs.linkFarm "linuxlab-testing" (builtins.mapAttrs + (_: node: node.config.system.build.diskoImages) + hive.nodes); + }); + + nixConfig = { + extra-substituters = [ + "https://colmena.cachix.org" + ]; + + extra-trusted-public-keys = [ + "colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg=" + ]; + }; +} + diff --git a/machines/installer/default.nix b/machines/installer/default.nix new file mode 100644 index 0000000..1e1e17e --- /dev/null +++ b/machines/installer/default.nix @@ -0,0 +1,28 @@ +{ + imports = [ + ./hardware.nix +# TODO: ./cache.nix + ./netinstall.nix + ]; + + deployment = { + targetHost = "10.32.45.12"; + }; + + networking = { + interfaces."eth0" = { + ipv4.addresses = [{ + address = "10.32.45.12"; + prefixLength = 24; + }]; + }; + + defaultGateway = { + interface = "eth0"; + address = "10.32.45.1"; + }; + }; + + system.stateVersion = "24.05"; +} + diff --git a/machines/installer/hardware.nix b/machines/installer/hardware.nix new file mode 100644 index 0000000..b35c6e1 --- /dev/null +++ b/machines/installer/hardware.nix @@ -0,0 +1,65 @@ +{ modulesPath, ... }: + +{ + imports = [ + "${modulesPath}/installer/scan/not-detected.nix" + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ata_piix" + "mptsas" + "usb_storage" + "usbhid" + "sd_mod" + "sr_mod" + ]; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + + disko.devices = { + disk = { + root = { + type = "disk"; + device = "/dev/sda"; + imageSize = "64G"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/machines/installer/installer/default.nix b/machines/installer/installer/default.nix new file mode 100644 index 0000000..fc0c1f6 --- /dev/null +++ b/machines/installer/installer/default.nix @@ -0,0 +1,59 @@ +{ pkgs, lib, modulesPath, config, target, ... }: + +with lib; + +let + installer = pkgs.writers.writeBash "installer" '' + set -euo pipefail + + "${target.config.system.build.diskoScript}" + + "${target.config.system.build.nixos-install}" \ + --root /mnt \ + --system "${target.config.system.build.toplevel}" \ + --no-channel-copy \ + --no-root-password \ + --verbose + + reboot + ''; + +in { + imports = [ + "${modulesPath}/installer/netboot/netboot-minimal.nix" + ]; + + networking.hostName = "installer"; + + services.getty.autologinUser = lib.mkForce "root"; + + systemd.services."auto-install" = { + description = "Automated NixOS installer"; + + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + + conflicts = [ "getty@tty1.service" ]; + + wantedBy = [ "multi-user.target" ]; + + path = with pkgs; [ bash nix ]; + + unitConfig = { + FailureAction = "force-reboot"; + }; + + serviceConfig = { + Type = "oneshot"; + + ExecStart = installer; + + StandardInput = "none"; + StandardOutput = "journal+console"; + StandardError = "journal+console"; + }; + }; + + system.stateVersion = config.system.nixos.release; +} + diff --git a/machines/installer/netinstall.nix b/machines/installer/netinstall.nix new file mode 100644 index 0000000..bc3e890 --- /dev/null +++ b/machines/installer/netinstall.nix @@ -0,0 +1,38 @@ +{ pkgs, lib, nodes, ... }: + +with lib; + +let + installer = pkgs.nixos [ + ./installer + + { + _module.args = { + target = nodes."client"; + }; + } + ]; + +in +{ + services.pixiecore = { + enable = true; + + dhcpNoBind = true; + + port = 5080; + + mode = "boot"; + kernel = "file://${installer.config.system.build.kernel}/bzImage"; + initrd = "file://${installer.config.system.build.netbootRamdisk}/initrd"; + cmdLine = concatStringsSep " " [ + "init=${installer.config.system.build.toplevel}/init" + "loglevel=4" + "console=tty0" + "console=ttyS1,57600n8" + ]; + + openFirewall = true; + }; +} + diff --git a/machines/installer/secrets/cache.crt b/machines/installer/secrets/cache.crt new file mode 100644 index 0000000..ef137af --- /dev/null +++ b/machines/installer/secrets/cache.crt @@ -0,0 +1 @@ +cache.linuxlab.informatik.hs-fulda.de:jrTFzlS3uRzOOteHmynLmSIvFMWgb4+YH+ShcrczdEY= \ No newline at end of file diff --git a/machines/installer/secrets/cache.key b/machines/installer/secrets/cache.key new file mode 100644 index 0000000..e4a0235 --- /dev/null +++ b/machines/installer/secrets/cache.key @@ -0,0 +1,24 @@ +{ + "data": "ENC[AES256_GCM,data:u2f84L2XIPqNBPKtkAU7LAwUj0wwxemsOuUB/qk/SSjutA8RLi5TmBQHnnBY/5l3u154JN9RzHsHQyMp7NHiT1gsmvrmNhdWRzLTxG7MfIJW0SVpjD7X6GLmH5vnVSLJZScRfHgdRcYl9sFO7HlT/vRAtb57ZYM+QZS5b1ZB,iv:yzwOKZA5iwrn/CkhtwF7tUytsy0lseJcBqm4UqVAsqA=,tag:WhxIH/K314fvOm81lfK6EQ==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": [ + { + "recipient": "age1gsv9h0faztlavyw8ydl3t8p39u737jj48qvg8lrnsdkamthqaepsqegr08", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBLVDhNSjF0amNnSWJ2ZEhq\ndnRoOXZpYk5oN09abFozK1Y0WVhDSVJ2U0RzCkw0OXhScjQwRGlDcDdnUHh2cDd3\nclBDd2RwQzRIMy9CVjZXbGFNSUdjU2cKLS0tIHBzSXdCMElkclJMU2I0WWtHbTJP\nWW5TQ2syRk9Obm5qYUtZVGZYbmtzTkEKkMiRInW2OuY6FhXTfueqokehWNxwO905\ntk5jVzyS0kVDt2Mi29Ny+HUhTpLWn2mJii8HMz698ElAxvXrHBZurQ==\n-----END AGE ENCRYPTED FILE-----\n" + }, + { + "recipient": "age14lgxmyw860py9yyjz3cxkr6u0x30qra2e27c9my0sycqyfankf2sjrsse6", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvSHBOUUhqcHlPeTNXOE8z\nWDlNZkhSbnY5SEV5MFplWmhNVXpTaXlycHd3Ck9hY1F6LzNpWjhFdWN0SnpaT0M0\nR2R5TmRNek0wYTJUREp4YklTaVJzdXMKLS0tIDdOTWN6b2kwR1R3bzNTT2s1UFMr\nUm0yWHNkSXg5ZFR1dWhUdHRmSm13eG8Kcprh4nvmUDgI6/nntD+FTY4SsqpEAs3U\n44tvzXSNjEMp9dHIkVu45+NyKOGjZoNUAA7dEvFYAAgZqHPbLMJ0aw==\n-----END AGE ENCRYPTED FILE-----\n" + } + ], + "lastmodified": "2024-11-11T21:50:59Z", + "mac": "ENC[AES256_GCM,data:n6TfbZmYcV2ER7n4fXanVJ9ekbytU07NdHVDO/VoTkERvstb1NuTeo7LjA+KVVKxM3ZUvAtMfjpAXvgP1exL4WkOzQHk5RV3odfZhGsvMOUaHp7cfww6/JrO8I+EzJWhDh2tO+xFpuD2sprvNiWT60PFG6kDQKn7XYy63+ECCyo=,iv:7ytrvXtk3Mz3ioeuv0hc80y2FLSyUWdtFyVEhidUeAI=,tag:BS8am9kxloRP+AbavEmfPA==,type:str]", + "pgp": null, + "unencrypted_suffix": "_unencrypted", + "version": "3.8.1" + } +} \ No newline at end of file diff --git a/machines/ldap/default.nix b/machines/ldap/default.nix new file mode 100644 index 0000000..1e5c955 --- /dev/null +++ b/machines/ldap/default.nix @@ -0,0 +1,27 @@ +{ + imports = [ + ./hardware.nix + ./ldap.nix + ]; + + deployment = { + targetHost = "10.32.45.11"; + }; + + networking = { + interfaces."eth0" = { + ipv4.addresses = [{ + address = "10.32.45.11"; + prefixLength = 24; + }]; + }; + + defaultGateway = { + interface = "eth0"; + address = "10.32.45.1"; + }; + }; + + system.stateVersion = "24.05"; +} + diff --git a/machines/ldap/hardware.nix b/machines/ldap/hardware.nix new file mode 100644 index 0000000..cb0a876 --- /dev/null +++ b/machines/ldap/hardware.nix @@ -0,0 +1,65 @@ +{ modulesPath, ... }: + +{ + imports = [ + "${modulesPath}/installer/scan/not-detected.nix" + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ata_piix" + "mptsas" + "usb_storage" + "usbhid" + "sd_mod" + "sr_mod" + ]; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + + disko.devices = { + disk = { + root = { + type = "disk"; + device = "/dev/sda"; + imageSize = "32G"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/machines/ldap/ldap.nix b/machines/ldap/ldap.nix new file mode 100644 index 0000000..75d25e8 --- /dev/null +++ b/machines/ldap/ldap.nix @@ -0,0 +1,226 @@ +{ pkgs, lib, config, inputs, ... }: + +with lib; + +let + baseDN = concatMapStringsSep "," + (part: "dc=${part}") + (splitString "." "informatik.hs-fulda.de"); + + ldap-sync = + let + wrapped = pkgs.callPackage inputs.ldap-sync { }; + env = pkgs.runCommand "ldap-sync-env" { } '' + mkdir -p $out + ln -s ${config.sops.secrets."ldap/sync/config".path} $out/ldap-sync.properties + ''; + in + pkgs.runCommand "ldap-sync-wrapper" + { + nativeBuildInputs = [ pkgs.makeWrapper ]; + } '' + mkdir -p $out/bin + makeWrapper "${wrapped}/bin/ldap-sync" $out/bin/ldap-sync \ + --chdir "${env}" + ''; + +in +{ + services.openldap = { + enable = true; + + package = (pkgs.openldap.overrideAttrs (final: prev: { + configureFlags = prev.configureFlags ++ [ + "--enable-overlays" + "--enable-remoteauth" + "--enable-spasswd" + "--with-cyrus-sasl" + ]; + + doCheck = false; + + })).override { + cyrus_sasl = pkgs.cyrus_sasl.override { + enableLdap = true; + }; + }; + + urlList = [ "ldap:///" "ldaps:///" ]; + + settings = { + attrs = { + olcLogLevel = "config ACL stats stats2 trace"; + + olcTLSCertificateFile = config.sops.secrets."ldap/tls/crt".path; + olcTLSCertificateKeyFile = config.sops.secrets."ldap/tls/key".path; + olcTLSCRLCheck = "none"; + olcTLSVerifyClient = "never"; + olcTLSProtocolMin = "3.1"; + + olcSaslHost = "localhost"; + olcSaslSecProps = "none"; + + olcSizeLimit = "unlimited"; + }; + + children = { + "cn=schema".includes = [ + "${config.services.openldap.package}/etc/schema/core.ldif" + "${config.services.openldap.package}/etc/schema/cosine.ldif" + "${config.services.openldap.package}/etc/schema/inetorgperson.ldif" + "${config.services.openldap.package}/etc/schema/nis.ldif" + ]; + "olcDatabase={1}mdb" = { + attrs = { + objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ]; + + olcDatabase = "{1}mdb"; + olcDbDirectory = "/var/lib/openldap/db"; + + olcSuffix = baseDN; + + olcRootDN = "cn=root,${baseDN}"; + olcRootPW.path = config.sops.secrets."ldap/root/password".path; + + olcAccess = [ + # Custom access rules for userPassword attributes + ''{0}to attrs=userPassword + by self read + by anonymous auth + by * none + '' + + # Synced is managed by sync + ''{1}to dn.subtree="ou=synced,ou=users,dc=informatik,dc=hs-fulda,dc=de" + by dn.base="cn=sync,dc=informatik,dc=hs-fulda,dc=de" manage + by * break + '' + + # Allow login to read users + ''{2}to dn.subtree="ou=users,dc=informatik,dc=hs-fulda,dc=de" + by dn.base="cn=login,dc=informatik,dc=hs-fulda,dc=de" read + by self read + by * break + '' + + # Prevent access + ''{3}to * + by * none + '' + ]; + }; + + children = { + "olcOverlay={0}remoteauth" = { + attrs = { + objectClass = [ "olcOverlayConfig" "olcRemoteAuthCfg" ]; + + olcOverlay = "{0}remoteauth"; + + olcRemoteAuthTLS = "starttls=yes tls_cacert=\"/etc/ssl/certs/ca-certificates.crt\""; + olcRemoteAuthDNAttribute = "seeAlso"; + olcRemoteAuthDomainAttribute = "associatedDomain"; + olcRemoteAuthDefaultDomain = "upstream"; + olcRemoteAuthDefaultRealm = "file://${config.sops.secrets."ldap/upstream".path}"; + olcRemoteAuthRetryCount = "3"; + olcRemoteAuthStore = "false"; + }; + }; + }; + }; + }; + }; + + declarativeContents = { + "dc=informatik,dc=hs-fulda,dc=de" = '' + dn: dc=informatik,dc=hs-fulda,dc=de + objectClass: domain + dc: informatik + + dn: ou=users,dc=informatik,dc=hs-fulda,dc=de + objectClass: organizationalUnit + ou: users + + dn: ou=synced,ou=users,dc=informatik,dc=hs-fulda,dc=de + objectClass: organizationalUnit + ou: users + + dn: cn=sync,dc=informatik,dc=hs-fulda,dc=de + objectClass: applicationProcess + objectClass: simpleSecurityObject + objectClass: top + cn: sync + userPassword: {SSHA}Kf5ViggnBdUAPJ3/X5F80Qf/tXOzGI9G + + dn: cn=login,dc=informatik,dc=hs-fulda,dc=de + objectClass: applicationProcess + objectClass: simpleSecurityObject + objectClass: top + cn: login + userPassword: {SSHA}esWkdMFThbFD0gSE5tC+jJ1rjwfUuI0p + ''; + }; + }; + + systemd.services."openldap" = { + environment = { + SASL_PATH = pkgs.writeTextFile { + name = "openldap-sasl-path"; + destination = "/slapd.conf"; + text = '' + pwcheck_method: saslauthd + saslauthd_path: /var/run/saslauthd/mux + mech_list: GSSAPI EXTERNAL PLAIN NTLM + ''; + }; + }; + + onSuccess = [ "ldap-sync.service" ]; + }; + + systemd.services."ldap-sync" = { + script = "${ldap-sync}/bin/ldap-sync"; + startAt = "hourly"; + + requisite = [ "openldap.service" ]; + + # Flush caches + postStop = '' + ${config.services.nscd.package}/bin/nscd --invalidate=group + ${config.services.nscd.package}/bin/nscd --invalidate=passwd + ''; + }; + + sops.secrets."ldap/root/password" = { + sopsFile = ./secrets/ldap.yaml; + owner = "openldap"; + }; + + sops.secrets."ldap/upstream" = { + sopsFile = ./secrets/ldap.yaml; + owner = "openldap"; + }; + + sops.secrets."ldap/tls/key" = { + sopsFile = ./secrets/ldap.tls.key; + format = "binary"; + owner = "openldap"; + }; + + sops.secrets."ldap/tls/crt" = { + sopsFile = ./secrets/ldap.tls.crt; + format = "binary"; + owner = "openldap"; + }; + + sops.secrets."ldap/sync/config" = { + sopsFile = ./secrets/ldap.yaml; + }; + + networking.firewall.allowedTCPPorts = [ + 22 + 389 + 636 + ]; +} + diff --git a/machines/ldap/secrets/ldap.tls.crt b/machines/ldap/secrets/ldap.tls.crt new file mode 100644 index 0000000..1f01098 --- /dev/null +++ b/machines/ldap/secrets/ldap.tls.crt @@ -0,0 +1,24 @@ +{ + "data": "ENC[AES256_GCM,data:qAAyvNe+HobjwIVWc05sHJSk6qkSM8ZAPhYsQp8Z4qQGw0BpoZyNJAuyws40QIUmMtOWVDGn0jxZzMAaV+q5kot4ZESVtzWBB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1+NIVXUMthDVUtxOowx9qAk/b1bvgLcjy5wOPW89hxc7IVkdwGvk3WAkPSkQV87/ho9m6MX4Mhsr7oRWMfl+MGqnCVOV5XkeGdfYY2TY2Fmot,iv:k7tjyQc7k+pkK/xzN0+xhN7OMxbD499+iFq5cOO1P/s=,tag:8FIHjVq1jKYjRa+QUQvoag==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": [ + { + "recipient": "age1gsv9h0faztlavyw8ydl3t8p39u737jj48qvg8lrnsdkamthqaepsqegr08", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoTkxXVEZMMm04bFVVbTNV\ndTluWmdNdU1sMVZqNHVUckZ0Rzh5WUM1cGxvCmIxb2Rld0NWek9xQVh5dlo0VGZL\ncXpYeXdUK1dVNVc3SitSeUpnVjVqMlEKLS0tIDd0Si8rbFd6YkFsMWZEMFdIQmd4\nVGNzR3BiaVdaODRtRmI1UW5kbm5sQWsKOYN2GuBROfSVmbPK3gvJhqLfXEgbh/NF\nOYNbi+i0cL41gAQjgqVcAJmzJSyp/wecfge2J8EQnbegFeUGfmrljw==\n-----END AGE ENCRYPTED FILE-----\n" + }, + { + "recipient": "age1wzany9cugzdzgj9zv7cc9w9ctnuu00vl6vm34cgjlyudegfqcptqgd9ut6", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1QUZtMHpScDFxbXp2cnpW\nSE00Q2JDV2Z0RUtBdGJidlVYSjFkV0RicVNFCi9ZUW12T1ZJUGdWWlJONkNCZFJR\nMEt5dGVvVDlCQWttczNCMGJkSEZ0OEUKLS0tIG9qWVA3dG5KNUY5R1BZRkZBRDNU\nejZLbUpXUXNZL0JYdk4xbXhUZlZHczAKcduhbeOO9wEZo5FOzOae4tl1OMddBgAw\n1JjHE8JzY3yud6C6UNoghwhAG+B1kTa1KlcsUezVxT55rTGQk+Ghog==\n-----END AGE ENCRYPTED FILE-----\n" + } + ], + "lastmodified": "2024-10-23T13:43:39Z", + "mac": "ENC[AES256_GCM,data:+EuHBBTU4BQSskZahMNKWly/OOYdNpyMi3FsYoP4aty1MdFtcnoNeC3VtZPQrouxA3Ljeml83i6OEPI/J9S9BlQH7fKK5ihWtcYlsX0q9jMNs+aYaWAu143GUkdSIhTmxceT4tYaQucdvsnOyopW+px8JJ7TOfoajGbmbOpxFsI=,iv:xav2lFC9MIuh3Px7BzZUAd0Gcc16rqD+tXIDfFAUj6w=,tag:UtCNgGIcGI3zcIXfTtdk5Q==,type:str]", + "pgp": null, + "unencrypted_suffix": "_unencrypted", + "version": "3.9.1" + } +} \ No newline at end of file diff --git a/machines/ldap/secrets/ldap.tls.key b/machines/ldap/secrets/ldap.tls.key new file mode 100644 index 0000000..591c06a --- /dev/null +++ b/machines/ldap/secrets/ldap.tls.key @@ -0,0 +1,24 @@ +{ + "data": "ENC[AES256_GCM,data:kX2fP6oI4d4ssW+XDv5lF1dn7zAOEH1Qg+tY1AlKkRiWnQmKt5ik2ot6/jcoq9w2hv3Rnrh4Zb6Ndy/OJi3JzPb8Je+lOKC8nTekYz7ZTqdO8CKfONmGaMJO9crR6bJrIXkw3GLd8m14wmFg2tYSYOz918t91BTNpujcDS0t4VpNdgRjX7TFq4+SOOO0oqQDyuXrnK830NvUranO4tNkFCRzIuW0nMeXqE8lehp9wPfJJ9vhNXk8nizgQaazvtjl2An34BQeZFHp7ff+C6XrLoFFX0CkewAkwZ9EUVFzJwShrKjRGgdTqd9u6CuuP02UQrxyfyj8MqRThnyTtZ3GPFGcO6bsPEfQav5PjdhAuoM3XTqLkYIsoyNK+XGNmYy7lEn+optXJxfpzEt1TT7uSftyCsJ13fQOG1JsXNaGrORagSp0ngDyOVMFMZTWDpavB+hweV1ITeMqN6pukWGtYCW/KRpBWDxUQUZGXTdLyt8SL+LZZgPzgLuKxWwmwsbjTZ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CLNtKLv+botrCvAq+daAE9dt/8GcZDkT9GBGidmyX12v03pkOpkOx8mLffE/Ccl9Mt6//sK5t019Q/myIt+i5YTrHGerAdWQTFdxQj3LG6xbWf9BRPU81Z9XqLO+KNnzdA18cGlxMAlR0Fodq8iVCtO9c7uS5XgkSFdNOWdhAw2we6qMmBp/pwDtZUxdeepj7TQfVynx//lT1tg7WOxd3nf0V9U94759Vvz7r7wvREwcjqa4AjJLoUQGfhddpmOd4ycqxreqx1MCKqY+E3kU36zedB7eO/P2hD6OkFDFacZUBXzIw+csTwT0ehSv6zHGSPvF1H0gXzjgoB6CgDznPfRLWnGBfBggK2O3CIjP9wjzs4hXlP14U+0KL9sycPfV32WDTLzLIzyhek4CpVT5nUMLz5uXgkCdiIW6yYs3e46+eZKkXC21bVh7O6PVvwsJci5gZAz3PGM7Bpgqz0WbSItVAJpkOqCNivdim88vD+CT/m9sIppz9USqCMOfx9/UplwXbVtfSUQXPlIRprDIV1vJWka3oY2uN0oz1VPDHgN5VJ4PSO1mnQPmFg4B/hPoNCo2HVu49DrQL86uuAw6xkfL0=,iv:dQC+JMRPyNFqbIYRSDMBXEmTVK5QmRbBpEYXG+06l+M=,tag:brQ2Fl9jtvmlT5N/gaN4jA==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": [ + { + "recipient": "age1gsv9h0faztlavyw8ydl3t8p39u737jj48qvg8lrnsdkamthqaepsqegr08", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBBeEpiRjhYU3ErSW56a3Z5\nbUN2TUxaSTlIT3dFK0p1dlV6WTd2bzJLbW4wCkJLd0hSZmRGUHg4Z2NpQ2VFa25T\na0dhUlpLSk1GSEl6eGY0NllMclY2bDgKLS0tIENGanhCK2dLcmFxclNDWUtuS0Vt\nejZncjdVUll1OG1aM1BFK0EwckNodGcKMBn25B8U9pR+NDm4xTK43DSPxSLmcDgz\ntm6EZy6ENOJYsFf1UCILrd9pkX5Vt/h3RE5U/IJEpIiYsaYSTRjG6w==\n-----END AGE ENCRYPTED FILE-----\n" + }, + { + "recipient": "age1wzany9cugzdzgj9zv7cc9w9ctnuu00vl6vm34cgjlyudegfqcptqgd9ut6", + "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXMHZqcEs3SjBHaDB3YUR6\nbldiNVVTcjd0dkU3aWVZUnNzSG1FakRLR21nCkthT25oMnlLaVloTE5ZdnA3SXAx\nYXZveWJRSWowcTZ6Y3QyaDVvaU4vZk0KLS0tIHZ0ZndoV2RINEVkTXpkT0gwV295\nZy9jMVVNaVF0MENhZ2FNZlhjVWhtYWMKDjw+F73tFDuXBODKE1ntB4XjKnualbRX\nHoK5ZWz2kQiD5j9Z3eiA3K4UkQs8+XLBzFHKWsUJm+DXFj6pRex2iw==\n-----END AGE ENCRYPTED FILE-----\n" + } + ], + "lastmodified": "2024-10-23T13:42:58Z", + "mac": "ENC[AES256_GCM,data:BUQmiBa481d2vggylNYkIKBuOg579REAnxMxX/je+IOvGwx/ODC7W0Zm+bzUYtNa/hmvW4fxwmA8VBHNUPgHrmI7zbNQlXdegg3QcXabr0jr3tqcFkLU7LeOt72tCRSGiZSZ3Pz0GXLzhZo9u+t1d/NVVO3p6ZFp/8Ta5fxq0ns=,iv:8PZROLEwl9wdVXsEMMBNKkbnlboeZQiVKDvjiyGJW38=,tag:d+y/GgHHgcSS8SGqIiPs8g==,type:str]", + "pgp": null, + "unencrypted_suffix": "_unencrypted", + "version": "3.9.1" + } +} \ No newline at end of file diff --git a/machines/ldap/secrets/ldap.yaml b/machines/ldap/secrets/ldap.yaml new file mode 100644 index 0000000..29aa573 --- /dev/null +++ b/machines/ldap/secrets/ldap.yaml @@ -0,0 +1,36 @@ +ldap: + root: + username: ENC[AES256_GCM,data:h6YGYg==,iv:QaCy9dRJNnI4UiQwgeboAxl8XZ+xGyYK8mLyybLNyF4=,tag:PQpKFwltnyRvmYJbPoGxvQ==,type:str] + password: ENC[AES256_GCM,data:3np5tR14nxbZe0hlX0Wd4/kDNRb3z3y3z13SyqTY3wE=,iv:yXz45Tsfof0U2JljSRxuUICRjNZ1U3YD4IlXsU4E0/o=,tag:XABl21e6uaj96ApLcRMSpA==,type:str] + upstream: ENC[AES256_GCM,data:KT6x/jm+p9+3e69yWE/hUMWlNrVuecUK3TcnRdqOJWA=,iv:n5P8NE7xUkOz68g/OcemnpZdEjT8aSEgzC4AS0kyStc=,tag:r+gEb4DIzdyBAsavBucvFQ==,type:str] + sync: + config: ENC[AES256_GCM,data:sgobPqiTsGDNfJKvIYiv+6E3s8Ipfog+2EVgz16ZPMwIU6u1id6cxPnE0nnCQcGVKc80owHmy/zYPzsPF7bHhSebGgZN8dN/xnP1xStIssqRP3XhSitNIMREImHs7iKT7f1/Km9CfZxm2WL2XPlaalK/oC/VJ9TiKcJjjnKuQvFbk1Ph2Pe2wPnd6/tZ8/EPGpRm1s+28YzaxWABFjLG/VEdrCJt45rOxpFXDXzQN/3iIRc7EM/CGQZEoJLky2QBd5597UuB9DBU7mkRUPv9JO7euMX9KH8CAYvHutOMpzEaD/LoRMmZxhpBhn3jQGj/uIyr13nJynQ39xkh58UYsENgyTMeAtr7MBzUDuAe1FC7f1NPbKpNuhaab25IqVwnGoOGOj5B8JcWZR1hDU5OTsp5xLTQn3K/SlWeii79EGwgS/pmtyCziQqtd+oS46dnWJupS5ESoU3gdXDvgzNnJsD3qCqrgY+pw3bcQY9D5HhhLdkYByiAbVgtTDVO9EZDxeyHG0APq1J3rkEZxTGunlx9M/wVWD2h/lVsY45KCD+0S9ukhxcEM89LTlI5jeiKbt689uPp6WjmfFo4sdFFm0XbpxTew1YXXORFC+nyM/nh9IhK3G9Jo2LvRDoX0XeZkH+Zmy8J5BZ7kwpdw6de8KEnpj+jyxFD15D5gQfGQC8vfiKA0yNoKdUNGPkkF4vRCFoJLIRnqJfmqWmXcW4E8BjiQId8nx6QGDty+i5HJnYktR7AvK61Q8VMjTYsT12Uwk9Buqn5AbC1Z7pwM7CgiRR7hpUIRYAlB6VBuqXK0xBqSqRIlT5izSyjCRz2W+njeWhPrKF4rSglzHr0/wB3lwpBF7VEOBuvItxhuTpdhZdN3RTAqehj/KRuPx1vdLKdH8s9xTx6leHvaBnVQJ4jCcO8wTMrHXVmGUPtZ852OIQpKjeLQqzSs9mDK/jT0zz5gQXChBiYIP+2XOVFuyoSqTKkMBf0zuPqcq8ZD9gSYc53/XWNGUFGWvzlb/PvnfkKnaetOlyIYelAgm0Tb9VNye1HPODxXnZ1DXhZwGw7CLfxtavu8PrmiQDZwD8FbOWwyDoQA+6rCijZ2gHnoyDP,iv:uX/5gv+bQEKXZPVJDXiBajaWasxmh/mZZq66UNaKe3Q=,tag:kvAZYD+kqcWtc/Oo+ym20g==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1gsv9h0faztlavyw8ydl3t8p39u737jj48qvg8lrnsdkamthqaepsqegr08 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3b2JsOXdFTndnclZCRm80 + REZpZFBuMlFvVWhMcDRBNDJlV3d0MEFIUno0CncrejdPeTN1Z2t2SnRzNjBSTXc4 + dWRWTE1XTy9LcHZYSWRabDZSemQrS2sKLS0tIHkwbFpuenpwOCtoVFg4ZHBDc3k3 + bnJ3YzRHcDBPcGR0NzlKUzF6bHcyajQK214Dek7XUkmIelWsmVxk5eZmPsfbllP0 + 1kqP5vImXTMVmcvGR0XTnYxkNt5LVke8DWnsfEEMZniJxbm61N7+UQ== + -----END AGE ENCRYPTED FILE----- + - recipient: age1wzany9cugzdzgj9zv7cc9w9ctnuu00vl6vm34cgjlyudegfqcptqgd9ut6 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZcFh2R3lDdGc1cVBrWWhz + VTN6S2hyM20vSlhIRTUvbld3dE0wOGdUZHpzCjJvMFkrdndVUHlIaFZKSW04amlS + enlBNmJGc0pjbEkvNTNucTExNE9PSXMKLS0tIDlHSEQ4VVBFci9aWEpmRTNVY0hL + SDdOQkVUZVFKZUhIcytGVHNWRU9yWnMKgrnTLzfvi9RRL59+iOnvXVew3GUQtXvV + lBZ7Jam2G3AKFsdY/Z4QMAH9cqaLypPQRt5uJ+2Agl2dbGKqTqUFrg== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-10-23T15:39:50Z" + mac: ENC[AES256_GCM,data:x2XnbLAAWuCudb9C71I11Hmigh8sQE6lsy4YM5qg2IYRBrOnh+90MblMNAqlj5PX5/c2qg9wlRRpkCTtjcSDtur8j0dnbwQ1gg1AcwB0SWoG0QI1ynFZOJ/aCDeqcRK52AdSkrgz/wRSN2WpPX4O+hNvDRVASIyhumZQb6rrHRU=,iv:uBGxIZdwyGebtNCkpvLlVG1Wg1DdL00rJFxZjbbCV50=,tag:pg41so3tG+no/JaDA/SJMg==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.9.1 diff --git a/machines/nfs/default.nix b/machines/nfs/default.nix new file mode 100644 index 0000000..b3f3a15 --- /dev/null +++ b/machines/nfs/default.nix @@ -0,0 +1,27 @@ +{ + imports = [ + ./hardware.nix + ./nfs.nix + ]; + + deployment = { + targetHost = "10.32.45.10"; + }; + + networking = { + interfaces."eth0" = { + ipv4.addresses = [{ + address = "10.32.45.10"; + prefixLength = 24; + }]; + }; + + defaultGateway = { + interface = "eth0"; + address = "10.32.45.1"; + }; + }; + + system.stateVersion = "24.05"; +} + diff --git a/machines/nfs/hardware.nix b/machines/nfs/hardware.nix new file mode 100644 index 0000000..cb0a876 --- /dev/null +++ b/machines/nfs/hardware.nix @@ -0,0 +1,65 @@ +{ modulesPath, ... }: + +{ + imports = [ + "${modulesPath}/installer/scan/not-detected.nix" + ]; + + nixpkgs.hostPlatform = "x86_64-linux"; + + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ata_piix" + "mptsas" + "usb_storage" + "usbhid" + "sd_mod" + "sr_mod" + ]; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + + disko.devices = { + disk = { + root = { + type = "disk"; + device = "/dev/sda"; + imageSize = "32G"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} + diff --git a/machines/nfs/nfs.nix b/machines/nfs/nfs.nix new file mode 100644 index 0000000..ae7adb7 --- /dev/null +++ b/machines/nfs/nfs.nix @@ -0,0 +1,13 @@ +{ + services.nfs.server = { + enable = true; + exports = '' + /home 10.32.45.0/24(rw,async,no_root_squash) + ''; + }; + + networking.firewall.allowedTCPPorts = [ + 2049 # NFSv4 + ]; +} + diff --git a/shared/default.nix b/shared/default.nix new file mode 100644 index 0000000..72b16d6 --- /dev/null +++ b/shared/default.nix @@ -0,0 +1,21 @@ +{ name, ...}: + +{ + imports = [ + ./nix.nix + ./network.nix + ./users.nix + ./system.nix + ]; + + time.timeZone = "Europe/Berlin"; + i18n.defaultLocale = "en_US.UTF-8"; + console.keyMap = "de"; + + _module.args = { + machinePath = ../machines/${name}; + }; + + disko.imageBuilder.imageFormat = "qcow2"; +} + diff --git a/shared/network.nix b/shared/network.nix new file mode 100644 index 0000000..c529bb7 --- /dev/null +++ b/shared/network.nix @@ -0,0 +1,28 @@ +{ config, name, ...}: + +{ + networking = { + nftables.enable = true; + + hostName = name; + domain = "linuxlab.informatik.hs-fulda.de"; + + search = [ + "linuxlab.informatik.hs-fulda.de" + ]; + + # TODO: nameservers = [ "10.0.0.53" ]; + nameservers = [ "1.0.0.1" "1.1.1.1" ]; + + useDHCP = false; + + extraHosts = '' + 10.32.45.10 nfs.${config.networking.domain} + 10.32.45.11 ldap.${config.networking.domain} + 10.32.45.12 install.${config.networking.domain} + + 10.32.45.11 ldap-linuxlab.informatik.hs-fulda.de + ''; + }; +} + diff --git a/shared/nix.nix b/shared/nix.nix new file mode 100644 index 0000000..17ae3d4 --- /dev/null +++ b/shared/nix.nix @@ -0,0 +1,69 @@ +{ config, lib, pkgs, inputs, ... }: + +{ + nixpkgs.overlays = [ + # Make nixpkgs-unstable available as subtree + (_: _: { + unstable = import inputs.nixpkgs-unstable { + inherit (config.nixpkgs) system; + config = { + allowUnfree = true; + }; + }; + }) + + # Let builders fetch sources directly instead of uploading + (self: super: (super.prefer-remote-fetch self super)) + ]; + + # Who cares about licenses? + nixpkgs.config.allowUnfree = true; + + # Link nixpkgs to etc for usage in NIX_PATH. + # This allows update to the symlinks when updating nixpkgs without changes + # to NIX_PATH, which requires a new session to bekome active. + environment.etc.nixpkgs.source = pkgs.linkFarm "nixpkgs" [ + { name = "nixpkgs"; inherit (pkgs) path; } + { name = "nixpkgs-unstable"; inherit (pkgs.unstable) path; } + ]; + + nix = { + nixPath = lib.mkForce [ + "nixpkgs=/etc/nixpkgs/nixpkgs" + "nixpkgs-unstable=/etc/nixpkgs/nixpkgs-unstable" + ]; + + registry = { + "nixpkgs" = { + from = { type = "indirect"; id = "nixpkgs"; }; + to = { type = "path"; path = "/etc/nixpkgs/nixpkgs"; }; + }; + "nixpkgs-unstable" = { + from = { type = "indirect"; id = "nixpkgs-unstable"; }; + to = { type = "path"; path = "/etc/nixpkgs/nixpkgs-unstable"; }; + }; + }; + + # Take out the trash + gc = { + automatic = true; + dates = "monthly"; + options = "--delete-older-than 30d"; + }; + + # Optimize the store + optimise = { + automatic = true; + dates = [ "monthly" ]; + }; + + # Enable modern commands + settings = { + experimental-features = [ + "flakes" + "nix-command" + ]; + }; + }; +} + diff --git a/shared/system.nix b/shared/system.nix new file mode 100644 index 0000000..6af77aa --- /dev/null +++ b/shared/system.nix @@ -0,0 +1,14 @@ +{ + services.haveged.enable = true; + + services.openssh = { + enable = true; + settings.PermitRootLogin = "without-password"; + }; + + networking.firewall = { + allowedTCPPorts = [ + 22 # SSH + ]; + }; +} diff --git a/shared/users.nix b/shared/users.nix new file mode 100644 index 0000000..3018342 --- /dev/null +++ b/shared/users.nix @@ -0,0 +1,31 @@ +{ pkgs, config, ...}: + +{ + users.mutableUsers = false; + + users.users."root" = { + #hashedPassword = "$y$j9T$5ZEv2RROIXAqdFjFEXEst0$5HA63fmwjGXw1id4n94TRgY1gTuXsQGKXmzlcWXyE07"; + hashedPassword = "$y$j9T$IqOVsS6/ACfhDXzA3LqsZ1$J/16UDhw44bHWJqIoCdjms6IEwT4tk4ghq2WpThOlMA"; + + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2nkarN0+uSuP5sGwDCb9KRu+FCjO/+da4VypGanPUZ fooker@k-2so" + ]; + + packages = with pkgs; [ + vim + wget + curl + tmux + fd + ripgrep + htop + iotop + iftop + file + iperf + ldns + tcpdump + ]; + }; +} + diff --git a/sops-config.nix b/sops-config.nix new file mode 100644 index 0000000..307e9aa --- /dev/null +++ b/sops-config.nix @@ -0,0 +1,78 @@ +{ lib +, runCommandNoCCLocal +, writeText +, ssh-to-age +, machines +, ... +}: + +with lib; + +let + admins = { + "fooker" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK2nkarN0+uSuP5sGwDCb9KRu+FCjO/+da4VypGanPUZ"; + }; + + hosts = { + "nfs" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMW2Ouwep/O0ULtPC8aHx+s9oB8RDJis02u9wYnJe7My"; + "ldap" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILeRJF8IwyYAe4T4x7+n6ufO6lmOTu6PgPdmHiPRfCqI"; + "installer" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrc58WlxYKaPNO1J8j8KQxOLJooc9fIxp6gZZoB4Y7o"; + }; + + sshToAge = ssh-key: + let + key = runCommandNoCCLocal "hostkey-to-age" { } '' + ${ssh-to-age}/bin/ssh-to-age < '${writeText "" ssh-key}' > "$out" + ''; + in + pipe key [ + readFile + (removeSuffix "\n") + ]; + + # Keys for each machine + machine-keys = genAttrs machines (machine: + let + ssh-key = assert assertMsg (hasAttr machine hosts) '' + SSH host key is not specified for machine '${machine}'. + + Make sure the SSH host key is added to `sops-config.nix` after initial provisioning. + After changing the hosts, make sure to run `sops updatekeys` with all relevant secret files. + ''; + getAttr machine hosts; + in + sshToAge ssh-key); + + # Keys for all admins + admin-keys = mapAttrsToList + (_: sshToAge) + admins; + + mkRule = path: keys: { + "path_regex" = "^${if path == null then "" else "${escapeRegex path}/"}(${escapeRegex "secrets.yaml"}|secrets/.+)$"; + "key_groups" = [{ + "age" = keys; + }]; + }; + + # Create a rule for each machine allowing the mechanie and all admins + machine-rules = map + (machine: mkRule + "machines/${machine}" + (admin-keys ++ (singleton machine-keys.${machine}))) + machines; + + # A single global rule allowing all machines and all admins to access + global-rules = singleton (mkRule null (admin-keys ++ (attrValues machine-keys))); + +in +{ + inherit admin-keys; + + config = { + "creation_rules" = concatLists [ + machine-rules + global-rules + ]; + }; +}