Kieran's opinionated (and probably slightly dumb) nix config
1 2# This is your system's configuration file. 3# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) 4{ 5 inputs, 6 lib, 7 config, 8 pkgs, 9 ... 10}: { 11 # You can import other NixOS modules here 12 imports = [ 13 # If you want to use modules from other flakes (such as nixos-hardware): 14 inputs.hardware.nixosModules.framework-11th-gen-intel 15 16 # Import your generated (nixos-generate-config) hardware configuration 17 ./hardware-configuration.nix 18 19 # Import home-manager's configuration 20 ./home-manager.nix 21 22 # Import disko's configuration 23 ./disk-config.nix 24 25 # hpyrland config 26 # ./hyprland 27 28 ./pam.nix 29 ]; 30 31 nixpkgs = { 32 # Configure your nixpkgs instance 33 config = { 34 # Disable if you don't want unfree packages 35 allowUnfree = true; 36 }; 37 }; 38 39 nix = let 40 flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; 41 in { 42 settings = { 43 # Enable flakes and new 'nix' command 44 experimental-features = "nix-command flakes"; 45 # Opinionated: disable global registry 46 flake-registry = ""; 47 # Workaround for https://github.com/NixOS/nix/issues/9574 48 nix-path = config.nix.nixPath; 49 }; 50 # Opinionated: disable channels 51 channel.enable = false; 52 53 # Opinionated: make flake registry and nix path match flake inputs 54 registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; 55 nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; 56 }; 57 58 time = { 59 timeZone = "America/New_York"; 60 hardwareClockInLocalTime = true; 61 }; 62 63 services.automatic-timezoned.enable = true; 64 65 environment.systemPackages = map lib.lowPrio [ 66 pkgs.curl 67 inputs.agenix.packages.x86_64-linux.default 68 pkgs.wpa_supplicant_gui 69 pkgs.alacritty 70 pkgs.zsh 71 pkgs.starship 72 pkgs.swww 73 pkgs.sunwait 74 pkgs.sunpaper 75 pkgs.wluma 76 pkgs.brightnessctl 77 inputs.hyprland-contrib.packages.${pkgs.system}.grimblast 78 pkgs.mako 79 pkgs.hyprpicker 80 pkgs.notify-desktop 81 pkgs.bc 82 pkgs.wl-clipboard 83 pkgs.psmisc 84 pkgs.jq 85 pkgs.playerctl 86 pkgs.firefox 87 pkgs.slack 88 pkgs.gnome.nautilus 89 pkgs.gnome.file-roller 90 pkgs.polkit_gnome 91 pkgs.fprintd 92 pkgs.gitMinimal 93 (pkgs.vscode-with-extensions.override { 94 vscodeExtensions = with pkgs.vscode-extensions; [ 95 bbenoist.nix 96 ]; 97 }) 98 pkgs.github-desktop 99 pkgs.udiskie 100 pkgs.neofetch 101 pkgs.cava 102 ]; 103 104 services.gnome.gnome-keyring.enable = true; 105 programs.dconf.enable = true; 106 107 systemd = { 108 user.services.polkit-gnome-authentication-agent-1 = { 109 description = "polkit-gnome-authentication-agent-1"; 110 wantedBy = [ "graphical-session.target" ]; 111 wants = [ "graphical-session.target" ]; 112 after = [ "graphical-session.target" ]; 113 serviceConfig = { 114 Type = "simple"; 115 ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; 116 Restart = "on-failure"; 117 RestartSec = 1; 118 TimeoutStopSec = 10; 119 }; 120 }; 121 }; 122 123 fonts.packages = with pkgs; [ 124 nerdfonts 125 fira 126 ]; 127 128 environment.sessionVariables = { 129 XDG_CACHE_HOME = "$HOME/.cache"; 130 XDG_CONFIG_HOME = "$HOME/.config"; 131 XDG_DATA_HOME = "$HOME/.local/share"; 132 SUNPAPERDIR = "${lib.getExe pkgs.sunpaper}"; 133 XDG_STATE_HOME = "$HOME/.local/state"; 134 NIXOS_OZONE_WL = "1"; 135 }; 136 137 # import the secret 138 age.identityPaths = [ "/home/kierank/.ssh/id_rsa" "/etc/ssh/id_rsa" "/mnt/etc/ssh/id_rsa" ]; 139 age.secrets.wifi = { 140 file = ../secrets/wifi.age; 141 owner = "kierank"; 142 }; 143 144 # setup the network 145 networking = { 146 hostName = "moonlark"; 147 wireless = { 148 environmentFile = config.age.secrets.wifi.path; 149 userControlled.enable = true; 150 enable = true; 151 networks = { 152 "KlukasNet".psk = "@PSK_HOME@"; 153 "Everseen".psk = "@PSK_HOTSPOT@"; 154 }; 155 }; 156 }; 157 158 programs.zsh.enable = true; 159 # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. 160 users.users = { 161 kierank = { 162 # You can skip setting a root password by passing '--no-root-passwd' to nixos-install. 163 # Be sure to change it (using passwd) after rebooting! 164 initialPassword = "lolzthisaintsecure!"; 165 isNormalUser = true; 166 shell = pkgs.zsh; 167 openssh.authorizedKeys.keys = [ 168 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzEEjvbL/ttqmYoDjxYQmDIq36BabROJoXgQKeh9liBxApwp+2PmgxROzTg42UrRc9pyrkq5kVfxG5hvkqCinhL1fMiowCSEs2L2/Cwi40g5ZU+QwdcwI8a4969kkI46PyB19RHkxg54OUORiIiso/WHGmqQsP+5wbV0+4riSnxwn/JXN4pmnE//stnyAyoiEZkPvBtwJjKb3Ni9n3eNLNs6gnaXrCtaygEZdebikr9kS2g9mM696HvIFgM6cdR/wZ7DcLbG3IdTXuHN7PC3xxL+Y4ek5iMreQIPmuvs4qslbthPGYoYbYLUQiRa9XO5s/ksIj5Z14f7anHE6cuTQVpvNWdGDOigyIVS5qU+4ZF7j+rifzOXVL48gmcAvw/uV68m5Wl/p0qsC/d8vI3GYwEsWG/EzpAlc07l8BU2LxWgN+d7uwBFaJV9VtmUDs5dcslsh8IbzmtC9gq3OLGjklxTfIl6qPiL8U33oc/UwqzvZUrI2BlbagvIZYy6rP+q0= kierank@mockingjay" 169 ]; 170 extraGroups = ["wheel" "networkmanager" "audio" "video" "docker" "plugdev" "input"]; 171 }; 172 root.openssh.authorizedKeys.keys = [ 173 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzEEjvbL/ttqmYoDjxYQmDIq36BabROJoXgQKeh9liBxApwp+2PmgxROzTg42UrRc9pyrkq5kVfxG5hvkqCinhL1fMiowCSEs2L2/Cwi40g5ZU+QwdcwI8a4969kkI46PyB19RHkxg54OUORiIiso/WHGmqQsP+5wbV0+4riSnxwn/JXN4pmnE//stnyAyoiEZkPvBtwJjKb3Ni9n3eNLNs6gnaXrCtaygEZdebikr9kS2g9mM696HvIFgM6cdR/wZ7DcLbG3IdTXuHN7PC3xxL+Y4ek5iMreQIPmuvs4qslbthPGYoYbYLUQiRa9XO5s/ksIj5Z14f7anHE6cuTQVpvNWdGDOigyIVS5qU+4ZF7j+rifzOXVL48gmcAvw/uV68m5Wl/p0qsC/d8vI3GYwEsWG/EzpAlc07l8BU2LxWgN+d7uwBFaJV9VtmUDs5dcslsh8IbzmtC9gq3OLGjklxTfIl6qPiL8U33oc/UwqzvZUrI2BlbagvIZYy6rP+q0= kierank@mockingjay" 174 ]; 175 }; 176 177 programs.hyprland.enable = true; 178 services.hypridle.enable = true; 179 180 # enable cups 181 services.printing.enable = true; 182 183 # enable bluetooth 184 hardware.bluetooth.enable = true; 185 186 # enable pipewire 187 # rtkit is optional but recommended 188 security.rtkit.enable = true; 189 services.pipewire = { 190 enable = true; 191 alsa.enable = true; 192 alsa.support32Bit = true; 193 pulse.enable = true; 194 # If you want to use JACK applications, uncomment this 195 jack.enable = true; 196 }; 197 198 # This setups a SSH server. Very important if you're setting up a headless system. 199 # Feel free to remove if you don't need it. 200 services.openssh = { 201 enable = true; 202 settings = { 203 # Opinionated: forbid root login through SSH. 204 PermitRootLogin = "no"; 205 # Opinionated: use keys only. 206 # Remove if you want to SSH using passwords 207 PasswordAuthentication = false; 208 }; 209 }; 210 211 services.devmon.enable = true; 212 services.gvfs.enable = true; 213 services.udisks2.enable = true; 214 215 # Requires at least 5.16 for working wi-fi and bluetooth. 216 # https://community.frame.work/t/using-the-ax210-with-linux-on-the-framework-laptop/1844/89 217 boot = { 218 kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") (lib.mkDefault pkgs.linuxPackages_latest); 219 loader.grub = { 220 # no need to set devices, disko will add all devices that have a EF02 partition to the list already 221 device = "nodev"; 222 efiSupport = true; 223 efiInstallAsRemovable = true; 224 }; 225 supportedFilesystems = [ "ntfs" ]; 226 }; 227 228 # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 229 system.stateVersion = "23.05"; 230}