diff --git a/config/home.nix b/config/home.nix index e7a04b00..1aa651a2 100644 --- a/config/home.nix +++ b/config/home.nix @@ -6,9 +6,7 @@ let }; in { - imports = lib.attrValues homeModules ++ [ - ../modules/home - ./private/profile/home - ]; + imports = lib.attrValues homeModules + ++ [ ../modules/home ./private/profile/home ]; } diff --git a/config/profiles/gui/home/email.nix b/config/profiles/gui/home/email.nix index a70d37f5..b40a16f7 100644 --- a/config/profiles/gui/home/email.nix +++ b/config/profiles/gui/home/email.nix @@ -2,35 +2,35 @@ { config = lib.mkIf config.deploy.profile.gui { - programs.notmuch = { - enable = true; - hooks = { preNew = "mbsync --all"; }; - }; - programs.mbsync.enable = true; - programs.msmtp.enable = true; - accounts.email = { - maildirBasePath = "${config.home.homeDirectory}/mail"; - accounts.kat = { - address = "kat@kittywit.ch"; - primary = true; - realName = "kat witch"; - userName = "kat@kittywit.ch"; - passwordCommand = '' - bitw -p gpg://${ - ../../../private/files/bitw/master.gpg - } get "kittywitch email"''; - msmtp.enable = true; - mbsync.enable = true; - mbsync.create = "maildir"; - notmuch.enable = true; - imap.host = "kittywit.ch"; - smtp.host = "kittywit.ch"; - gpg = { - signByDefault = true; - key = "01F50A29D4AA91175A11BDB17248991EFA8EFBEE"; + programs.notmuch = { + enable = true; + hooks = { preNew = "mbsync --all"; }; + }; + programs.mbsync.enable = true; + programs.msmtp.enable = true; + accounts.email = { + maildirBasePath = "${config.home.homeDirectory}/mail"; + accounts.kat = { + address = "kat@kittywit.ch"; + primary = true; + realName = "kat witch"; + userName = "kat@kittywit.ch"; + passwordCommand = '' + bitw -p gpg://${ + ../../../private/files/bitw/master.gpg + } get "kittywitch email"''; + msmtp.enable = true; + mbsync.enable = true; + mbsync.create = "maildir"; + notmuch.enable = true; + imap.host = "kittywit.ch"; + smtp.host = "kittywit.ch"; + gpg = { + signByDefault = true; + key = "01F50A29D4AA91175A11BDB17248991EFA8EFBEE"; + }; }; }; + programs.vim.plugins = [ pkgs.arc.pkgs.vimPlugins.notmuch-vim ]; }; - programs.vim.plugins = [ pkgs.arc.pkgs.vimPlugins.notmuch-vim ]; -}; } diff --git a/config/profiles/kat/home/vim/default.nix b/config/profiles/kat/home/vim/default.nix index 05db64fa..539e9beb 100644 --- a/config/profiles/kat/home/vim/default.nix +++ b/config/profiles/kat/home/vim/default.nix @@ -24,7 +24,7 @@ #extraPython3Packages = (ps: with ps; [ jedi pylint ]); extraConfig = import ./vimrc.nix { inherit pkgs config; }; }; - xdg.dataFile = { + xdg.dataFile = { "vim/undo/.keep".text = ""; "vim/swap/.keep".text = ""; "vim/backup/.keep".text = ""; diff --git a/config/profiles/kat/home/vim/vimrc.nix b/config/profiles/kat/home/vim/vimrc.nix index 0aa5808f..6d03cc24 100644 --- a/config/profiles/kat/home/vim/vimrc.nix +++ b/config/profiles/kat/home/vim/vimrc.nix @@ -4,8 +4,8 @@ " Enable mouse set mouse=a - " notmuch! - let g:notmuch_config_file='$XDG_CONFIG_HOME/notmuch/notmuchrc' + " notmuch! + let g:notmuch_config_file='${config.xdg.configHome}/notmuch/notmuchrc' let g:notmuch_folders_count_threads=0 let g:notmuch_date_format='%y-%m-%d %H:%M' let g:notmuch_datetime_format='%y-%m-%d %H:%M' @@ -195,4 +195,10 @@ nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume -'' +'' + (if config.deploy.profile.sway == true then '' + noremap "+y y:call system("wl-copy", @") + nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '', ''', 'g')p + nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '', ''', 'g')p +'' else + "") + diff --git a/config/profiles/kat/home/xdg.nix b/config/profiles/kat/home/xdg.nix index f7e1522c..2ded714a 100644 --- a/config/profiles/kat/home/xdg.nix +++ b/config/profiles/kat/home/xdg.nix @@ -1,7 +1,5 @@ { config, lib, ... }: { - config = lib.mkIf config.deploy.profile.kat { - xdg.enable = true; - }; + config = lib.mkIf config.deploy.profile.kat { xdg.enable = true; }; } diff --git a/modules/nixos/deploy/default.nix b/modules/nixos/deploy/default.nix index dd95bae1..816409b1 100644 --- a/modules/nixos/deploy/default.nix +++ b/modules/nixos/deploy/default.nix @@ -4,15 +4,19 @@ with lib; let cfg = config.deploy; - secretsScript = concatMapStrings (file: '' - ssh $NIX_SSHOPTS root@${cfg.ssh.host} "mkdir -p ${toString file.out.dir} - cat > ${file.path} - chmod ${file.mode} ${file.path} - chown ${file.owner}:${file.group} ${file.path}"'' + (if file.source != null then "< ${toString file.source}\n" else '' - <<'EOF' - ${file.text} - EOF - '')) (attrValues config.secrets.files); + secretsScript = concatMapStrings (file: + '' + ssh $NIX_SSHOPTS root@${cfg.ssh.host} "mkdir -p ${toString file.out.dir} + cat > ${file.path} + chmod ${file.mode} ${file.path} + chown ${file.owner}:${file.group} ${file.path}"'' + + (if file.source != null then '' + < ${toString file.source} + '' else '' + <<'EOF' + ${file.text} + EOF + '')) (attrValues config.secrets.files); in { options = { deploy = {