Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

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

Lot's of changes to get set up

+38 -426
-6
boot.nix
··· 1 - { ... }: 2 - { 3 - # Use the systemd-boot EFI boot loader. 4 - boot.loader.systemd-boot.enable = true; 5 - boot.loader.efi.canTouchEfiVariables = true; 6 - }
-68
configuration.nix
··· 1 - # Edit this configuration file to define what should be installed on 2 - ## your system. Help is available in the configuration.nix(5) man page, on 3 - # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 - 5 - { ... }: 6 - 7 - { 8 - imports = 9 - [ 10 - # Include the results of the hardware scan. 11 - ./hardware-configuration.nix 12 - ./boot.nix 13 - ./networking.nix 14 - ./gui.nix 15 - ./users.nix 16 - ./packages.nix 17 - ./services.nix 18 - ]; 19 - 20 - # Set your time zone. 21 - time.timeZone = "America/Chicago"; 22 - 23 - # Select internationalisation properties. 24 - i18n.defaultLocale = "en_US.UTF-8"; 25 - # console = { 26 - # font = "Lat2-Terminus16"; 27 - # keyMap = "us"; 28 - # useXkbConfig = true; # use xkb.options in tty. 29 - # }; 30 - 31 - # Copy the NixOS configuration file and link it from the resulting system 32 - # (/run/current-system/configuration.nix). This is useful in case you 33 - # accidentally delete configuration.nix. 34 - system.copySystemConfiguration = true; 35 - 36 - # Automatic doc cache generation 37 - documentation.man.generateCaches = true; 38 - 39 - # Automatic system upgrades 40 - system.autoUpgrade = { 41 - enable = true; 42 - dates = "09:00"; 43 - randomizedDelaySec = "45min"; 44 - }; 45 - 46 - # Automatic Garbage Collection 47 - nix.gc.automatic = true; 48 - nix.gc.options = "--delete-older-than 8d"; 49 - 50 - # This option defines the first version of NixOS you have installed on this particular machine, 51 - # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. 52 - # 53 - # Most users should NEVER change this value after the initial install, for any reason, 54 - # even if you've upgraded your system to a new NixOS release. 55 - # 56 - # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, 57 - # so changing it will NOT upgrade your system. 58 - # 59 - # This value being lower than the current NixOS release does NOT mean your system is 60 - # out of date, out of support, or vulnerable. 61 - # 62 - # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, 63 - # and migrated your data accordingly. 64 - # 65 - # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . 66 - system.stateVersion = "23.11"; # Did you read the comment? 67 - 68 - }
-15
default.nix
··· 1 - let 2 - nix-pre-commit-hooks = import (builtins.fetchTarball "https://github.com/cachix/pre-commit-hooks.nix/tarball/master"); 3 - in 4 - { 5 - # Configured with the module options defined in `modules/pre-commit.nix`: 6 - pre-commit-check = nix-pre-commit-hooks.run { 7 - src = ./.; 8 - # If your hooks are intrusive, avoid running on each commit with a default_states like this: 9 - # default_stages = ["manual" "push"]; 10 - hooks = { 11 - nixpkgs-fmt.enable = true; 12 - nil.enable = true; 13 - }; 14 - }; 15 - }
+5 -5
fish/config.fish
··· 17 17 abbr gd "git diff" 18 18 abbr ga "git add" 19 19 abbr glog "git log –graph –decorate –oneline –all" 20 - if type -q "emanote" 21 - abbr n "cd ~/repos/notes" 22 - abbr ne "cd ~/repos/notes; nvim" 23 - end 24 20 25 21 abbr srhtclone "git clone git@git.sr.ht:~chiefnoah/" 26 22 abbr ghclone "git clone git@github.com:chiefnoah/" 27 23 28 - if test -d "~/repos" 24 + if test -d "$HOME/repos" 29 25 alias r "cd ~/repos" 26 + end 27 + 28 + if test -d "$HOME/repos/ambient" 29 + alias amb "cd ~/repos/ambient" 30 30 end 31 31 32 32 # PATH stuff
+3 -2
ghostty/config
··· 1 - font-size = 13 2 - font-family = TX-02 1 + #font-size = 13 2 + font-family = TX-02 Retina 3 3 theme = catppuccin-macchiato 4 4 shell-integration = fish 5 + link-url = true 5 6 6 7 #window-decoration = true 7 8
-104
gui.nix
··· 1 - { pkgs, ... }: 2 - let 3 - unstable = import <nixos-unstable> { }; 4 - in 5 - { 6 - # Enable the X11 windowing system. 7 - services.xserver = { 8 - enable = true; 9 - videoDrivers = [ "amdgpu" ]; 10 - }; 11 - 12 - # Fix for HIP libraries 13 - systemd.tmpfiles.rules = [ 14 - "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" 15 - ]; 16 - 17 - # Configure keymap in X11 18 - # services.xserver.xkb.layout = "us"; 19 - # services.xserver.xkb.options = "eurosign:e,caps:escape"; 20 - 21 - # Enable CUPS to print documents. 22 - # services.printing.enable = true; 23 - 24 - # Enable sound. 25 - security.rtkit.enable = true; 26 - services.pipewire = { 27 - enable = true; 28 - alsa.enable = true; 29 - alsa.support32Bit = true; 30 - pulse.enable = true; 31 - wireplumber.enable = true; 32 - }; 33 - 34 - # Graphics and parallel compute configuration 35 - hardware.graphics = { 36 - enable = true; 37 - extraPackages = with pkgs; [ 38 - amdvlk 39 - libva 40 - mesa.drivers 41 - rocmPackages.clr.icd 42 - ]; 43 - }; 44 - 45 - 46 - # Enable touchpad support (enabled default in most desktopManager). 47 - # services.xserver.libinput.enable = true; 48 - 49 - # Fonts 50 - fonts.packages = with pkgs; [ 51 - fira-code 52 - fira-code-symbols 53 - noto-fonts 54 - noto-fonts-cjk-sans 55 - noto-fonts-emoji 56 - noto-fonts-extra 57 - (nerdfonts.override { fonts = [ "FiraCode" ]; }) 58 - ]; 59 - 60 - # Polkit is a dependency of Sway. It's responsible for handling security policies 61 - security.polkit.enable = true; 62 - 63 - # Enable the sway window manager 64 - programs.sway = { 65 - enable = true; 66 - #package = unstable.sway; 67 - wrapperFeatures.gtk = true; 68 - }; 69 - # Use greetd as the displaymanager 70 - #services.xserver.displayManager.greetd.enable = true; 71 - #services.xserver.displayManager.lightdm.enable = false; 72 - services.displayManager.sddm.enable = true; 73 - services.displayManager.defaultSession = "sway"; 74 - services.displayManager.autoLogin = { 75 - enable = true; 76 - user = "noah"; 77 - }; 78 - 79 - # i3, for when I need XOrg 80 - services.xserver.windowManager.i3 = { 81 - enable = true; 82 - extraPackages = with pkgs; [ 83 - dmenu 84 - i3status 85 - i3lock 86 - i3blocks 87 - ]; 88 - }; 89 - 90 - xdg.portal = { 91 - enable = true; 92 - wlr.enable = true; 93 - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 94 - }; 95 - xdg.mime = { 96 - enable = true; 97 - defaultApplications = { 98 - "x-scheme-handler/http" = "org.firefox.firefox.desktop"; 99 - "x-scheme-handler/https" = "org.firefox.firefox.desktop"; 100 - }; 101 - }; 102 - services.dbus.enable = true; 103 - services.gnome.gnome-keyring.enable = true; 104 - }
+30 -21
noah-home.nix
··· 1 - { pkgs, unstable, lib, ... }: 1 + { pkgs, unstable, ... }: 2 2 { 3 3 # Home Manager needs a bit of information about you and the paths it should 4 4 # manage. ··· 10 10 home.packages = with pkgs; [ 11 11 # main tool 12 12 direnv 13 - fish 13 + #fish 14 14 tree 15 15 btop 16 + # Apple Silicon top monitoring 17 + asitop 16 18 htop 17 19 mtr 18 20 moreutils ··· 39 41 unstable.catgirl 40 42 devenv 41 43 plan9port 44 + unstable.glow 42 45 unstable.vis 46 + # Tcl/Tk 43 47 unstable.tcl 44 48 unstable.tk 45 49 unstable.tclPackages.tclx 50 + 46 51 47 52 # Dev tools 48 53 git 54 + #unstable.rustup 55 + unstable.rustc 56 + unstable.rust-analyzer 57 + unstable.cargo 58 + unstable.rustPlatform.rustcSrc 49 59 unstable.gcc 50 60 #unstable.clang 51 - go 52 - gopls 61 + unstable.go 62 + unstable.gopls 53 63 gnumake 54 - babashka 64 + unstable.babashka 55 65 ccls 56 66 unstable.clojure 57 67 unstable.cljfmt ··· 66 76 nodejs 67 77 node2nix 68 78 opam 69 - unstable.rustup # includes rust-analyzer 70 79 # Scala stuff 71 80 scala_3 72 81 scalafmt ··· 82 91 luajit 83 92 lua-language-server 84 93 luaformatter 85 - #leiningen 86 94 libressl 87 95 # Erlang 88 96 erlang ··· 96 104 yaml-language-server 97 105 mkcert 98 106 natscli 99 - python3 100 - python311Packages.pip 101 - uv 107 + python312Full 108 + python312Packages.psycopg 109 + unstable.uv 102 110 sqlite 103 111 unstable.gleam 104 112 unstable.rebar3 105 - #unstable.flyctl 113 + unstable.flyctl 106 114 unstable.bun 107 115 unstable.gh 108 116 unstable.kraft ··· 123 131 step-cli 124 132 125 133 # Fish Plugins 126 - fishPlugins.fzf 127 - fishPlugins.pure 134 + #fishPlugins.fzf 135 + #fishPlugins.pure 128 136 129 137 # Libraries because MacOS is kinda stupid 130 - libiconv 131 138 ncurses 132 139 # Unfree 133 140 #unstable.discord ··· 138 145 settings.experimental-features = [ "nix-command" "flakes" ]; 139 146 }; 140 147 141 - programs.fish = { 142 - enable = true; 143 - package = unstable.fish; 144 - }; 148 + #programs.fish = { 149 + # enable = true; 150 + # package = unstable.fish; 151 + #}; 145 152 programs.fzf = { 146 153 enable = true; 147 154 enableFishIntegration = true; ··· 173 180 pull = { 174 181 rebase = true; 175 182 }; 183 + push = { 184 + autoSetupRemote = true; 185 + }; 176 186 credential = { 177 187 helper = "cache"; 178 188 }; ··· 189 199 programs.aerc = { 190 200 enable = true; 191 201 }; 192 - 193 202 programs.ssh = { 194 203 enable = true; 195 204 extraConfig = builtins.readFile ./ssh/extra; 205 + addKeysToAgent = "yes"; 196 206 }; 197 207 198 - #services.ssh-agent.enable = true; 199 - 200 208 programs.direnv = { 201 209 enable = true; 202 210 nix-direnv.enable = true; ··· 217 225 source = ./fish; 218 226 recursive = true; 219 227 }; 228 + xdg.configFile."fish/completions/nix.fish".source = "${pkgs.nix}/share/fish/vendor_completions.d/nix.fish"; 220 229 221 230 xdg.configFile.aerc = { 222 231 source = ./aerc;
-115
packages.nix
··· 1 - { pkgs, lib, ... }: 2 - let # bash script to let dbus know about important env variables and 3 - # propagate them to relevent services run at the end of sway config 4 - # see 5 - # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist 6 - # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts 7 - # some user services to make sure they have the correct environment variables 8 - dbus-sway-environment = pkgs.writeTextFile { 9 - name = "dbus-sway-environment"; 10 - destination = "/bin/dbus-sway-environment"; 11 - executable = true; 12 - 13 - text = '' 14 - dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway 15 - systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr 16 - systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr 17 - ''; 18 - }; 19 - 20 - # currently, there is some friction between sway and gtk: 21 - # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland 22 - # the suggested way to set gtk settings is with gsettings 23 - # for gsettings to work, we need to tell it where the schemas are 24 - # using the XDG_DATA_DIR environment variable 25 - # run at the end of sway config 26 - configure-gtk = pkgs.writeTextFile { 27 - name = "configure-gtk"; 28 - destination = "/bin/configure-gtk"; 29 - executable = true; 30 - text = 31 - let 32 - # TODO: figure out why these bindings exist or where they're used 33 - schema = pkgs.gsettings-desktop-schemas; 34 - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; 35 - in 36 - '' 37 - 6 gnome_schema=org.gnome.desktop.interface 38 - gsettings set $gnome_schema gtk-theme 'Dracula' 39 - ''; 40 - }; 41 - in 42 - { 43 - 44 - # List packages installed in system profile. To search, run: 45 - # $ nix search wget 46 - environment.systemPackages = with pkgs; [ 47 - neovim 48 - appimage-run 49 - wget 50 - kitty 51 - file 52 - w3m 53 - fishPlugins.fzf-fish 54 - fzf 55 - qemu 56 - OVMF 57 - #9p stuff 58 - diod 59 - plan9port 60 - vis 61 - rc 62 - 63 - # Sway stuff 64 - wdisplays 65 - mako 66 - bemenu 67 - wl-clipboard 68 - slurp 69 - grim 70 - swayidle 71 - swaylock 72 - adwaita-icon-theme 73 - dracula-theme 74 - glib 75 - xdg-utils 76 - wayland 77 - configure-gtk 78 - dbus-sway-environment 79 - dbus 80 - pkg-config 81 - zlib 82 - # why wouldn't I want documentation on my system 83 - man-pages 84 - man-pages-posix 85 - ]; 86 - documentation.dev.enable = true; 87 - 88 - # Fix dynamically linked libraries for unpackaged binaries 89 - programs.nix-ld = { 90 - enable = true; 91 - libraries = with pkgs; [ 92 - # Add missing dynamic libraries for unpackaged programs HERE 93 - # NOT in environment.systemPackages 94 - zlib 95 - openssl 96 - sqlite 97 - libunwind 98 - libglvnd 99 - ]; 100 - }; 101 - 102 - 103 - # Logseq uses an ancient version of Electron, so we enable that 104 - nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ]; 105 - 106 - # Whitelist some unfree packages 107 - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ 108 - "discord" 109 - "spotify" 110 - "obsidian" 111 - "unstable.obsidian" 112 - "tailscale" 113 - "google-chrome" 114 - ]; 115 - }
-39
services.nix
··· 1 - { ... }: 2 - { 3 - # Some programs need SUID wrappers, can be configured further or are 4 - # started in user sessions. 5 - # programs.mtr.enable = true; 6 - programs.gnupg.agent = { 7 - enable = true; 8 - enableSSHSupport = true; 9 - }; 10 - 11 - # Fish shell, the best 12 - programs.fish.enable = true; 13 - 14 - # List services that you want to enable: 15 - 16 - # Enable the OpenSSH daemon. 17 - services.openssh.enable = true; 18 - 19 - # Smart Card daemon 20 - services.pcscd.enable = true; 21 - 22 - # This option is for enabling the bolt daemon for managing Thunderbolt/USB4 Devices. 23 - services.hardware.bolt.enable = true; 24 - 25 - # Tailscale 26 - services.tailscale = { 27 - enable = true; 28 - useRoutingFeatures = "client"; 29 - }; 30 - 31 - # Containers and VMs 32 - virtualisation = { 33 - podman = { 34 - enable = true; 35 - dockerCompat = true; 36 - defaultNetwork.settings.dns_enabled = true; 37 - }; 38 - }; 39 - }
-7
shell.nix
··· 1 - { pkgs ? import <nixos-unstable> { } }: 2 - pkgs.mkShell { 3 - packages = with pkgs; [ nil lua-language-server nixpkgs-fmt ]; 4 - shellHook = '' 5 - ${(import ./default.nix).pre-commit-check.shellHook} 6 - ''; 7 - }
-2
ssh/extra
··· 1 - AddKeysToAgent yes 2 1 ServerAliveInterval 60 3 - ForwardAgent no 4 2 ControlMaster auto 5 3 ControlPath ~/.ssh/master-%r@%h:%p 6 4
-42
users.nix
··· 1 - { pkgs, ... }: 2 - let 3 - home-manager = builtins.fetchTarball 4 - "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz"; 5 - in 6 - { 7 - 8 - imports = [ 9 - # Import home-manager first, it's required for other modules 10 - (import "${home-manager}/nixos") 11 - ]; 12 - 13 - # Declarative only optoins. 14 - # I don't want to allow ad-hoc modifying users on the system. 15 - # Users must be declared either as part of a package or in this file. 16 - users.mutableUsers = false; 17 - 18 - 19 - # Define a user account. Don't forget to set a password with ‘passwd’. 20 - users.users.noah = { 21 - isNormalUser = true; 22 - shell = pkgs.fish; 23 - extraGroups = [ "wheel" "video" "nas" "libvirtd" "qemu-libvirtd" ]; # Enable ‘sudo’ for the user. 24 - hashedPasswordFile = "/etc/nixos/noah-password"; 25 - openssh.authorizedKeys.keys = [ 26 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC/cXL1cV6QUW5z2bJp1mCu0CXrcc0Dntdxaeo3fg60N noah@odin" 27 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJeSPXmzD0rXKNjR1q+qSJqXjO0gxLitTRD+m02v94p6 noah@aleister" 28 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDQFlX3hhXxsqAUYLvF+IX1YWQ+k22OHlqMOjgyNBe9e noah@misaki" 29 - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMFOUuNyxdcMRmDiqQMxNZX1CFiJye5JbHIJ95fXd5dC noah@nixos-wsl" 30 - ]; 31 - }; 32 - 33 - users.groups.nas.gid = 1001; 34 - 35 - # I manage my home with home-manager 36 - # Don't store packages in ~/.nix-profile, use /etc/profiles so we can build-vm 37 - home-manager.useUserPackages = true; 38 - # No more NIX_PATH, use system pkgs 39 - home-manager.useGlobalPkgs = true; 40 - 41 - home-manager.users.noah = import ./noah-home.nix; 42 - }