fix: Make ugaif.forUser add to enabled users and set WSL settings

This commit is contained in:
Hunter Halloran
2025-12-17 09:37:12 -05:00
parent 56a96cce09
commit acddb0dee4
2 changed files with 90 additions and 87 deletions

View File

@@ -78,104 +78,112 @@
}; };
}; };
config = { config = lib.mkMerge [
# ========== Disk Partitioning (Disko) ========== # Enable forUser if specified
disko.enableConfig = lib.mkDefault true; (lib.mkIf (config.ugaif.forUser != null) {
ugaif.users.${config.ugaif.forUser}.enable = true;
})
disko.devices = { # Main configuration
disk.main = { {
type = "disk"; # ========== Disk Partitioning (Disko) ==========
device = config.ugaif.host.filesystem.device; disko.enableConfig = lib.mkDefault true;
content = {
type = "gpt"; disko.devices = {
partitions = { disk.main = {
# EFI System Partition type = "disk";
ESP = { device = config.ugaif.host.filesystem.device;
name = "ESP"; content = {
label = "BOOT"; type = "gpt";
size = "1G"; partitions = {
type = "EF00"; # EFI System Partition
content = { ESP = {
type = "filesystem"; name = "ESP";
format = "vfat"; label = "BOOT";
mountpoint = "/boot"; size = "1G";
mountOptions = [ "umask=0077" ]; type = "EF00";
extraArgs = [ content = {
"-n" type = "filesystem";
"BOOT" format = "vfat";
]; mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
extraArgs = [
"-n"
"BOOT"
];
};
}; };
};
# Swap Partition (size configurable per host) # Swap Partition (size configurable per host)
swap = { swap = {
name = "swap"; name = "swap";
label = "swap"; label = "swap";
size = config.ugaif.host.filesystem.swapSize; size = config.ugaif.host.filesystem.swapSize;
content = { content = {
type = "swap"; type = "swap";
};
}; };
};
# Root Partition (takes remaining space) # Root Partition (takes remaining space)
root = { root = {
name = "root"; name = "root";
label = "root"; label = "root";
size = "100%"; size = "100%";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "ext4"; format = "ext4";
mountpoint = "/"; mountpoint = "/";
extraArgs = [ extraArgs = [
"-L" "-L"
"ROOT" "ROOT"
]; ];
};
}; };
}; };
}; };
}; };
}; };
};
# Bootloader Configuration # Bootloader Configuration
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
plymouth.enable = true; plymouth.enable = true;
# Enable "Silent boot" # Enable "Silent boot"
consoleLogLevel = 3; consoleLogLevel = 3;
initrd.verbose = false; initrd.verbose = false;
# Hide the OS choice for bootloaders. # Hide the OS choice for bootloaders.
# It's still possible to open the bootloader list by pressing any key # It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed # It will just not appear on screen unless a key is pressed
loader.timeout = lib.mkDefault 0; loader.timeout = lib.mkDefault 0;
}; };
# Set your time zone. # Set your time zone.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8"; LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8"; LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8"; LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8"; LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8"; LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8"; LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8"; LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8"; LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
systemd.sleep.extraConfig = '' systemd.sleep.extraConfig = ''
SuspendState=freeze SuspendState=freeze
HibernateDelaySec=2h HibernateDelaySec=2h
''; '';
system.stateVersion = "25.11"; # Did you read the comment? system.stateVersion = "25.11"; # Did you read the comment?
}; }
];
} }

View File

@@ -107,11 +107,6 @@ in
}; };
config = { config = {
# Enable forUser if specified
ugaif.users = lib.mkIf (config.ugaif.forUser != null) {
${config.ugaif.forUser}.enable = true;
};
# Generate NixOS users # Generate NixOS users
users.users = users.users =
let let