From acf2b21f725ddb21e77d9b7c370a1e52bbf73760 Mon Sep 17 00:00:00 2001 From: Olaf Date: Tue, 24 Mar 2026 07:34:30 +0100 Subject: [PATCH] some apps, and GPG/SSH --- flake.nix | 14 ++++----- modules/darwin/home-manager.nix | 37 +++++++++++++++++----- modules/nixos/home-manager.nix | 2 +- modules/shared/home-manager.nix | 55 +++++++++++++++++++-------------- modules/shared/packages.nix | 10 +++--- 5 files changed, 75 insertions(+), 43 deletions(-) diff --git a/flake.nix b/flake.nix index 535f97a..07b19ee 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,9 @@ nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; }; + catppuccin= { + url = "github:catppuccin/nix"; + }; # mac-app-util doesn't work with OCLP installed on X86 # mac-app-util = { @@ -60,7 +63,8 @@ nixd, sops-nix, nix-vscode-extensions, - # mac-app-util, + catppuccin, + ... }@inputs: let user = "olaf"; @@ -109,18 +113,12 @@ mkLinuxApps = system: { "apply" = mkApp "apply" system; "build-switch" = mkApp "build-switch" system; - "copy-keys" = mkApp "copy-keys" system; - "create-keys" = mkApp "create-keys" system; - "check-keys" = mkApp "check-keys" system; "install" = mkApp "install" system; }; mkDarwinApps = system: { "apply" = mkApp "apply" system; "build" = mkApp "build" system; "build-switch" = mkApp "build-switch" system; - "copy-keys" = mkApp "copy-keys" system; - "create-keys" = mkApp "create-keys" system; - "check-keys" = mkApp "check-keys" system; "rollback" = mkApp "rollback" system; }; in @@ -154,6 +152,8 @@ }; home-manager.sharedModules = [ # mac-app-util.homeManagerModules.default + catppuccin.homeModules.catppuccin + ]; } ./hosts/darwin diff --git a/modules/darwin/home-manager.nix b/modules/darwin/home-manager.nix index 1b01d3f..14d3473 100644 --- a/modules/darwin/home-manager.nix +++ b/modules/darwin/home-manager.nix @@ -17,6 +17,7 @@ let additionalFiles = import ./files.nix { inherit user config pkgs; }; in { + imports = [ ./dock ]; @@ -50,15 +51,15 @@ in "Affinity Designer 2" = 1616831348; "Affinity Photo 2: Image Editor" = 1616822987; "Affinity Publisher 2" = 1606941598; - "DaisyDisk" = 411643860 ; # (4.32) + "DaisyDisk" = 411643860; # (4.32) "Fantastical - Calendar" = 975937182; "Home Assistant" = 1099568401; # (2025.7.1) "Ice Cubes for Mastodon" = 6444915884; # (1.11.3) "LibreOffice" = 1630474372; - "Monal - XMPP Chatting "=1637078500; # + "Monal - XMPP Chatting " = 1637078500; "MQTT Explorer" = 1455214828; # (0.3.5) "Night Sky" = 475772902; # 475772902 - "Native SQLite Manager"= 1416282836; # (1.31.0) + "Native SQLite Manager" = 1416282836; # (1.31.0) "Remarkable Desktop" = 1276493162; # (3.19.0) "Slack for Desktop" = 803453959; # (4.45.60) "WiFi Explorer: Scanner" = 494803304; # (3.5.6) @@ -77,6 +78,7 @@ in ... }: { + home = { enableNixpkgsReleaseCheck = false; packages = pkgs.callPackage ./packages.nix { }; @@ -84,12 +86,31 @@ in sharedFiles additionalFiles { "emacs-launcher.command".source = myEmacsLauncher; } + ]; stateVersion = "23.11"; }; - programs = { } // import ../shared/home-manager.nix { inherit config pkgs lib; }; + programs = { + } // import ../shared/home-manager.nix { inherit config pkgs lib; }; + catppuccin = { + enable = true; + flavor = "mocha"; + }; + + services = { + gpg-agent = { + enable = true; + enableSshSupport = true; + extraConfig = '' + default-cache-ttl 600 + max-cache-ttl 7200 + pinentry-program /Users/olaf/.nix-profile/bin/pinentry-mac + ''; + }; + }; + # Marked broken Oct 20, 2022 check later to remove this # https://github.com/nix-community/home-manager/issues/3344 manual.manpages.enable = false; @@ -119,12 +140,14 @@ in { path = "/Applications/iTerm.app/"; } { path = "/Applications/Fantastical.app/"; } - # { path = "${pkgs.alacritty}/Applications/Alacritty.app/"; } + { path = "${pkgs.alacritty}/Applications/Alacritty.app/"; } # { path = "/Applications/Spotify.app/"; } { path = "/Applications/Qobuz.app/"; } { path = "/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/"; } - { path = "/run/current-system/Applications/Brave Browser.app/"; - options = "-l Brave"; } + { + path = "/run/current-system/Applications/Brave Browser.app/"; + options = "-l Brave"; + } { path = "/System/Applications/Photos.app/"; } { path = "/System/Applications/System Settings.app/"; } { path = "/Applications/Signal.app/"; } diff --git a/modules/nixos/home-manager.nix b/modules/nixos/home-manager.nix index 4ee3674..3c11d89 100644 --- a/modules/nixos/home-manager.nix +++ b/modules/nixos/home-manager.nix @@ -8,7 +8,7 @@ let user = "olaf"; xdg_configHome = "/home/${user}/.config"; - shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; }; + shared-programs = import ../shared/home-manager.nix { inherit config pkgs lib; }; shared-files = import ../shared/files.nix { inherit config pkgs; }; polybar-user_modules = builtins.readFile ( diff --git a/modules/shared/home-manager.nix b/modules/shared/home-manager.nix index 56326fa..6ad4583 100644 --- a/modules/shared/home-manager.nix +++ b/modules/shared/home-manager.nix @@ -11,6 +11,16 @@ let in { + gpg = { + enable = true; + settings = { + default-key = "01B157D574FEDBB2" ; + no-emit-version = true; + auto-key-retrieve = true; + personal-digest-preferences= "SHA512 SHA384 SHA256 SHA224"; + }; + }; + # Shared shell configuration zsh = { @@ -34,6 +44,10 @@ in . /nix/var/nix/profiles/default/etc/profile.d/nix.sh fi + + # GPGAgent for SSH + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + # Define variables for directories export PATH=$HOME/.pnpm-packages/bin:$HOME/.pnpm-packages:$PATH export PATH=$HOME/.npm-packages/bin:$HOME/bin:$PATH @@ -292,36 +306,26 @@ in ssh = { enable = true; - + enableDefaultConfig = false; - matchBlocks."*" = { - forwardAgent = false; - addKeysToAgent = "no"; - compression = false; - serverAliveInterval = 0; - serverAliveCountMax = 3; - hashKnownHosts = false; - userKnownHostsFile = "~/.ssh/known_hosts"; - controlMaster = "no"; - controlPath = "~/.ssh/master-%r@%n:%p"; - controlPersist = "no"; - }; + matchBlocks."*" = { + forwardAgent = false; + addKeysToAgent = "no"; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; includes = [ (lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/config_external") (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/config_external") ]; matchBlocks = { - "Host *" = { - identityAgent = "\"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock\""; - }; - "github.com" = { - identitiesOnly = true; - identityFile = [ - (lib.mkIf pkgs.stdenv.hostPlatform.isLinux "/home/${user}/.ssh/id_github") - (lib.mkIf pkgs.stdenv.hostPlatform.isDarwin "/Users/${user}/.ssh/id_github") - ]; - }; - "moonunit.kolkman.org" = { + "moonunit.kolkman.org" = { hostname = "moonunit.kolkman.org"; user = "root"; port = 2222; @@ -412,4 +416,7 @@ in bind-key -T copy-mode-vi 'C-\' select-pane -l ''; }; + + + } diff --git a/modules/shared/packages.nix b/modules/shared/packages.nix index 0659f9c..f64e1fa 100644 --- a/modules/shared/packages.nix +++ b/modules/shared/packages.nix @@ -11,12 +11,14 @@ with pkgs; firefox # google-chrome. #stopped working - + # security and some such bitwarden-desktop - bitwarden-cli +# bitwarden-cli + yubikey-manager # provides ykman + pinentry_mac # General packages for development and system management - #alacritty + alacritty ansible aspell aspellDicts.en @@ -90,7 +92,7 @@ with pkgs; htop hunspell iftop - inetutils # includes Telnet +# inetutils # includes Telnet jetbrains-mono jq ripgrep