My NixOS, nix-darwin, and home-manager configurations
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add slim

+255
+17
flake.nix
··· 101 101 ]; 102 102 } 103 103 ); 104 + slim = nixpkgs.lib.nixosSystem ( 105 + mkConfig { 106 + system = "x86_64-linux"; 107 + host = "slim"; 108 + inherit user; 109 + extraModules = [ 110 + (import ./setup/zfs_single_drive_with_swap.nix { 111 + device = "/dev/nvme0n1"; 112 + user = "zmitchell"; 113 + }) 114 + { 115 + networking.hostName = "slim"; 116 + networking.hostId = "30042069"; 117 + } 118 + ]; 119 + } 120 + ); 104 121 distant-lad = nixpkgs.lib.nixosSystem ( 105 122 mkConfig { 106 123 system = "x86_64-linux";
+81
homeConfigurations/slim.nix
··· 1 + {pkgs, lib, inputs, user, ...}: 2 + let 3 + shellAliases = import ./shell-aliases.nix; 4 + in 5 + { 6 + imports = [ 7 + ./common.nix 8 + ]; 9 + home.stateVersion = "24.11"; 10 + 11 + # Configure zsh so it's not terrible when we need to use it 12 + programs.zsh = { 13 + enable = true; 14 + autocd = true; 15 + autosuggestion.enable = true; 16 + enableCompletion = true; 17 + initExtra = '' 18 + export PATH="$HOME/bin:$PATH" 19 + export GIT_EDITOR="hx" 20 + 21 + function set-tab { 22 + wezterm cli set-tab-title "$1" 23 + } 24 + ''; 25 + inherit shellAliases; 26 + }; 27 + 28 + # Same for Bash 29 + programs.bash = { 30 + enable = true; 31 + enableCompletion = true; 32 + inherit shellAliases; 33 + initExtra = '' 34 + shopt -s autocd 35 + export PATH="$HOME/bin:$PATH" 36 + export GIT_EDITOR="hx" 37 + ''; 38 + }; 39 + 40 + programs.zoxide = { 41 + enableBashIntegration = true; 42 + enableZshIntegration = true; 43 + }; 44 + 45 + programs.starship = { 46 + enableBashIntegration = true; 47 + enableZshIntegration = true; 48 + }; 49 + 50 + programs.kitty = { 51 + enable = true; 52 + settings = { 53 + confirm_os_window_close = 0; 54 + enable_audio_bell = false; 55 + }; 56 + }; 57 + 58 + programs.ssh.matchBlocks = { 59 + chungus = { 60 + host = "chungus"; 61 + hostname = "10.0.0.234"; 62 + forwardAgent = true; 63 + user = user.username; 64 + }; 65 + chungus-ts = { 66 + host = "chungus-ts"; 67 + hostname = "chungus"; 68 + forwardAgent = true; 69 + user = user.username; 70 + }; 71 + smolboi = { 72 + host = "smolboi"; 73 + hostname = "10.0.0.166"; 74 + forwardAgent = true; 75 + user = user.username; 76 + }; 77 + }; 78 + 79 + } 80 + 81 +
+60
hosts/slim.nix
··· 1 + # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 + # and may be overwritten by future invocations. Please make changes 3 + # to /etc/nixos/configuration.nix instead. 4 + { config, lib, pkgs, modulesPath, ... }: 5 + let 6 + bootHelpers = pkgs.callPackage ../command_sets/boot.nix {}; 7 + in 8 + { 9 + imports = 10 + [ (modulesPath + "/installer/scan/not-detected.nix") 11 + ]; 12 + 13 + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; 14 + boot.initrd.kernelModules = [ ]; 15 + boot.kernelModules = [ "kvm-intel" ]; 16 + # Necessary for profiling 17 + boot.kernel.sysctl = { 18 + "perf_event_paranoid" = 1; 19 + "perf_event_mlock_kb" = 2048; 20 + }; 21 + 22 + # Extra boot settings 23 + boot.loader.timeout = 0; # we have scripts for booting 24 + 25 + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 26 + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 27 + 28 + # Enable hardware acceleration of various things 29 + hardware.graphics.extraPackages = with pkgs; [ 30 + intel-ocl 31 + intel-media-driver 32 + intel-vaapi-driver 33 + ]; 34 + 35 + environment.systemPackages = with pkgs; [ 36 + config.boot.kernelPackages.perf 37 + linuxHeaders 38 + unstable.bpftrace 39 + fwupd 40 + discord 41 + _1password-gui 42 + ] ++ [ 43 + bootHelpers 44 + ]; 45 + services.fwupd.enable = true; 46 + 47 + environment.localBinInPath = true; 48 + 49 + # Otherwise it often fails during switch 50 + systemd.services.NetworkManager-wait-online.enable = false; 51 + 52 + # Custom modules 53 + generic_desktop = { 54 + enable = true; 55 + }; 56 + gnome.enable = true; 57 + populate_authorized_keys.enable = true; 58 + nix_community_cachix.enable = true; 59 + 60 + }
+97
setup/zfs_single_drive_with_swap.nix
··· 1 + 2 + { 3 + device, 4 + user, 5 + }: 6 + {...}: 7 + { 8 + disko.devices = { 9 + disk.main = { 10 + type = "disk"; 11 + device = device; 12 + content = { 13 + type = "gpt"; 14 + partitions = { 15 + ESP = { 16 + size = "1G"; 17 + type = "EF00"; 18 + content = { 19 + type = "filesystem"; 20 + format = "vfat"; 21 + mountpoint = "/boot"; 22 + }; 23 + }; 24 + swap = { 25 + size = "16G"; 26 + content = { 27 + type = "swap"; 28 + discardPolicy = "both"; 29 + resumeDevice = true; # resume from hiberation from this device 30 + }; 31 + }; 32 + zfs = { 33 + size = "100%"; 34 + content = { 35 + type = "zfs"; 36 + pool = "zroot"; 37 + }; 38 + }; 39 + }; 40 + }; 41 + }; 42 + zpool = { 43 + zroot = { 44 + type = "zpool"; 45 + mountpoint = "/"; 46 + # Create a snapshot of the root filesystem as soon as it's created. 47 + postCreateHook = "zfs snapshot zroot@blank"; 48 + rootFsOptions = { 49 + # Enable additional access control features as they're intended to be used 50 + # in ZFS. 51 + acltype = "posixacl"; 52 + xattr = "sa"; 53 + # Enable compression by default. 54 + compression = "zstd"; 55 + # Don't allow the pool itself to be mounted 56 + canmount = "off"; 57 + }; 58 + datasets = { 59 + "local/nix" = { 60 + type = "zfs_fs"; 61 + mountpoint = "/nix"; 62 + options = { 63 + # Disable atime updates to reduce IO. 64 + atime = "off"; 65 + # NixOS requires mountpoint=legacy for all datasets 66 + mountpoint = "legacy"; 67 + }; 68 + }; 69 + "system/var" = { 70 + type = "zfs_fs"; 71 + mountpoint = "/var"; 72 + options = { 73 + # NixOS requires mountpoint=legacy for all datasets 74 + mountpoint = "legacy"; 75 + }; 76 + }; 77 + "system/root" = { 78 + type = "zfs_fs"; 79 + mountpoint = "/"; 80 + options = { 81 + # NixOS requires mountpoint=legacy for all datasets 82 + mountpoint = "legacy"; 83 + }; 84 + }; 85 + user = { 86 + type = "zfs_fs"; 87 + mountpoint = "/home/${user}"; 88 + options = { 89 + # NixOS requires mountpoint=legacy for all datasets 90 + mountpoint = "legacy"; 91 + }; 92 + }; 93 + }; 94 + }; 95 + }; 96 + }; 97 + }