1
0
Fork 0

Compare commits

..

No commits in common. "d3877feacf30bfa739ad8149990c7f3f043d6c20" and "b12f7e2b4a53b3eae4a2cc97892ff2cddd388e4a" have entirely different histories.

7 changed files with 108 additions and 72 deletions

View file

@ -138,11 +138,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720167120, "lastModified": 1720135141,
"narHash": "sha256-K9JYdlPiyaXp33JRg7CT8rMwH56e4ncXSsXW/YKnNXc=", "narHash": "sha256-1GHh1/WO+f42TXxb1WiZFMuepM7ITA9iT+6yJBbBNsY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "bbe6e94737289c8cb92d4d8f9199fbfe4f11c0ba", "rev": "c514e862cd5705e51edb6fe8d01146fdeec661f2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -9,6 +9,7 @@
let let
bootUUID = "FC20-D155"; # The UUID of the boot partition. bootUUID = "FC20-D155"; # The UUID of the boot partition.
luksUUID = "9fdc521b-a037-4070-af47-f54da03675e4"; # The UUID of the locked LUKS partition. luksUUID = "9fdc521b-a037-4070-af47-f54da03675e4"; # The UUID of the locked LUKS partition.
rootUUID = "dfb4fc8f-e82b-43a1-91c1-a77acb6337cb"; # The UUID of the unlocked filesystem partition.
in in
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -36,14 +37,20 @@ in
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { aux.system.filesystem = {
enable = true; btrfs = {
partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}";
luks = "/dev/disk/by-uuid/${luksUUID}";
};
swapFile = {
enable = true; enable = true;
size = 16384; devices = {
boot = "/dev/disk/by-uuid/${bootUUID}";
btrfs = "/dev/disk/by-uuid/${rootUUID}";
};
swapFile = {
enable = true;
size = 16384;
};
};
luks = {
enable = true;
uuid = luksUUID;
}; };
}; };

View file

@ -9,6 +9,7 @@
let let
bootUUID = "B2D7-96C3"; # The UUID of the boot partition. bootUUID = "B2D7-96C3"; # The UUID of the boot partition.
luksUUID = "f5ff391a-f2ef-4ac3-9ce8-9f5ed950b212"; # The UUID of the locked LUKS partition. luksUUID = "f5ff391a-f2ef-4ac3-9ce8-9f5ed950b212"; # The UUID of the locked LUKS partition.
rootUUID = "fed155a3-04ae-47c0-996d-0398faaa6a17"; # The UUID of the unlocked filesystem partition.
in in
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -70,14 +71,20 @@ in
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { aux.system.filesystem = {
enable = true; btrfs = {
partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}";
luks = "/dev/disk/by-uuid/${luksUUID}";
};
swapFile = {
enable = true; enable = true;
size = 16384; devices = {
boot = "/dev/disk/by-uuid/${bootUUID}";
btrfs = "/dev/disk/by-uuid/${rootUUID}";
};
swapFile = {
enable = true;
size = 16384;
};
};
luks = {
enable = true;
uuid = luksUUID;
}; };
}; };

View file

@ -9,6 +9,7 @@
let let
bootUUID = "AFCB-D880"; # The UUID of the boot partition. bootUUID = "AFCB-D880"; # The UUID of the boot partition.
luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition. luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition.
rootUUID = "b801fbea-4cb5-4255-bea9-a2ce77d1a1b7"; # The UUID of the unlocked filesystem partition.
in in
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -35,14 +36,20 @@ in
# Configure the main filesystem. # Configure the main filesystem.
aux.system.filesystem = { aux.system.filesystem = {
enable = true; btrfs = {
partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}";
luks = "/dev/disk/by-uuid/${luksUUID}";
};
swapFile = {
enable = true; enable = true;
size = 16384; devices = {
boot = "/dev/disk/by-uuid/${bootUUID}";
btrfs = "/dev/disk/by-uuid/${rootUUID}";
};
swapFile = {
enable = true;
size = 16384;
};
};
luks = {
enable = true;
uuid = luksUUID;
}; };
}; };

View file

@ -2,59 +2,74 @@
let let
cfg = config.aux.system.filesystem; cfg = config.aux.system.filesystem;
# LUKS partition will decrypt to /dev/mapper/nixos-root standardMountOpts = [ "compress=zstd" ];
decryptPart = "nixos-root";
decryptPath = "/dev/mapper/${decryptPart}";
in in
{ {
options = { options = {
aux.system.filesystem = { aux.system.filesystem = {
enable = lib.mkEnableOption (lib.mdDoc "Enables standard BTRFS subvolumes and parameters."); btrfs = {
partitions = { enable = lib.mkEnableOption (lib.mdDoc "Enables standard BTRFS subvolumes and parameters.");
boot = lib.mkOption { devices = {
type = lib.types.str; boot = lib.mkOption {
description = "The ID of your boot partition. Use /dev/disk/by-uuid for best results."; type = lib.types.str;
default = ""; description = "The ID of your boot partition. Use /dev/disk/by-uuid for best results.";
default = "";
};
btrfs = lib.mkOption {
type = lib.types.str;
description = "The ID of your BTRFS partition. Use /dev/disk/by-uuid for best results.";
default = "";
};
}; };
luks = lib.mkOption { swapFile = {
type = lib.types.str; enable = lib.mkEnableOption (lib.mdDoc "Enables the creation of a swap file.");
description = "The ID of your LUKS partition. Use /dev/disk/by-uuid for best results."; size = lib.mkOption {
default = ""; type = lib.types.int;
description = "The size of the swap file to create in MB (defaults to 8192, or ~8 gigabytes).";
default = 8192;
};
}; };
}; };
swapFile = { luks = {
enable = lib.mkEnableOption (lib.mdDoc "Enables the creation of a swap file."); enable = lib.mkEnableOption (
size = lib.mkOption { lib.mkDoc "Enables an encrypted LUKS container for the BTRFS partition."
type = lib.types.int; );
description = "The size of the swap file to create in MB (defaults to 8192, or ~8 gigabytes)."; uuid = lib.mkOption {
default = 8192; type = lib.types.str;
description = "The UUID of the encrypted LUKS volume.";
}; };
}; };
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.btrfs.enable {
# Check for blank parameters # Check for blank parameters
assertions = [ assertions = [
{ {
assertion = cfg.partitions.luks != ""; assertion = cfg.btrfs.devices.btrfs != "";
message = "Please specify a LUKS partition to use as the root filesystem."; message = "Please specify the BTRFS partition UUID to use as the filesystem.";
} }
{ {
assertion = cfg.partitions.boot != ""; assertion = cfg.btrfs.devices.boot != "";
message = "Please specify your boot partition."; message = "Please specify the boot partition UUID.";
} }
(lib.mkIf cfg.luks.enable {
assertion = cfg.luks.uuid != "";
message = "Please enter a valid UUID for the encrypted LUKS volume.";
})
]; ];
boot.initrd.luks.devices.${decryptPart} = { boot.initrd.luks.devices = lib.mkIf cfg.luks.enable {
device = cfg.partitions.luks; "luks-${cfg.luks.uuid}" = {
# Enable TPM auto-unlocking if configured device = "/dev/disk/by-uuid/${cfg.luks.uuid}";
crypttabExtraOpts = lib.mkIf config.aux.system.bootloader.tpm2.enable [ "tpm2-device=auto" ]; # Enable TPM auto-unlocking if configured
crypttabExtraOpts = lib.mkIf config.aux.system.bootloader.tpm2.enable [ "tpm2-device=auto" ];
};
}; };
fileSystems = fileSystems =
{ {
"/" = { "/" = {
device = decryptPath; device = cfg.btrfs.devices.btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"subvol=@" "subvol=@"
@ -62,11 +77,11 @@ in
]; ];
}; };
"/boot" = { "/boot" = {
device = cfg.partitions.boot; device = cfg.btrfs.devices.boot;
fsType = "vfat"; fsType = "vfat";
}; };
"/home" = { "/home" = {
device = decryptPath; device = cfg.btrfs.devices.btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"subvol=@home" "subvol=@home"
@ -74,7 +89,7 @@ in
]; ];
}; };
"/var/log" = { "/var/log" = {
device = decryptPath; device = cfg.btrfs.devices.btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"subvol=@log" "subvol=@log"
@ -82,7 +97,7 @@ in
]; ];
}; };
"/nix" = { "/nix" = {
device = decryptPath; device = cfg.btrfs.devices.btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"subvol=@nix" "subvol=@nix"
@ -91,9 +106,9 @@ in
]; ];
}; };
} }
// lib.optionalAttrs cfg.swapFile.enable { // lib.optionalAttrs cfg.btrfs.swapFile.enable {
"/swap" = { "/swap" = {
device = decryptPath; device = cfg.btrfs.devices.btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"subvol=@swap" "subvol=@swap"
@ -102,10 +117,10 @@ in
}; };
}; };
swapDevices = lib.mkIf cfg.swapFile.enable [ swapDevices = lib.mkIf cfg.btrfs.swapFile.enable [
{ {
device = "/swap/swapfile"; device = "/swap/swapfile";
size = cfg.swapFile.size; size = cfg.btrfs.swapFile.size;
} }
]; ];
}; };

