users/ryan/linux.nix
1e8ce6189d196b8d75f9c15bec198ef4fa7a339b
· 5.2 KB · 162 lines
raw
| 1 | { config, pkgs, lib, inputs, ... }: |
| 2 | |
| 3 | { |
| 4 | imports = [ |
| 5 | ./linux/firefox-nightly |
| 6 | ]; |
| 7 | |
| 8 | home.username = "ryan"; |
| 9 | home.homeDirectory = "/home/ryan"; |
| 10 | home.stateVersion = "23.11"; # Please read the comment before changing. |
| 11 | |
| 12 | nixpkgs.config.allowUnfree = true; |
| 13 | |
| 14 | programs.zsh.shellAliases = { |
| 15 | ls = "ls -p --color=auto"; |
| 16 | spt = "spotify_player"; |
| 17 | python = "python3"; |
| 18 | }; |
| 19 | |
| 20 | # `nix shell nixpkgs#...`/`nix run nixpkgs#...` etc. resolve `nixpkgs` to |
| 21 | # this flake's own pinned input instead of fetching latest nixpkgs-unstable. |
| 22 | # This is the standalone-HM equivalent of RyanMac's /etc/nix/flake-registry.json. |
| 23 | # HM owns the whole ~/.config/nix directory (including nix.conf) so this |
| 24 | # doesn't end up writing through guix-dotfiles' `nix-config` symlink - see |
| 25 | # MIGRATION.md. |
| 26 | xdg.configFile."nix/nix.conf".text = "experimental-features = nix-command flakes\n"; |
| 27 | xdg.configFile."nix/registry.json".text = builtins.toJSON { |
| 28 | version = 2; |
| 29 | flakes = [ |
| 30 | { |
| 31 | from = { type = "indirect"; id = "nixpkgs"; }; |
| 32 | to = { |
| 33 | type = "path"; |
| 34 | path = inputs.nixpkgs.outPath; |
| 35 | lastModified = inputs.nixpkgs.lastModified; |
| 36 | narHash = inputs.nixpkgs.narHash; |
| 37 | }; |
| 38 | } |
| 39 | ]; |
| 40 | }; |
| 41 | |
| 42 | # Non-NixOS (Guix), so HM has to write its own fontconfig instead of |
| 43 | # relying on a system module. |
| 44 | fonts.fontconfig.enable = true; |
| 45 | fonts.fontconfig.defaultFonts = { |
| 46 | monospace = [ "DejaVu Sans Mono" ]; |
| 47 | sansSerif = [ "DejaVu Sans" ]; |
| 48 | serif = [ "DejaVu Serif" ]; |
| 49 | }; |
| 50 | |
| 51 | # Cursor theme. Replaces the previously hand-vendored Bibata asset (which |
| 52 | # embedded oddly-versioned theme names) with nixpkgs' own build - see the |
| 53 | # comment in linux/hypr/hyprland.conf for the corresponding env var change. |
| 54 | home.pointerCursor = { |
| 55 | enable = true; |
| 56 | package = pkgs.bibata-cursors; |
| 57 | name = "Bibata-Modern-Classic"; |
| 58 | size = 24; |
| 59 | gtk.enable = true; |
| 60 | x11.enable = true; |
| 61 | }; |
| 62 | |
| 63 | # gpg-agent itself is enabled in common.nix; nixpkgs' pinentry here instead |
| 64 | # of depending on Guix's system profile path. |
| 65 | services.gpg-agent.pinentry.package = pkgs.pinentry-qt; |
| 66 | |
| 67 | wayland.windowManager.hyprland = { |
| 68 | enable = true; |
| 69 | package = pkgs.hyprland; |
| 70 | portalPackage = pkgs.xdg-desktop-portal-hyprland; |
| 71 | extraConfig = builtins.readFile ./linux/hypr/hyprland.conf; |
| 72 | }; |
| 73 | |
| 74 | xdg.configFile = { |
| 75 | "hypr/monitors.conf".source = ./linux/hypr/monitors.conf; |
| 76 | "hypr/kanshi.conf".source = ./linux/hypr/kanshi.conf; |
| 77 | "hypr/pyprland.toml".source = ./linux/hypr/pyprland.toml; |
| 78 | "hypr/hypridle.conf".source = ./linux/hypr/hypridle.conf; |
| 79 | "hypr/hyprlock.conf".source = ./linux/hypr/hyprlock.conf; |
| 80 | "hypr/scripts" = { source = ./linux/hypr/scripts; recursive = true; }; |
| 81 | "hypr/family_guy.mp4".source = ./linux/hypr/family_guy.mp4; |
| 82 | "hypr/subwaysurfer.webm".source = ./linux/hypr/subwaysurfer.webm; |
| 83 | |
| 84 | "waybar" = { source = ./linux/waybar; recursive = true; }; |
| 85 | "alacritty" = { source = ./linux/alacritty; recursive = true; }; |
| 86 | "foot" = { source = ./linux/foot; recursive = true; }; |
| 87 | "wpaperd" = { source = ./linux/wpaperd; recursive = true; }; |
| 88 | "mpv" = { source = ./linux/mpv; recursive = true; }; |
| 89 | |
| 90 | "pulse/client.conf".source = ./linux/pulseaudio/client.conf; |
| 91 | "spotify-player/app.toml".source = ./linux/spotify-player/app.toml; |
| 92 | }; |
| 93 | |
| 94 | home.file = { |
| 95 | ".local/share/mailvelope" = { source = ./linux/mailvelope; recursive = true; }; |
| 96 | ".local/share/tridactyl" = { source = ./linux/tridactyl; recursive = true; }; |
| 97 | ".mozilla/native-messaging-hosts/tridactyl.json".source = ./linux/tridactyl/tridactyl.json; |
| 98 | }; |
| 99 | |
| 100 | home.packages = with pkgs; [ |
| 101 | rustup |
| 102 | zoxide |
| 103 | pnpm |
| 104 | gcc |
| 105 | pkg-config |
| 106 | wttrbar |
| 107 | wl-clip-persist |
| 108 | gifski |
| 109 | waypaper |
| 110 | spotify-player |
| 111 | xwayland |
| 112 | xdg-desktop-portal |
| 113 | xdg-desktop-portal-gtk |
| 114 | mpv |
| 115 | imv |
| 116 | libva |
| 117 | libvdpau |
| 118 | hypridle |
| 119 | hyprpicker |
| 120 | wpaperd |
| 121 | wl-mirror |
| 122 | pyprland |
| 123 | satty |
| 124 | fluxcd |
| 125 | sops |
| 126 | restic |
| 127 | kdePackages.kdenlive |
| 128 | bluetui |
| 129 | supercell-wx |
| 130 | chromium |
| 131 | |
| 132 | # foot is Guix system-packaged and is the terminal actually wired into |
| 133 | # the WM; alacritty's config was carried over from guix-dotfiles but |
| 134 | # nothing provided its binary there either - see MIGRATION.md. |
| 135 | alacritty |
| 136 | |
| 137 | # Nerd Fonts, replacing the hand-vendored ttf files that used to live in |
| 138 | # guix-dotfiles/home-config/fonts (Fira Code and "Monofur For Powerline" |
| 139 | # dropped - superseded by these, unreferenced anywhere) |
| 140 | nerd-fonts.anonymice |
| 141 | nerd-fonts.monofur |
| 142 | nerd-fonts.lilex |
| 143 | nerd-fonts.fira-code |
| 144 | noto-fonts |
| 145 | dejavu_fonts |
| 146 | liberation_ttf |
| 147 | noto-fonts-cjk-sans |
| 148 | noto-fonts-color-emoji |
| 149 | |
| 150 | # hyprlock built by nix needs Guix's PAM/fontconfig libs preloaded to run |
| 151 | # under the Guix system profile - same interop hack as before. |
| 152 | (pkgs.writeScriptBin "hyprlock" '' |
| 153 | #! ${pkgs.bash}/bin/bash |
| 154 | export LD_PRELOAD="/run/current-system/profile/lib/libpam.so.0:/run/current-system/profile/lib/libfontconfig.so:$LD_PRELOAD" |
| 155 | exec ${pkgs.hyprlock}/bin/hyprlock "$@" |
| 156 | '') |
| 157 | |
| 158 | # Guix's mesa doesn't match nixpkgs', so GL apps built by nix need nixGL. |
| 159 | inputs.nixgl.packages.${pkgs.system}.nixGLIntel |
| 160 | inputs.clipboard-sync.packages.${pkgs.system}.default |
| 161 | ]; |
| 162 | } |