Compare commits

..

2 commits

Author SHA1 Message Date
Evie Litherland-Smith fe1f5bb6a2 Move GPG config to own file
Move home/services/ files up one level, adjust imports accordingly.
2024-10-05 16:39:27 +01:00
Evie Litherland-Smith 9864acd7e9 Revert "Firefox: add proton-pass, remove browserpass and simplelogin"
This reverts commit db7d968f49.
2024-10-05 16:24:23 +01:00
14 changed files with 289 additions and 284 deletions

View file

@ -1,202 +1,213 @@
{ pkgs, ... }: { config, pkgs, ... }:
{ {
stylix.targets.firefox.profileNames = [ "default" ]; stylix.targets.firefox.profileNames = [ "default" ];
programs.firefox = { programs = {
enable = true; browserpass = {
policies = { enable = true;
BlockAboutProfiles = true; browsers = [ "firefox" ];
Cookies = {
Behavior = "reject-tracker-and-partition-foreign";
BehaviorPrivateBrowsing = "reject";
Locked = true;
};
DefaultDownloadDirectory = "\${home}/Downloads";
DisableAppUpdate = true;
DisableFirefoxAccounts = true;
DisableFirefoxScreenshots = true;
DisableFirefoxStudies = true;
DisableFormHistory = true;
DisablePocket = true;
DisableProfileImport = true;
DisableSetDesktopBackground = true;
DisableSystemAddonUpdate = true;
DisableTelemetry = true;
DisplayMenuBar = "default-off";
DontCheckDefaultBrowser = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
ExtensionSettings = {
"queryamoid@kaply.com" = {
installation_mode = "force_installed";
install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi";
};
# uBlock Origin
"uBlock0@raymondhill.net" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
};
# Proton Pass
"78272b6fa58f4a1abaac99321d503a20@proton.me" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/proton-pass/latest.xpi";
};
# Consent-O-Matic
"gdpr@cavi.au.dk" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/consent-o-matic/latest.xpi";
};
# ClearURLs
"{74145f27-f039-47ce-a470-a662b129930a}" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/clearurls/latest.xpi";
};
};
FirefoxHome = {
Search = true;
TopSites = false;
SponsoredTopSites = false;
Highlights = false;
Pocket = false;
SponsoredPocket = false;
Snippets = false;
Locked = true;
};
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
HardwareAcceleration = true;
Homepage = {
Locked = true;
StartPage = "homepage-locked";
};
NewTabPage = true;
NoDefaultBookmarks = false;
OfferToSaveLogins = false;
PasswordManagerEnabled = false;
PDFjs = {
Enabled = false;
};
Permissions = {
Autoplay = {
Default = "block-audio-video";
};
};
PictureInPicture = {
Enabled = true;
};
PopupBlocking = {
Default = true;
};
RequestedLocales = [ "en-GB" ];
SearchBar = "unified";
ShowHomeButton = true;
StartDownloadsInTempDirectory = true;
}; };
profiles.default = { firefox = {
bookmarks = builtins.fromJSON (builtins.readFile ./bookmarks.json); enable = true;
settings = { policies = {
"app.shield.optoutstudies.enabled" = false; BlockAboutProfiles = true;
"browser.tabs.inTitlebar" = 0; Cookies = {
"browser.bookmarks.addedImportButton" = false; Behavior = "reject-tracker-and-partition-foreign";
"browser.bookmarks.showMobileBookmarks" = false; BehaviorPrivateBrowsing = "reject";
"browser.toolbars.bookmarks.visibility" = "never"; Locked = true;
"browser.contentblocking.category" = "strict"; };
"browser.search.region" = "GB"; DefaultDownloadDirectory = config.xdg.userDirs.download;
"browser.search.isUS" = false; DisableAppUpdate = true;
"browser.warnOnQuitShortcut" = false; DisableFirefoxAccounts = true;
"browser.zoom.siteSpecific" = false; DisableFirefoxScreenshots = true;
"distribution.searchplugins.defaultLocale" = "en-GB"; DisableFirefoxStudies = true;
"doh-rollout.home-region" = "GB"; DisableFormHistory = true;
"dom.private-attribution.submission.enabled" = false; DisablePocket = true;
"extensions.activeThemeID" = "default-theme@mozilla.org"; DisableProfileImport = true;
"extensions.formautofill.creditCards.enabled" = false; DisableSetDesktopBackground = true;
"general.useragent.locale" = "en-GB"; DisableSystemAddonUpdate = true;
"intl.accept_languages" = "en-gb,en"; DisableTelemetry = true;
"intl.locale.requested" = "en-gb,en"; DisplayMenuBar = "default-off";
"intl.regional_prefs.use_os_locales" = true; DontCheckDefaultBrowser = true;
"media.eme.enabled" = true; EnableTrackingProtection = {
"privacy.webrtc.legacyGlobalIndicator" = false; Value = true;
"signon.management.page.breach-alerts.enabled" = false; Locked = true;
"signon.rememberSignons" = false; Cryptomining = true;
"widget.use-xdg-desktop-portal.file-picker" = 1; Fingerprinting = true;
"widget.use-xdg-desktop-portal.mime-handler" = 1; };
"widget.use-xdg-desktop-portal.open-uri" = 1; ExtensionSettings = {
"browser.newtabpage.pinned" = [ "queryamoid@kaply.com" = {
{ installation_mode = "force_installed";
title = "NixOS Wiki"; install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi";
url = "https://wiki.nixos.org"; };
} # uBlock Origin
{ "uBlock0@raymondhill.net" = {
title = "Arch Wiki"; installation_mode = "force_installed";
url = "https://wiki.archlinux.org"; install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
} };
]; # Browserpass
"browserpass@maximbaz.com" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/browserpass-ce/latest.xpi";
};
# SimpleLogin
"addon@simplelogin" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi";
};
# Consent-O-Matic
"gdpr@cavi.au.dk" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/consent-o-matic/latest.xpi";
};
# ClearURLs
"{74145f27-f039-47ce-a470-a662b129930a}" = {
installation_mode = "force_installed";
install_url = "https://addons.mozilla.org/firefox/downloads/latest/clearurls/latest.xpi";
};
};
FirefoxHome = {
Search = true;
TopSites = false;
SponsoredTopSites = false;
Highlights = false;
Pocket = false;
SponsoredPocket = false;
Snippets = false;
Locked = true;
};
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
HardwareAcceleration = true;
Homepage = {
Locked = true;
StartPage = "homepage-locked";
};
NewTabPage = true;
NoDefaultBookmarks = false;
OfferToSaveLogins = false;
PasswordManagerEnabled = false;
PDFjs = {
Enabled = false;
};
Permissions = {
Autoplay = {
Default = "block-audio-video";
};
};
PictureInPicture = {
Enabled = true;
};
PopupBlocking = {
Default = true;
};
RequestedLocales = [ "en-GB" ];
SearchBar = "unified";
ShowHomeButton = true;
StartDownloadsInTempDirectory = true;
}; };
search = rec { profiles.default = {
default = "DuckDuckGo"; bookmarks = builtins.fromJSON (builtins.readFile ./bookmarks.json);
privateDefault = default; settings = {
force = true; "app.shield.optoutstudies.enabled" = false;
order = [ "browser.tabs.inTitlebar" = 0;
"DuckDuckGo" "browser.bookmarks.addedImportButton" = false;
"Atlas SearXNG" "browser.bookmarks.showMobileBookmarks" = false;
]; "browser.toolbars.bookmarks.visibility" = "never";
engines = { "browser.contentblocking.category" = "strict";
"Atlas SearXNG" = { "browser.search.region" = "GB";
urls = [ { template = "https://search.atlas.engineer/searxng/search?q={searchTerms}"; } ]; "browser.search.isUS" = false;
definedAliases = [ "@atlas" ]; "browser.warnOnQuitShortcut" = false;
}; "browser.zoom.siteSpecific" = false;
"NixOS Wiki" = { "distribution.searchplugins.defaultLocale" = "en-GB";
urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; "doh-rollout.home-region" = "GB";
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; "dom.private-attribution.submission.enabled" = false;
definedAliases = [ "extensions.activeThemeID" = "default-theme@mozilla.org";
"@nix" "extensions.formautofill.creditCards.enabled" = false;
"@nixos" "general.useragent.locale" = "en-GB";
"@nixoswiki" "intl.accept_languages" = "en-gb,en";
]; "intl.locale.requested" = "en-gb,en";
}; "intl.regional_prefs.use_os_locales" = true;
"Arch Wiki" = { "media.eme.enabled" = true;
urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ]; "privacy.webrtc.legacyGlobalIndicator" = false;
definedAliases = [ "signon.management.page.breach-alerts.enabled" = false;
"@aw" "signon.rememberSignons" = false;
"@arch" "widget.use-xdg-desktop-portal.file-picker" = 1;
"@archwiki" "widget.use-xdg-desktop-portal.mime-handler" = 1;
]; "widget.use-xdg-desktop-portal.open-uri" = 1;
}; "browser.newtabpage.pinned" = [
"GitHub" = { {
urls = [ { template = "https://github.com/search?q={searchTerms}"; } ]; title = "NixOS Wiki";
definedAliases = [ url = "https://wiki.nixos.org";
"@gh" }
"@git" {
"@github" title = "Arch Wiki";
]; url = "https://wiki.archlinux.org";
}; }
"FlatHub" = { ];
url = [ { template = "https://flathub.org/apps/search?q={searchTerms}"; } ]; };
definedAliases = [ search = rec {
"@flat" default = "DuckDuckGo";
"@fthub" privateDefault = default;
"@flathub" force = true;
]; order = [
}; "DuckDuckGo"
"NixOS Packages" = { "Atlas SearXNG"
urls = [ ];
{ engines = {
template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}"; "Atlas SearXNG" = {
} urls = [ { template = "https://search.atlas.engineer/searxng/search?q={searchTerms}"; } ];
]; definedAliases = [ "@atlas" ];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; };
definedAliases = [ "@nixpkgs" ]; "NixOS Wiki" = {
}; urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ];
"PyPI packages" = { icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
urls = [ { template = "https://pypi.org/search/?q={searchTerms}"; } ]; definedAliases = [
definedAliases = [ "@pypi" ]; "@nix"
"@nixos"
"@nixoswiki"
];
};
"Arch Wiki" = {
urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ];
definedAliases = [
"@aw"
"@arch"
"@archwiki"
];
};
"GitHub" = {
urls = [ { template = "https://github.com/search?q={searchTerms}"; } ];
definedAliases = [
"@gh"
"@git"
"@github"
];
};
"FlatHub" = {
url = [ { template = "https://flathub.org/apps/search?q={searchTerms}"; } ];
definedAliases = [
"@flat"
"@fthub"
"@flathub"
];
};
"NixOS Packages" = {
urls = [
{
template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}";
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nixpkgs" ];
};
"PyPI packages" = {
urls = [ { template = "https://pypi.org/search/?q={searchTerms}"; } ];
definedAliases = [ "@pypi" ];
};
}; };
}; };
}; };

