Skip to content

Instantly share code, notes, and snippets.

@dragan
Last active August 3, 2026 04:28
Show Gist options
  • Select an option

  • Save dragan/d14211f173084a9a7dba17289af3aad4 to your computer and use it in GitHub Desktop.

Select an option

Save dragan/d14211f173084a9a7dba17289af3aad4 to your computer and use it in GitHub Desktop.
configuration.nix
{ config, pkgs, ... }:
{
networking.hostName = "darius";
networking.useDHCP = true;
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=8G" "mode=755" ];
};
fileSystems."/nix" = {
device = "/dev/encrypted/root";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" "ssd" ];
};
fileSystems."/persist" = {
device = "/dev/encrypted/root";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" "noatime" ];
neededForBoot = true;
};
fileSystems."/home" = {
device = "/dev/encrypted/home";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" "noatime" "ssd" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-partlabel/efi-system-partition";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/encrypted/swap"; }
];
boot.loader.grub = {
enable = true;
device = "/dev/nvme0n1";
efiSupport = true;
efiInstallAsRemovable = false;
useOSProber = false;
};
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usb_storage"
"sd_mod"
"sr_mod"
"virtio_blk"
"virtio_scsi"
"ahci"
];
boot.initrd.luks.devices."encrypted" = {
device = "/dev/disk/by-partlabel/internal";
preLVM = true;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
time.timeZone = "America/Los_Angeles";
i18n.defaultLocale = "en_US.UTF-8";
users.users.dragan = {
isNormalUser = true;
description = "Dragan";
extraGroups = [ "wheel" "networkmanager" ];
initialPassword = "temporary-password-change-after-first-boot";
};
security.sudo.wheelNeedsPassword = false;
environment.systemPackages = with pkgs; [
vim
wget
git
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment