diff --git a/system/home/browser/firefox.nix b/system/home/browser/firefox.nix index fca90993..855fa324 100644 --- a/system/home/browser/firefox.nix +++ b/system/home/browser/firefox.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { stylix.targets.firefox.profileNames = [ "default" ]; programs = { @@ -15,7 +15,7 @@ BehaviorPrivateBrowsing = "reject"; Locked = true; }; - DefaultDownloadDirectory = "\${home}/Downloads"; + DefaultDownloadDirectory = config.xdg.userDirs.download; DisableAppUpdate = true; DisableFirefoxAccounts = true; DisableFirefoxScreenshots = true; diff --git a/system/home/services/calendar/default.nix b/system/home/calendar/default.nix similarity index 100% rename from system/home/services/calendar/default.nix rename to system/home/calendar/default.nix diff --git a/system/home/services/calendar/vdirsyncer-ensure-pass.sh b/system/home/calendar/vdirsyncer-ensure-pass.sh similarity index 100% rename from system/home/services/calendar/vdirsyncer-ensure-pass.sh rename to system/home/calendar/vdirsyncer-ensure-pass.sh diff --git a/system/home/default.nix b/system/home/default.nix index d2da256a..0aa06bcf 100644 --- a/system/home/default.nix +++ b/system/home/default.nix @@ -4,7 +4,7 @@ inputs.nix-index-database.hmModules.nix-index ./shell/default.nix ./scripts/default.nix - ./services/password-store/default.nix + ./password-store/default.nix ]; programs.home-manager.enable = true; } diff --git a/system/home/desktop.nix b/system/home/desktop.nix index fc0344ad..5ff23646 100644 --- a/system/home/desktop.nix +++ b/system/home/desktop.nix @@ -2,11 +2,11 @@ { imports = [ ./plasma/default.nix - ./emacs/default.nix + ./email/default.nix + ./calendar/default.nix ./terminal/default.nix + ./emacs/default.nix ./browser/default.nix - ./services/email/default.nix - ./services/calendar/default.nix ]; home = { packages = with pkgs; [ diff --git a/system/home/emacs/default.nix b/system/home/emacs/default.nix index b43d2b71..4ba042ca 100644 --- a/system/home/emacs/default.nix +++ b/system/home/emacs/default.nix @@ -1,17 +1,12 @@ +{ config, pkgs, ... }: { - config, - lib, - pkgs, - ... -}: -{ - imports = [ ../shell/default.nix ]; + imports = [ + ../shell/default.nix + ../shell/git.nix + ../gpg/default.nix + ]; stylix.targets.emacs.enable = false; services = { - gpg-agent = { - enable = true; - pinentryPackage = lib.mkDefault pkgs.pinentry-all; - }; git-sync.repositories = { org = { path = "${config.xdg.userDirs.documents}/org"; @@ -31,55 +26,52 @@ startWithUserSession = false; }; }; - programs = { - gpg.enable = true; - emacs = { - # Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git - enable = true; - package = pkgs.emacs29-pgtk; - extraConfig = - let - fixed-font-family = "${config.stylix.fonts.monospace.name}"; - variable-font-family = "${config.stylix.fonts.sansSerif.name}"; - font-height = builtins.toString ( - builtins.floor (builtins.mul config.stylix.fonts.sizes.applications 10) - ); - custom-theme-name = "nix"; - custom-theme = pkgs.writeTextFile { - name = "custom-emacs-theme"; - destination = "/${custom-theme-name}-theme.el"; - text = '' - (deftheme ${custom-theme-name} - "Use Nix customised fonts for main faces") + programs.emacs = { + # Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git + enable = true; + package = pkgs.emacs29-pgtk; + extraConfig = + let + fixed-font-family = "${config.stylix.fonts.monospace.name}"; + variable-font-family = "${config.stylix.fonts.sansSerif.name}"; + font-height = builtins.toString ( + builtins.floor (builtins.mul config.stylix.fonts.sizes.applications 10) + ); + custom-theme-name = "nix"; + custom-theme = pkgs.writeTextFile { + name = "custom-emacs-theme"; + destination = "/${custom-theme-name}-theme.el"; + text = '' + (deftheme ${custom-theme-name} + "Use Nix customised fonts for main faces") - (custom-theme-set-variables - '${custom-theme-name} - '(menu-bar-mode nil)) + (custom-theme-set-variables + '${custom-theme-name} + '(menu-bar-mode nil)) - (custom-theme-set-faces - '${custom-theme-name} - '(default ((t (:family "${fixed-font-family}" :height ${font-height})))) - '(fixed-pitch ((t (:family "${fixed-font-family}")))) - '(fixed-pitch-serif ((t (:family "${fixed-font-family}")))) - '(variable-pitch ((t (:family "${variable-font-family}"))))) + (custom-theme-set-faces + '${custom-theme-name} + '(default ((t (:family "${fixed-font-family}" :height ${font-height})))) + '(fixed-pitch ((t (:family "${fixed-font-family}")))) + '(fixed-pitch-serif ((t (:family "${fixed-font-family}")))) + '(variable-pitch ((t (:family "${variable-font-family}"))))) - (provide-theme '${custom-theme-name}) - ''; - }; - custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el"; - in - '' - (add-to-list 'custom-theme-load-path "${custom-theme}") - (add-to-list 'custom-safe-themes "${custom-theme-hash}") - (load-theme '${custom-theme-name}) - ''; - extraPackages = - epkgs: with epkgs; [ - treesit-grammars.with-all-grammars - mu4e - emacsql-sqlite - ]; - }; + (provide-theme '${custom-theme-name}) + ''; + }; + custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el"; + in + '' + (add-to-list 'custom-theme-load-path "${custom-theme}") + (add-to-list 'custom-safe-themes "${custom-theme-hash}") + (load-theme '${custom-theme-name}) + ''; + extraPackages = + epkgs: with epkgs; [ + treesit-grammars.with-all-grammars + mu4e + emacsql-sqlite + ]; }; home.packages = with pkgs; [ # Emacs requirements diff --git a/system/home/services/email/davmail.properties b/system/home/email/davmail.properties similarity index 100% rename from system/home/services/email/davmail.properties rename to system/home/email/davmail.properties diff --git a/system/home/services/email/default.nix b/system/home/email/default.nix similarity index 100% rename from system/home/services/email/default.nix rename to system/home/email/default.nix diff --git a/system/home/services/email/mbsync-ensure-pass.sh b/system/home/email/mbsync-ensure-pass.sh similarity index 100% rename from system/home/services/email/mbsync-ensure-pass.sh rename to system/home/email/mbsync-ensure-pass.sh diff --git a/system/home/services/email/signatures/personal b/system/home/email/signatures/personal similarity index 100% rename from system/home/services/email/signatures/personal rename to system/home/email/signatures/personal diff --git a/system/home/services/email/signatures/work b/system/home/email/signatures/work similarity index 100% rename from system/home/services/email/signatures/work rename to system/home/email/signatures/work diff --git a/system/home/gpg/default.nix b/system/home/gpg/default.nix new file mode 100644 index 00000000..f88d84b1 --- /dev/null +++ b/system/home/gpg/default.nix @@ -0,0 +1,8 @@ +{ lib, pkgs, ... }: +{ + programs.gpg.enable = true; + services.gpg-agent = { + enable = true; + pinentryPackage = lib.mkDefault pkgs.pinentry-all; + }; +} diff --git a/system/home/password-store/default.nix b/system/home/password-store/default.nix new file mode 100644 index 00000000..2a250fbe --- /dev/null +++ b/system/home/password-store/default.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: +{ + imports = [ + ../gpg/default.nix + ../shell/git.nix + ]; + services.git-sync.repositories.password-store = { + path = config.programs.password-store.settings.PASSWORD_STORE_DIR; + uri = "git+https://git.xenia.me.uk/pixelifytica/pass.git"; + }; + programs = { + gpg.enable = true; + password-store = { + enable = true; + package = pkgs.pass-nodmenu.withExtensions (exts: with exts; [ pass-update ]); + settings = { + PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; + PASSWORD_STORE_ENABLE_EXTENSIONS = "true"; + }; + }; + }; +} diff --git a/system/home/services/password-store/default.nix b/system/home/services/password-store/default.nix deleted file mode 100644 index d2d7cbdb..00000000 --- a/system/home/services/password-store/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - programs = { - gpg.enable = true; - password-store = { - enable = true; - package = pkgs.pass-nodmenu.withExtensions ( - exts: with exts; [ - pass-update - pass-import - ] - ); # pass-audit - settings = { - PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; - PASSWORD_STORE_ENABLE_EXTENSIONS = "true"; - }; - }; - }; - services.gpg-agent = { - enable = true; - pinentryPackage = lib.mkDefault pkgs.pinentry-all; - }; -}