diff --git a/modules/applications/zsh.nix b/modules/applications/zsh.nix index f46d979..59525d7 100644 --- a/modules/applications/zsh.nix +++ b/modules/applications/zsh.nix @@ -33,7 +33,7 @@ _: { command cat "$@" fi } - + custom-eza() { # behaves differently if we just call it or if we pipe initContent if [[ -t 1 ]]; then eza -hlF -aa --color=always --hyperlink --group-directories-first --show-symlinks --icons=always --git --no-permissions "$@" diff --git a/modules/hardware/disko/disko-config.nix b/modules/hardware/disko/disko-config.nix index 17dc4e3..000fd4f 100644 --- a/modules/hardware/disko/disko-config.nix +++ b/modules/hardware/disko/disko-config.nix @@ -1,78 +1,117 @@ _: { flake.diskoConfigurations.desktop = _: { -disko.devices = { -disk = { - ssd = { - # Replace with actual disk id from: - # ls -l /dev/disk/by-id - device = "/dev/disk/by-id/REPLACE_SSD_ID"; - - type = "disk"; - - content = { - type = "gpt"; - - partitions = { - ESP = { - size = "1G"; - type = "EF00"; - - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; + disko.devices = { + disk = { + ssd = { + # Replace with actual disk id from: + # ls -l /dev/disk/by-id + device = "/dev/disk/by-id/REPLACE_SSD_ID"; + + type = "disk"; + + content = { + type = "gpt"; + + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + + luks = { + size = "100%"; + + content = { + type = "luks"; + name = "cryptroot"; + + # You will type this password at boot. + settings.allowDiscards = true; + + content = { + type = "btrfs"; + + extraArgs = ["-f"]; + + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + + "@snapshots" = { + mountpoint = "/.snapshots"; + }; + + # Keyfile storage. + # This subvolume will contain the key used + # to unlock the HDD automatically. + "@keys" = { + mountpoint = "/keys"; + }; + }; + }; + }; + }; }; }; - - luks = { - size = "100%"; - - content = { - type = "luks"; - name = "cryptroot"; - - # You will type this password at boot. - settings.allowDiscards = true; - - content = { - type = "btrfs"; - - extraArgs = [ "-f" ]; - - subvolumes = { - "@root" = { - mountpoint = "/"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; + }; + + hdd = { + # Replace with actual disk id + device = "/dev/disk/by-id/REPLACE_HDD_ID"; + + type = "disk"; + + content = { + type = "gpt"; + + partitions = { + luks = { + size = "100%"; + + content = { + type = "luks"; + + name = "cryptdata"; + + # IMPORTANT: + # This keyfile will be created after installation. + # The SSD unlocks first. + # Then this keyfile unlocks the HDD automatically. + settings = { + keyFile = "/keys/hdd.key"; }; - - "@home" = { - mountpoint = "/home"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; - }; - - "@nix" = { - mountpoint = "/nix"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; - }; - - "@snapshots" = { - mountpoint = "/.snapshots"; - }; - - # Keyfile storage. - # This subvolume will contain the key used - # to unlock the HDD automatically. - "@keys" = { - mountpoint = "/keys"; + + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/data"; }; }; }; @@ -80,43 +119,6 @@ disk = { }; }; }; - }; - - hdd = { - # Replace with actual disk id - device = "/dev/disk/by-id/REPLACE_HDD_ID"; - - type = "disk"; - - content = { - type = "gpt"; - - partitions = { - luks = { - size = "100%"; - - content = { - type = "luks"; - - name = "cryptdata"; - - # IMPORTANT: - # This keyfile will be created after installation. - # The SSD unlocks first. - # Then this keyfile unlocks the HDD automatically. - settings = { - keyFile = "/keys/hdd.key"; - }; - - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/data"; - }; - }; - }; - }; }; }; -}; -};};} +} diff --git a/modules/utilities/autoCleanup.nix b/modules/utilities/autoCleanup.nix index 04f3058..9bf673d 100644 --- a/modules/utilities/autoCleanup.nix +++ b/modules/utilities/autoCleanup.nix @@ -49,7 +49,6 @@ }; }; }; - ## Desktop flake.nixosModules.autoCleanup-desktop = { @@ -102,7 +101,7 @@ }; }; }; -perSystem = {pkgs, ...}: { + perSystem = {pkgs, ...}: { packages.custom-cleanNix-laptop = pkgs.writeShellApplication { name = "custom-cleanNix"; diff --git a/modules/utilities/autoUpdate.nix b/modules/utilities/autoUpdate.nix index a38c240..7bd8929 100644 --- a/modules/utilities/autoUpdate.nix +++ b/modules/utilities/autoUpdate.nix @@ -44,7 +44,7 @@ }; }; }; - + ## desktop flake.nixosModules.autoUpdate-desktop = {pkgs, ...}: { # Ensure your script is available system-wide @@ -91,7 +91,7 @@ }; }; }; -perSystem = {pkgs, ...}: { + perSystem = {pkgs, ...}: { packages.custom-autoupdate-laptop = pkgs.writeShellApplication { name = "custom-autoupdate";