View file

@ -4,7 +4,7 @@
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
./shell/default.nix ./shell/default.nix
./scripts/default.nix ./scripts/default.nix
./services/password-store/default.nix ./password-store/default.nix
]; ];
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }

View file

@ -2,11 +2,11 @@
{ {
imports = [ imports = [
./plasma/default.nix ./plasma/default.nix
./emacs/default.nix ./email/default.nix
./calendar/default.nix
./terminal/default.nix ./terminal/default.nix
./emacs/default.nix
./browser/default.nix ./browser/default.nix
./services/email/default.nix
./services/calendar/default.nix
]; ];
home = { home = {
packages = with pkgs; [ packages = with pkgs; [

View file

@ -1,17 +1,12 @@
{ config, pkgs, ... }:
{ {
config, imports = [
lib, ../shell/default.nix
pkgs, ../shell/git.nix
... ../gpg/default.nix
}: ];
{
imports = [ ../shell/default.nix ];
stylix.targets.emacs.enable = false; stylix.targets.emacs.enable = false;
services = { services = {
gpg-agent = {
enable = true;
pinentryPackage = lib.mkDefault pkgs.pinentry-all;
};
git-sync.repositories = { git-sync.repositories = {
org = { org = {
path = "${config.xdg.userDirs.documents}/org"; path = "${config.xdg.userDirs.documents}/org";
@ -31,55 +26,52 @@
startWithUserSession = false; startWithUserSession = false;
}; };
}; };
programs = { programs.emacs = {
gpg.enable = true; # Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git
emacs = { enable = true;
# Clone emacs config from https://git.xenia.me.uk/pixelifytica/emacs.git package = pkgs.emacs29-pgtk;
enable = true; extraConfig =
package = pkgs.emacs29-pgtk; let
extraConfig = fixed-font-family = "${config.stylix.fonts.monospace.name}";
let variable-font-family = "${config.stylix.fonts.sansSerif.name}";
fixed-font-family = "${config.stylix.fonts.monospace.name}"; font-height = builtins.toString (
variable-font-family = "${config.stylix.fonts.sansSerif.name}"; builtins.floor (builtins.mul config.stylix.fonts.sizes.applications 10)
font-height = builtins.toString ( );
builtins.floor (builtins.mul config.stylix.fonts.sizes.applications 10) custom-theme-name = "nix";
); custom-theme = pkgs.writeTextFile {
custom-theme-name = "nix"; name = "custom-emacs-theme";
custom-theme = pkgs.writeTextFile { destination = "/${custom-theme-name}-theme.el";
name = "custom-emacs-theme"; text = ''
destination = "/${custom-theme-name}-theme.el"; (deftheme ${custom-theme-name}
text = '' "Use Nix customised fonts for main faces")
(deftheme ${custom-theme-name}
"Use Nix customised fonts for main faces")
(custom-theme-set-variables (custom-theme-set-variables
'${custom-theme-name} '${custom-theme-name}
'(menu-bar-mode nil)) '(menu-bar-mode nil))
(custom-theme-set-faces (custom-theme-set-faces
'${custom-theme-name} '${custom-theme-name}
'(default ((t (:family "${fixed-font-family}" :height ${font-height})))) '(default ((t (:family "${fixed-font-family}" :height ${font-height}))))
'(fixed-pitch ((t (:family "${fixed-font-family}")))) '(fixed-pitch ((t (:family "${fixed-font-family}"))))
'(fixed-pitch-serif ((t (:family "${fixed-font-family}")))) '(fixed-pitch-serif ((t (:family "${fixed-font-family}"))))
'(variable-pitch ((t (:family "${variable-font-family}"))))) '(variable-pitch ((t (:family "${variable-font-family}")))))
(provide-theme '${custom-theme-name}) (provide-theme '${custom-theme-name})
''; '';
}; };
custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el"; custom-theme-hash = builtins.hashFile "sha256" "${custom-theme}/${custom-theme-name}-theme.el";
in in
'' ''
(add-to-list 'custom-theme-load-path "${custom-theme}") (add-to-list 'custom-theme-load-path "${custom-theme}")
(add-to-list 'custom-safe-themes "${custom-theme-hash}") (add-to-list 'custom-safe-themes "${custom-theme-hash}")
(load-theme '${custom-theme-name}) (load-theme '${custom-theme-name})
''; '';
extraPackages = extraPackages =
epkgs: with epkgs; [ epkgs: with epkgs; [
treesit-grammars.with-all-grammars treesit-grammars.with-all-grammars
mu4e mu4e
emacsql-sqlite emacsql-sqlite
]; ];
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
# Emacs requirements # Emacs requirements

View file

@ -0,0 +1,8 @@
{ lib, pkgs, ... }:
{
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentryPackage = lib.mkDefault pkgs.pinentry-all;
};
}

View file

@ -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";
};
};
};
}

View file

@ -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;
};
}