From 27060fed8dd30d202ef09e0bf19bc211c7030099 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 20 Dec 2024 16:50:27 -0500 Subject: [PATCH] Preserve gpg directory. --- nix/configuration/configuration.nix | 3 +++ nix/configuration/roles/firefox/default.nix | 10 ++++++++ nix/configuration/roles/gpg/default.nix | 25 ++++++++++++++++++++ nix/configuration/roles/graphics/default.nix | 7 ++++++ nix/configuration/roles/sway/default.nix | 12 ++++++---- 5 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 nix/configuration/roles/firefox/default.nix create mode 100644 nix/configuration/roles/gpg/default.nix create mode 100644 nix/configuration/roles/graphics/default.nix diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 31cff64..a6da52f 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -9,10 +9,13 @@ ./boot.nix ./zfs.nix ./network.nix + ./roles/graphics ./roles/sway + ./roles/firefox ./roles/emacs ./roles/git ./roles/fonts + ./roles/gpg ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/nix/configuration/roles/firefox/default.nix b/nix/configuration/roles/firefox/default.nix new file mode 100644 index 0000000..e0d8c57 --- /dev/null +++ b/nix/configuration/roles/firefox/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + imports = []; + + environment.systemPackages = with pkgs; [ + firefox + ]; + +} diff --git a/nix/configuration/roles/gpg/default.nix b/nix/configuration/roles/gpg/default.nix new file mode 100644 index 0000000..b005489 --- /dev/null +++ b/nix/configuration/roles/gpg/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +{ + imports = []; + + # Fetch public keys: + # gpg --locate-keys tom@fizz.buzz + # + # gpg -vvv --auto-key-locate local,wkd --locate-keys tom@fizz.buzz + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + environment.persistence."/persist" = { + hideMounts = true; + users.talexander = { + directories = [ + { directory = ".gnupg"; user = "talexander"; group = "talexander"; mode = "0700"; } # Local keyring + ]; + }; + }; + +} diff --git a/nix/configuration/roles/graphics/default.nix b/nix/configuration/roles/graphics/default.nix new file mode 100644 index 0000000..3638c4a --- /dev/null +++ b/nix/configuration/roles/graphics/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = []; + + hardware.graphics.enable = true; +} diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index eca1234..4fac7e1 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -211,10 +211,8 @@ in environment.systemPackages = with pkgs; [ alacritty - firefox pcmanfm ]; - hardware.graphics.enable = true; environment.sessionVariables = { WLR_RENDERER_ALLOW_SOFTWARE = "1"; @@ -231,8 +229,12 @@ in ]; }; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; + environment.persistence."/state" = { + hideMounts = true; + users.talexander = { + files = [ + ".cache/wofi-drun" # Execution history for wofi to sort results + ]; + }; }; }