From 8c36e1a019c5bde84a09768918dd4d3ff2432db5 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 11 Dec 2025 17:17:02 +0200 Subject: [PATCH] feat: alice initial --- modules/hosts/ws/alice/_nixos/default.nix | 30 ++++ .../alice/_nixos/hardware-configuration.nix | 52 ++++++ .../hosts/ws/alice/_nixos/impermanence.nix | 12 ++ .../_nixos/not-managed-by-modules-yet.nix | 13 ++ modules/hosts/ws/alice/default.nix | 154 ++++++++++++++++++ 5 files changed, 261 insertions(+) create mode 100644 modules/hosts/ws/alice/_nixos/default.nix create mode 100644 modules/hosts/ws/alice/_nixos/hardware-configuration.nix create mode 100644 modules/hosts/ws/alice/_nixos/impermanence.nix create mode 100644 modules/hosts/ws/alice/_nixos/not-managed-by-modules-yet.nix create mode 100644 modules/hosts/ws/alice/default.nix diff --git a/modules/hosts/ws/alice/_nixos/default.nix b/modules/hosts/ws/alice/_nixos/default.nix new file mode 100644 index 0000000..14d1a85 --- /dev/null +++ b/modules/hosts/ws/alice/_nixos/default.nix @@ -0,0 +1,30 @@ +{ + lib, + pkgs, + ... +}: { + imports = [ + ./hardware-configuration.nix + ./impermanence.nix + ./not-managed-by-modules-yet.nix + ]; + + boot.kernelPackages = pkgs.linuxPackages_6_17; + + boot.initrd.postResumeCommands = lib.mkAfter '' + zfs rollback -r zpool/root@blank + ''; + + sops.defaultSopsFile = ../../../../../secrets/alice/secrets.yaml; + sops.gnupg.sshKeyPaths = ["/persist/etc/ssh/ssh_host_rsa_key"]; + sops.age.sshKeyPaths = ["/persist/etc/ssh/ssh_host_ed25519_key"]; + + networking.hostId = "bc56f04f"; + networking.networkmanager.enable = true; + # TODO: FIXME: make global setting maybe + networking.nameservers = ["100.80.2.3"]; + + time.timeZone = "Europe/Helsinki"; + + system.stateVersion = "24.05"; +} diff --git a/modules/hosts/ws/alice/_nixos/hardware-configuration.nix b/modules/hosts/ws/alice/_nixos/hardware-configuration.nix new file mode 100644 index 0000000..16114e1 --- /dev/null +++ b/modules/hosts/ws/alice/_nixos/hardware-configuration.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.configurationLimit = 9; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = ["zfs"]; + boot.kernelModules = ["kvm-amd"]; + boot.supportedFilesystems = ["zfs"]; + + fileSystems."/" = { + device = "zpool/root"; + fsType = "zfs"; + neededForBoot = true; + }; + + fileSystems."/home" = { + device = "zpool/home"; + fsType = "zfs"; + neededForBoot = true; + }; + + fileSystems."/nix" = { + device = "zpool/nix"; + fsType = "zfs"; + neededForBoot = true; + }; + + fileSystems."/persist" = { + device = "zpool/persist"; + fsType = "zfs"; + neededForBoot = true; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/3DA8-297C"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; + + # TODO: fix? + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/hosts/ws/alice/_nixos/impermanence.nix b/modules/hosts/ws/alice/_nixos/impermanence.nix new file mode 100644 index 0000000..6dd1bd3 --- /dev/null +++ b/modules/hosts/ws/alice/_nixos/impermanence.nix @@ -0,0 +1,12 @@ +{ + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/etc/nixos" + "/etc/ssh" + "/var/lib/flatpak" + "/var/lib/nixos" + "/var/lib/tailscale" + ]; + }; +} diff --git a/modules/hosts/ws/alice/_nixos/not-managed-by-modules-yet.nix b/modules/hosts/ws/alice/_nixos/not-managed-by-modules-yet.nix new file mode 100644 index 0000000..9a15023 --- /dev/null +++ b/modules/hosts/ws/alice/_nixos/not-managed-by-modules-yet.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + keepassxc + firefox + + prismlauncher + + # k8s stuff + talosctl + kubectl + kubernetes-helm + ]; +} diff --git a/modules/hosts/ws/alice/default.nix b/modules/hosts/ws/alice/default.nix new file mode 100644 index 0000000..6a434ec --- /dev/null +++ b/modules/hosts/ws/alice/default.nix @@ -0,0 +1,154 @@ +{ + inputs, + lib, + ... +}: let + channel = "unstable"; + system = "x86_64-linux"; + hostName = "alice"; +in { + flake.nixosConfigurations.${hostName} = inputs."nixpkgs-${channel}".lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + lib = inputs."nixpkgs-${channel}".lib.extend ( + final: prev: + import ../../../../lib { + inherit inputs; + lib = final; + } + ); + }; + modules = [ + { + networking.hostName = hostName; + } + + ./_nixos + + inputs.impermanence.nixosModules.impermanence + inputs.sops-nix.nixosModules.sops + inputs."home-manager-${channel}".nixosModules.home-manager + + ({ + config, + pkgs, + ... + }: let + user = "skye"; + importBoth = module: [ + inputs.self.modules.nixos.${module} + { + home-manager.users.${user}.imports = [inputs.self.modules.homeManager.${module}]; + } + ]; + in { + imports = with inputs.self.modules.nixos; + [ + core + amdgpu + audio + nvim + nix + steam + tailscale + obs + lazygit + ssh-agent + gnupg + + home-manager + { + home-manager.users.${user} = { + imports = with inputs.self.modules.homeManager; + [ + mangohud + git + ] + ++ [ + { + home.stateVersion = config.system.stateVersion; + + # Not yet in modules or anything. + home.packages = with pkgs; [blender]; + + services.wpaperd = { + enable = true; + settings = { + DP-3 = { + path = "/home/skye/Nextcloud/Wallpapers/forest"; + duration = "15m"; + }; + DP-2 = { + path = "/home/skye/Nextcloud/Wallpapers/minimalgals"; + duration = "15m"; + }; + }; + }; + } + + # TODO: how to position these configuration extensions + { + arta.git = { + email = "jonni@liljamo.com"; + name = "Jonni Liljamo"; + sendemail.enable = true; + }; + + arta.hyprland.extraConfig = { + exec-once = [ + "waybar" + ]; + + monitor = [ + "DP-2,2560x1440@59,0x0,1" + "DP-3,3840x2160@60,2560x0,1,bitdepth,10,cm,hdr,sdrbrightness,1.1,sdrsaturation,0.9" + ]; + + workspace = [ + "1,monitor:DP-2,default:true" + "2,monitor:DP-2" + "3,monitor:DP-2" + "4,monitor:DP-2" + "5,monitor:DP-2" + "6,monitor:DP-3,default:true" + "7,monitor:DP-3" + "8,monitor:DP-3" + "9,monitor:DP-3" + ]; + }; + + arta.waybar.extraConfig = { + output = ["DP-2"]; + + modules-left = ["hyprland/workspaces"]; + modules-right = [ + "wireplumber" + "custom/sep" + "disk" + "custom/sep" + "network" + "custom/sep" + "clock" + "custom/sep" + "hyprland/language" + "tray" + ]; + + "network".interface = "enp4s0"; + }; + } + ]; + }; + } + ] + ++ [inputs.self.modules.nixos.${user}] + ++ lib.flatten [ + (importBoth "hyprland") + (importBoth "shell") + (importBoth "passmenu") + ]; + }) + ]; + }; +} -- 2.44.1