users/ryan/linux/guix.nix
181f59e7219fa3cfed36c05773ac6a8dc40e5571
· 1.4 KB · 46 lines
raw
| 1 | { pkgs, lib, inputs, ... }: |
| 2 | |
| 3 | { |
| 4 | systemd.user.startServices = false; |
| 5 | |
| 6 | programs.zsh.profileExtra = '' |
| 7 | if [ -f "$HOME/.guix-home/setup-environment" ]; then |
| 8 | HOME_ENVIRONMENT="$HOME/.guix-home" |
| 9 | . "$HOME_ENVIRONMENT/setup-environment" |
| 10 | "$HOME_ENVIRONMENT/on-first-login" |
| 11 | unset HOME_ENVIRONMENT |
| 12 | fi |
| 13 | ''; |
| 14 | |
| 15 | dconf.enable = false; |
| 16 | |
| 17 | wayland.windowManager.hyprland.extraConfig = '' |
| 18 | exec-once = sh -c 'gpgconf --launch gpg-agent; hyprctl setenv SSH_AUTH_SOCK "$(gpgconf --list-dirs agent-ssh-socket)"' |
| 19 | ''; |
| 20 | |
| 21 | programs.gpg.scdaemonSettings.disable-ccid = true; |
| 22 | |
| 23 | home.packages = [ |
| 24 | (pkgs.writeScriptBin "hyprlock" '' |
| 25 | #! ${pkgs.bash}/bin/bash |
| 26 | export LD_PRELOAD="/run/current-system/profile/lib/libpam.so.0:$LD_PRELOAD" |
| 27 | exec ${pkgs.hyprlock}/bin/hyprlock "$@" |
| 28 | '') |
| 29 | |
| 30 | # Guix's mesa doesn't match nixpkgs', so GL apps built by nix need nixGL. |
| 31 | inputs.nixgl.packages.${pkgs.stdenv.hostPlatform.system}.nixGLIntel |
| 32 | ]; |
| 33 | |
| 34 | # We need to correct the ssh config file's permissions on guix |
| 35 | # Remove the symlink and just install the store file directly |
| 36 | home.activation = { |
| 37 | fixSshPermissions = lib.hm.dag.entryAfter [ "linkGeneration" ] '' |
| 38 | run install -d -m 0700 "$HOME/.ssh" |
| 39 | if [ -L "$HOME/.ssh/config" ]; then |
| 40 | src="$(readlink -f "$HOME/.ssh/config")" |
| 41 | run rm -f "$HOME/.ssh/config" |
| 42 | run install -m 0600 "$src" "$HOME/.ssh/config" |
| 43 | fi |
| 44 | ''; |
| 45 | }; |
| 46 | } |