From 5d6e7e35d5bf27167156e4b181c5c1378c7a98e1 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Tue, 30 Sep 2025 20:44:36 -0500 Subject: [PATCH] disko upd --- .../matt@macbook-pro-nixos/default.nix | 6 +- homes/aarch64-linux/matt@pi4/default.nix | 4 +- .../x86_64-linux/admin@jallen-nas/default.nix | 4 +- homes/x86_64-linux/deck@steamdeck/default.nix | 4 +- .../x86_64-linux/matt@matt-nixos/default.nix | 47 ++-- .../nixos/disko/aarch64-linux/default.nix.ori | 147 ------------ modules/nixos/disko/default.nix | 18 +- modules/nixos/disko/options.nix | 2 + .../nixos/disko/x86_64-linux/default.nix.ori | 214 ------------------ modules/nixos/home/default.nix | 2 +- systems/aarch64-linux/pi4/default.nix | 5 +- systems/aarch64-linux/pi5/default.nix | 5 +- systems/x86_64-linux/matt-nixos/default.nix | 15 ++ 13 files changed, 79 insertions(+), 394 deletions(-) delete mode 100644 modules/nixos/disko/aarch64-linux/default.nix.ori delete mode 100644 modules/nixos/disko/x86_64-linux/default.nix.ori diff --git a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix index bdff920..1efa42b 100755 --- a/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix +++ b/homes/aarch64-linux/matt@macbook-pro-nixos/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, namespace, ... }: let theme = import (lib.snowfall.fs.get-file "modules/home/desktop/theme/nord.nix"); shellAliases = { @@ -22,7 +22,7 @@ in home.homeDirectory = "/home/matt"; home.stateVersion = "23.11"; - mjallen = { + ${namespace} = { programs.hyprland = { enable = true; primaryDisplay = "eDP-1"; @@ -120,7 +120,7 @@ in }; home.packages = with pkgs; [ - pkgs.mjallen.bolt-launcher + pkgs.${namespace}.bolt-launcher iw iwd diff --git a/homes/aarch64-linux/matt@pi4/default.nix b/homes/aarch64-linux/matt@pi4/default.nix index f203cfe..252b2e3 100755 --- a/homes/aarch64-linux/matt@pi4/default.nix +++ b/homes/aarch64-linux/matt@pi4/default.nix @@ -1,8 +1,8 @@ -{ lib, ... }: +{ lib, namespace, ... }: { home.username = "matt"; - mjallen = { + ${namespace} = { shell-aliases = { enable = true; flakeInputs = [ diff --git a/homes/x86_64-linux/admin@jallen-nas/default.nix b/homes/x86_64-linux/admin@jallen-nas/default.nix index e5a1e69..237554e 100755 --- a/homes/x86_64-linux/admin@jallen-nas/default.nix +++ b/homes/x86_64-linux/admin@jallen-nas/default.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ pkgs, namespace, ... }: { home.username = "admin"; - mjallen = { + ${namespace} = { shell-aliases = { enable = true; buildHost = ""; # NAS builds locally diff --git a/homes/x86_64-linux/deck@steamdeck/default.nix b/homes/x86_64-linux/deck@steamdeck/default.nix index cef066f..9fe438a 100755 --- a/homes/x86_64-linux/deck@steamdeck/default.nix +++ b/homes/x86_64-linux/deck@steamdeck/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, namespace, ... }: let shellAliases = { update-boot = "sudo nixos-rebuild boot --max-jobs 10 --build-host admin@10.0.1.3"; @@ -10,7 +10,7 @@ in { home.username = "deck"; - mjallen.desktop.gnome.enable = true; + ${namespace}.desktop.gnome.enable = true; sops = { age.keyFile = "/home/deck/.config/sops/age/keys.txt"; diff --git a/homes/x86_64-linux/matt@matt-nixos/default.nix b/homes/x86_64-linux/matt@matt-nixos/default.nix index ca0b9ec..bcf560d 100755 --- a/homes/x86_64-linux/matt@matt-nixos/default.nix +++ b/homes/x86_64-linux/matt@matt-nixos/default.nix @@ -1,5 +1,6 @@ -{ pkgs, ... }: +{ lib, pkgs, namespace, ... }: let + inherit (lib.${namespace}) enabled disabled; displayLeft = { input = "DP-1"; resolution = "3840x2160"; @@ -14,22 +15,12 @@ in { home.username = "matt"; - mjallen = { + ${namespace} = { sops = { enable = true; }; shell-aliases = { enable = true; - flakeInputs = [ - "desktop-nixpkgs" - "desktop-chaotic" - "desktop-home-manager" - "desktop-impermanence" - "desktop-lanzaboote" - "desktop-nixos-hardware" - "desktop-sops-nix" - "desktop-steam-rom-manager" - ]; }; programs = { @@ -68,7 +59,7 @@ in browser = pkgs.firefox; }; }; - btop.enable = true; + btop = enabled; kitty = { enable = true; font = { @@ -80,8 +71,8 @@ in enable = true; fontName = "JetBrainsMono NFM"; }; - nwg-dock.enable = true; - nwg-drawer.enable = true; + nwg-dock = enabled; + nwg-drawer = enabled; nwg-panel = { enable = true; defaultApps = { @@ -134,8 +125,8 @@ in } ''; }; - wlogout.enable = true; - wofi.enable = true; + wlogout = enabled; + wofi = enabled; }; }; @@ -147,11 +138,11 @@ in }; programs = { - password-store.enable = true; + password-store = enabled; }; home.packages = with pkgs; [ - pkgs.mjallen.bolt-launcher + pkgs.${namespace}.bolt-launcher bottles compose2nix @@ -177,4 +168,22 @@ in vorta waydroid-helper ]; + + specialisation = { + "cosmic".configuration = { + ${namespace} = { + programs = { + hyprland = lib.mkForce disabled; + kitty = lib.mkForce disabled; + mako = lib.mkForce disabled; + nwg-dock = lib.mkForce disabled; + nwg-drawer = lib.mkForce disabled; + nwg-panel = lib.mkForce disabled; + waybar = lib.mkForce disabled; + wlogout = lib.mkForce disabled; + wofi = lib.mkForce disabled; + }; + }; + }; + }; } diff --git a/modules/nixos/disko/aarch64-linux/default.nix.ori b/modules/nixos/disko/aarch64-linux/default.nix.ori deleted file mode 100644 index 96cfb00..0000000 --- a/modules/nixos/disko/aarch64-linux/default.nix.ori +++ /dev/null @@ -1,147 +0,0 @@ -{ - config, - lib, - system, - namespace, - ... -}: -let - cfg = config.${namespace}.hardware.disko; - isArm = builtins.match "aarch64*" system != null; - rootDisk = "/dev/nvme0n1"; - - # BTRFS root partition configuration - btrfsRoot = { - name = "btrfs-root"; - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - "home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - "root" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/root"; - }; - "nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - "etc" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/etc"; - }; - "log" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/var/log"; - }; - }; - }; - }; - - # BCacheFS root partition configuration - bcachefsRoot = { - size = "100%"; - content = { - type = "bcachefs"; - # This refers to a filesystem in the `bcachefs_filesystems` attrset below. - filesystem = "mounted_subvolumes_in_multi"; - label = "ssd.ssd1"; - extraFormatArgs = [ - "--discard" - ]; - }; - }; -in -{ - imports = [ ../options.nix ]; - config = lib.mkIf (isArm && cfg.enable) { - disko.devices = { - # root disk setup - disk.main = { - type = "disk"; - device = rootDisk; - imageSize = "15G"; - content = { - type = "gpt"; - # specify partitions - partitions = { - # /boot/firmware - FIRMWARE = { - priority = 1; - name = "FIRMWARE"; - start = "1M"; - end = "1G"; - type = "0700"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot/firmware"; - mountOptions = [ "umask=0077" ]; - }; - }; - # /boot - ESP = { - priority = 2; - name = "ESP"; - # start = "1G"; - # end = "2G"; - size = "1G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - - root = if cfg.filesystem == "btrfs" then btrfsRoot else bcachefsRoot; - }; - }; - }; - - bcachefs_filesystems = lib.mkIf (cfg.filesystem == "bcachefs") { - mounted_subvolumes_in_multi = { - type = "bcachefs_filesystem"; - # passwordFile = "/etc/nixos/pool.jwe"; - extraFormatArgs = [ - "--compression=zstd" - ]; - subvolumes = { - "/root" = { - mountpoint = "/"; - }; - "/persistent" = { - mountpoint = "/persistent"; - }; - "/nix" = { - mountOptions = [ - "noatime" - ]; - mountpoint = "/nix"; - }; - }; - mountpoint = "/partition-root"; - }; - }; - }; - }; -} diff --git a/modules/nixos/disko/default.nix b/modules/nixos/disko/default.nix index 5e5a84c..d36d27e 100644 --- a/modules/nixos/disko/default.nix +++ b/modules/nixos/disko/default.nix @@ -33,7 +33,7 @@ let # BTRFS root partition configuration root = { - name = "${cfg.filesystem}-root"; + name = "${config.${namespace}.network.hostName}-${cfg.filesystem}-root"; size = "100%"; content = { type = cfg.filesystem; @@ -60,7 +60,7 @@ let # Luks root partition configuration luksRoot = { - name = "cryptroot"; + name = "${config.${namespace}.network.hostName}-cryptroot"; size = "100%"; content = { type = "luks"; @@ -121,7 +121,21 @@ in content = { type = "gpt"; partitions = { + FIRMWARE = lib.mkIf cfg.enableFirmware { + priority = 1; + name = "FIRMWARE"; + start = "1M"; + end = "1G"; + type = "0700"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/firmware"; + mountOptions = [ "umask=0077" ]; + }; + }; ESP = { + priority = if cfg.enableFirmware then 2 else 1; type = "EF00"; size = "500M"; content = { diff --git a/modules/nixos/disko/options.nix b/modules/nixos/disko/options.nix index 9939636..eed9f77 100644 --- a/modules/nixos/disko/options.nix +++ b/modules/nixos/disko/options.nix @@ -19,6 +19,8 @@ in enableLuks = mkBoolOpt false "Enable Luks"; + enableFirmware = mkBoolOpt false "Enable rpi firmware part"; + swapSize = mkOpt types.str "16G" "size of swap part"; rootDisk = mkOpt types.str "/dev/nvme0n1" "Root disk"; diff --git a/modules/nixos/disko/x86_64-linux/default.nix.ori b/modules/nixos/disko/x86_64-linux/default.nix.ori deleted file mode 100644 index 76e63e3..0000000 --- a/modules/nixos/disko/x86_64-linux/default.nix.ori +++ /dev/null @@ -1,214 +0,0 @@ -{ - config, - lib, - system, - namespace, - ... -}: -let - cfg = config.${namespace}.hardware.disko; - isArm = builtins.match "aarch64*" system != null; - rootDisk = "/dev/nvme0n1"; - - # BTRFS root partition configuration - btrfsRoot = { - name = "btrfs-root"; - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - "home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - "root" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/root"; - }; - "nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - "etc" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/etc"; - }; - "log" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/var/log"; - }; - }; - }; - }; - - # BTRFS root partition configuration - encBtrfsRoot = { - name = "cryptroot"; - size = "100%"; - content = { - type = "luks"; - name = "cryptroot"; - extraOpenArgs = [ - "--allow-discards" - "--perf-no_read_workqueue" - "--perf-no_write_workqueue" - ]; - settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];}; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - "home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - "root" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/root"; - }; - "nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - "etc" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/etc"; - }; - "log" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/var/log"; - }; - }; - }; - }; - }; - - # BCacheFS root partition configuration - bcachefsRoot = { - name = "bcachefs-root"; - size = "100%"; - content = { - type = "bcachefs"; - # This refers to a filesystem in the `bcachefs_filesystems` attrset below. - filesystem = "mounted_subvolumes_in_multi"; - label = "ssd.ssd1"; - extraFormatArgs = [ - "--discard" - ]; - }; - }; -in -{ - imports = [ ../options.nix ]; - config = lib.mkIf (!isArm && cfg.enable) { - disko.devices = lib.mkMerge [ - { - nodev."/" = { - fsType = "tmpfs"; - mountOptions = [ - "mode=755" - "defaults" - "size=25%" - ]; - }; - disk = { - main = { - device = rootDisk; - type = "disk"; - imageSize = "32G"; - content = { - type = "gpt"; - partitions = { - ESP = { - type = "EF00"; - size = "500M"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - - swap = lib.mkIf cfg.enableSwap { - type = "8200"; - size = cfg.swapSize; - }; - - root = if cfg.filesystem == "btrfs" then ( if cfg.enableLuks then encBtrfsRoot else btrfsRoot) else bcachefsRoot; - }; - }; - }; - }; - - bcachefs_filesystems = lib.mkIf (cfg.filesystem == "bcachefs") { - mounted_subvolumes_in_multi = { - type = "bcachefs_filesystem"; - # passwordFile = "/etc/nixos/pool.jwe"; - extraFormatArgs = [ - "--compression=zstd" - ]; - subvolumes = { - "root" = { - mountpoint = "/root"; - mountOptions = [ - "noatime" - ]; - }; - "etc" = { - mountOptions = [ - "noatime" - ]; - mountpoint = "/etc"; - }; - "nix" = { - mountOptions = [ - "noatime" - ]; - mountpoint = "/nix"; - }; - "log" = { - mountOptions = [ - "noatime" - ]; - mountpoint = "/var/log"; - }; - "home" = { - mountpoint = "/home"; - }; - }; - }; - }; - } - ]; - }; -} diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix index c64a518..5136c8f 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -47,7 +47,7 @@ in # Pass inputs so external modules can access them extraSpecialArgs = { - inherit inputs; + inherit inputs namespace; overlays = with inputs; [ nix-vscode-extensions.overlays.default ]; diff --git a/systems/aarch64-linux/pi4/default.nix b/systems/aarch64-linux/pi4/default.nix index f2bc65c..452693c 100755 --- a/systems/aarch64-linux/pi4/default.nix +++ b/systems/aarch64-linux/pi4/default.nix @@ -28,7 +28,10 @@ ${namespace} = { impermanence.enable = true; hardware = { - disko.enable = true; + disko = { + enable = true; + enableFirmware = true; + }; raspberry-pi = { enable = true; variant = "4"; diff --git a/systems/aarch64-linux/pi5/default.nix b/systems/aarch64-linux/pi5/default.nix index 8a4893f..9550f3f 100644 --- a/systems/aarch64-linux/pi5/default.nix +++ b/systems/aarch64-linux/pi5/default.nix @@ -27,7 +27,10 @@ # ################################################### hardware = { - disko.enable = true; + disko = { + enable = true; + enableFirmware = true; + }; raspberry-pi = { enable = true; variant = "5"; diff --git a/systems/x86_64-linux/matt-nixos/default.nix b/systems/x86_64-linux/matt-nixos/default.nix index 5a89fe2..f1eaaa0 100644 --- a/systems/x86_64-linux/matt-nixos/default.nix +++ b/systems/x86_64-linux/matt-nixos/default.nix @@ -70,4 +70,19 @@ EDITOR = "${lib.getExe' pkgs.vscodium "codium"} --wait"; VISUAL = "${lib.getExe' pkgs.vscodium "codium"} --wait"; }; + + specialisation = { + "cosmic".configuration = { + ${namespace} = { + desktop = { + cosmic.enable = lib.mkForce true; + hyprland = { + enable = lib.mkForce false; + wallpaperSource = "nasa"; + }; + gnome.enable = lib.mkForce false; + }; + }; + }; + }; }