From a23b01c8bc0b29c89f31cde3684bd1b0b5f7ebdf Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 9 May 2022 16:37:01 +0200 Subject: refactor(tazjin/home): Extract home manager configuration Change-Id: If12aca275029d2567fa420d762418ccd9e5ffcba Reviewed-on: https://cl.tvl.fyi/c/depot/+/5550 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: tazjin --- users/tazjin/home/tverskoy.nix | 90 +++++++++++++++++++++++++++++++++ users/tazjin/nixos/tverskoy/default.nix | 86 +------------------------------ 2 files changed, 91 insertions(+), 85 deletions(-) create mode 100644 users/tazjin/home/tverskoy.nix diff --git a/users/tazjin/home/tverskoy.nix b/users/tazjin/home/tverskoy.nix new file mode 100644 index 000000000000..8928dc76888f --- /dev/null +++ b/users/tazjin/home/tverskoy.nix @@ -0,0 +1,90 @@ +# Home manage configuration for tverskoy. + +{ depot, pkgs, ... }: # readTree +{ config, lib, ... }: # home-manager + +{ + imports = [ "${depot.third_party.impermanence}/home-manager.nix" ]; + + home.persistence."/persist/tazjin/home" = { + allowOther = true; + + directories = [ + ".cargo" + ".config/audacity" + ".config/google-chrome" + ".config/quassel-irc.org" + ".config/spotify" + ".config/syncthing" + ".config/unity3d" + ".electrum" + ".elfeed" + ".gnupg" + ".local/share/Steam" + ".local/share/audacity" + ".local/share/direnv" + ".local/share/fish" + ".local/share/keyrings" + ".local/share/zoxide" + ".mozilla/firefox" + ".password-store" + ".rustup" + ".ssh" + ".steam" + ".telega" + "go" + "mail" + ]; + + files = [ + ".notmuch-config" + ]; + }; + + home.activation.screenshots = lib.hm.dag.entryAnywhere '' + $DRY_RUN_CMD mkdir -p $HOME/screenshots + ''; + + programs.git = { + enable = true; + userName = "Vincent Ambo"; + userEmail = "mail@tazj.in"; + extraConfig = { + pull.rebase = true; + init.defaultBranch = "canon"; + }; + }; + + programs.fish = { + enable = true; + interactiveShellInit = '' + ${pkgs.zoxide}/bin/zoxide init fish | source + ''; + }; + + services.screen-locker = { + enable = true; + enableDetectSleep = true; + inactiveInterval = 10; # minutes + lockCmd = "${depot.users.tazjin.screenLock}/bin/tazjin-screen-lock"; + }; + + services.picom = { + enable = true; + vSync = true; + backend = "glx"; + }; + + # Enable the dunst notification daemon, but force the + # configuration file separately instead of going via the strange + # Nix->dunstrc encoding route. + services.dunst.enable = true; + xdg.configFile."dunst/dunstrc" = { + source = depot.users.tazjin.dotfiles.dunstrc; + onChange = '' + ${pkgs.procps}/bin/pkill -u "$USER" ''${VERBOSE+-e} dunst || true + ''; + }; + + systemd.user.startServices = true; +} diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix index e674b27730b0..7c3f91ff4d8a 100644 --- a/users/tazjin/nixos/tverskoy/default.nix +++ b/users/tazjin/nixos/tverskoy/default.nix @@ -236,91 +236,7 @@ lib.fix (self: { }; home-manager.useGlobalPkgs = true; - home-manager.users.tazjin = { config, lib, ... }: { - imports = [ "${depot.third_party.impermanence}/home-manager.nix" ]; - - home.persistence."/persist/tazjin/home" = { - allowOther = true; - - directories = [ - ".cargo" - ".config/audacity" - ".config/google-chrome" - ".config/quassel-irc.org" - ".config/spotify" - ".config/syncthing" - ".config/unity3d" - ".electrum" - ".elfeed" - ".gnupg" - ".local/share/Steam" - ".local/share/audacity" - ".local/share/direnv" - ".local/share/fish" - ".local/share/keyrings" - ".local/share/zoxide" - ".mozilla/firefox" - ".password-store" - ".rustup" - ".ssh" - ".steam" - ".telega" - "go" - "mail" - ]; - - files = [ - ".notmuch-config" - ]; - }; - - home.activation.screenshots = lib.hm.dag.entryAnywhere '' - $DRY_RUN_CMD mkdir -p $HOME/screenshots - ''; - - programs.git = { - enable = true; - userName = "Vincent Ambo"; - userEmail = "mail@tazj.in"; - extraConfig = { - pull.rebase = true; - init.defaultBranch = "canon"; - }; - }; - - programs.fish = { - enable = true; - interactiveShellInit = '' - ${pkgs.zoxide}/bin/zoxide init fish | source - ''; - }; - - services.screen-locker = { - enable = true; - enableDetectSleep = true; - inactiveInterval = 10; # minutes - lockCmd = "${depot.users.tazjin.screenLock}/bin/tazjin-screen-lock"; - }; - - services.picom = { - enable = true; - vSync = true; - backend = "glx"; - }; - - # Enable the dunst notification daemon, but force the - # configuration file separately instead of going via the strange - # Nix->dunstrc encoding route. - services.dunst.enable = true; - xdg.configFile."dunst/dunstrc" = { - source = depot.users.tazjin.dotfiles.dunstrc; - onChange = '' - ${pkgs.procps}/bin/pkill -u "$USER" ''${VERBOSE+-e} dunst || true - ''; - }; - - systemd.user.startServices = true; - }; + home-manager.users.tazjin = depot.users.tazjin.home.tverskoy; services.tailscale.enable = true; -- cgit 1.4.1