View file

@ -65,26 +65,26 @@ in
gnomeExtensions.extension-list gnomeExtensions.extension-list
gedit # text editor gedit # text editor
]) ])
++ (with pkgs; [ ++ (with pkgs.gnome; [
cheese # webcam tool cheese # webcam tool
gnome.gnome-music gnome-music
gnome-calendar gnome-calendar
epiphany # web browser epiphany # web browser
geary # email reader geary # email reader
evince # document viewer evince # document viewer
gnome.gnome-characters gnome-characters
gnome.gnome-software gnome-software
totem # video player totem # video player
gnome.tali # poker game tali # poker game
gnome.iagno # go game iagno # go game
gnome.hitori # sudoku game hitori # sudoku game
gnome.atomix # puzzle game atomix # puzzle game
]); ]);
# Install additional packages # Install additional packages
systemPackages = with pkgs; [ systemPackages = with pkgs; [
# Gnome tweak tools # Gnome tweak tools
gnome-tweaks gnome.gnome-tweaks
# Gnome extensions # Gnome extensions
gnomeExtensions.alphabetical-app-grid gnomeExtensions.alphabetical-app-grid
gnomeExtensions.another-window-session-manager gnomeExtensions.another-window-session-manager
@ -93,7 +93,7 @@ in
gnomeExtensions.forge gnomeExtensions.forge
gnomeExtensions.random-wallpaper gnomeExtensions.random-wallpaper
# Themeing # Themeing
gnome-themes-extra gnome.gnome-themes-extra
papirus-icon-theme papirus-icon-theme
qogir-icon-theme qogir-icon-theme
]; ];

View file

@ -71,7 +71,7 @@ with lib;
aggregatedIcons = pkgs.buildEnv { aggregatedIcons = pkgs.buildEnv {
name = "system-icons"; name = "system-icons";
paths = with pkgs; [ paths = with pkgs; [
(lib.mkIf config.aux.system.ui.desktops.gnome.enable gnome-themes-extra) (lib.mkIf config.aux.system.ui.desktops.gnome.enable gnome.gnome-themes-extra)
(lib.mkIf config.aux.system.ui.desktops.kde.enable kdePackages.breeze-icons) (lib.mkIf config.aux.system.ui.desktops.kde.enable kdePackages.breeze-icons)
papirus-icon-theme papirus-icon-theme
qogir-icon-theme qogir-icon-theme