From 62b07aabc735e0674b065a0d97272b2e25565af9 Mon Sep 17 00:00:00 2001 From: Bradley Nelson Date: Mon, 9 Dec 2024 21:29:00 -0700 Subject: [PATCH] add daross user --- home-manager/_mixins/programs/firefox.nix | 6 +- home-manager/bcnelson/_mixins/firefox.nix | 44 +++++++++++++++ home-manager/bcnelson/desktop.nix | 2 +- home-manager/dsross/_mixins/kde.nix | 67 +++++++++++++++++++++++ home-manager/dsross/default.nix | 28 ++++++++++ home-manager/dsross/desktop.nix | 38 +++++++++++++ nixos/_mixins/users/dsross/default.nix | 18 ++++++ 7 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 home-manager/bcnelson/_mixins/firefox.nix create mode 100644 home-manager/dsross/_mixins/kde.nix create mode 100644 home-manager/dsross/default.nix create mode 100644 home-manager/dsross/desktop.nix create mode 100644 nixos/_mixins/users/dsross/default.nix diff --git a/home-manager/_mixins/programs/firefox.nix b/home-manager/_mixins/programs/firefox.nix index a2002fd..516a44c 100644 --- a/home-manager/_mixins/programs/firefox.nix +++ b/home-manager/_mixins/programs/firefox.nix @@ -10,14 +10,9 @@ extensions = with pkgs.nur.repos.rycee.firefox-addons; [ bitwarden darkreader - pay-by-privacy google-cal-event-merge ublock-origin i-dont-care-about-cookies - languagetool - refined-github - firefox-color - stylus ]; search = { default = "Google"; @@ -28,6 +23,7 @@ "signon.rememberSignons" = false; "signon.rememberSignons.visibilityToggle" = false; "trailhead.firstrun.didSeeAboutWelcome" = true; + "datareporting.policy.dataSubmissionPolicyBypassNotification" = true; "browser.newtabpage.activity-stream.feeds.section.topstories" = false; "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; "browser.newtabpage.activity-stream.topSitesRows" = 3; diff --git a/home-manager/bcnelson/_mixins/firefox.nix b/home-manager/bcnelson/_mixins/firefox.nix new file mode 100644 index 0000000..a2002fd --- /dev/null +++ b/home-manager/bcnelson/_mixins/firefox.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: +{ + programs.firefox = { + enable = true; + package = pkgs.firefox-wayland; + profiles = { + personal = { + name = "Personal"; + isDefault = true; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + bitwarden + darkreader + pay-by-privacy + google-cal-event-merge + ublock-origin + i-dont-care-about-cookies + languagetool + refined-github + firefox-color + stylus + ]; + search = { + default = "Google"; + force = true; + }; + settings = { + # Disable the builtin Password manager + "signon.rememberSignons" = false; + "signon.rememberSignons.visibilityToggle" = false; + "trailhead.firstrun.didSeeAboutWelcome" = true; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.topSitesRows" = 3; + "extensions.formautofill.creditCards.enabled" = false; + "widget.use-xdg-desktop-portal.file-picker" = 1; + }; + }; + }; + policies = { + DisablePocket = true; + DisableSetDesktopBackground = true; + }; + }; +} diff --git a/home-manager/bcnelson/desktop.nix b/home-manager/bcnelson/desktop.nix index dca976f..e920512 100644 --- a/home-manager/bcnelson/desktop.nix +++ b/home-manager/bcnelson/desktop.nix @@ -6,7 +6,7 @@ imports = [ outputs.homeManagerModules.autostart - ../_mixins/programs/firefox.nix + ./_mixins/firefox.nix ../_mixins/programs/chrome.nix ../_mixins/programs/vscode.nix ./_mixins/kde.nix diff --git a/home-manager/dsross/_mixins/kde.nix b/home-manager/dsross/_mixins/kde.nix new file mode 100644 index 0000000..8342d4f --- /dev/null +++ b/home-manager/dsross/_mixins/kde.nix @@ -0,0 +1,67 @@ +{ inputs, pkgs, ... }: +{ + imports = [ + inputs.plasma-manager.homeManagerModules.plasma-manager + ]; + programs.plasma = { + enable = true; + shortcuts = { + "kwin"."Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left"; + "kwin"."Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right"; + "plasmashell"."show-on-mouse-pos" = "Meta+V"; + "kwin"."Edit Tiles" = [ ]; + "services/org.kde.konsole.desktop"."_launch" = "Meta+T"; + "services/org.kde.krunner.desktop"."_launch" = "Meta+Space"; + "yakuake"."toggle-window-state" = "F12"; + }; + workspace.theme = "breeze-dark"; + configFile = { }; + panels = [{ + floating = true; + height = 42; + alignment = "center"; + hiding = "none"; + lengthMode = "fill"; + location = "bottom"; + screen = "all"; + widgets = [ + "org.kde.plasma.kickoff" + { + name = "org.kde.plasma.taskmanager"; + config = { + showOnlyCurrentScreen = true; + showOnlyCurrentDesktop = true; + showOnlyCurrentActivity = true; + launchers = [ + "preferred://browser" + "file://${pkgs.libreoffice-qt6-still}/share/applications/writer.desktop" + ]; + }; + } + "org.kde.plasma.marginsseparator" + { + systemTray = { + items.hidden = [ "Yakuake" ]; + }; + } + { + name = "org.kde.plasma.digitalclock"; + config = { + showSeconds = 2; # 0 = never, 1 = on hover, 2 = always + }; + } + ]; + }]; + input.keyboard.numlockOnStartup = "on"; + kwin = { + edgeBarrier = 0; + }; + fonts = { + fixedWidth = { + family = "Monaspace Neon"; + pointSize = 10; + }; + }; + }; + qt.style.catppuccin.enable = true; +} diff --git a/home-manager/dsross/default.nix b/home-manager/dsross/default.nix new file mode 100644 index 0000000..26a6c5d --- /dev/null +++ b/home-manager/dsross/default.nix @@ -0,0 +1,28 @@ +{ hostname, desktop, config, lib, ... }: + +let + # Get the hostname prefix from the hostname (e.g. sierria in sierria-1) + hostnamePrefix = lib.strings.concatStrings (lib.lists.take 1 (lib.strings.splitString "-" hostname)); +in +{ + imports = [ ] + ++ lib.optional (builtins.pathExists ./${hostnamePrefix}.nix) ./${hostnamePrefix}.nix + ++ lib.optional (builtins.isString desktop) ./desktop.nix; + + xdg.enable = true; + xdg.mime.enable = true; + targets.genericLinux.enable = true; + xdg.systemDirs.data = [ "${config.home.homeDirectory}/.nix-profile/share/applications" ]; + + programs = { + bash = { + enable = true; + }; + }; + + home.packages = [ ]; + + home.sessionVariables = { + EDITOR = "vim"; + }; +} diff --git a/home-manager/dsross/desktop.nix b/home-manager/dsross/desktop.nix new file mode 100644 index 0000000..f09e07f --- /dev/null +++ b/home-manager/dsross/desktop.nix @@ -0,0 +1,38 @@ +{ pkgs, outputs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage + + imports = [ + outputs.homeManagerModules.autostart + ../_mixins/programs/firefox.nix + ./_mixins/kde.nix + ]; + + home.packages = [ + pkgs.yakuake + pkgs.libreoffice-qt6-still + pkgs.hunspell + pkgs.hunspellDicts.en_US-large + ]; + + programs.bash.enable = true; + + services.freedesktop.autostart = { + enable = true; + packageSourced = [ + { + package = pkgs.yakuake; + path = "share/applications/org.kde.yakuake.desktop"; + } + ]; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + + systemd.user.startServices = "sd-switch"; +} diff --git a/nixos/_mixins/users/dsross/default.nix b/nixos/_mixins/users/dsross/default.nix new file mode 100644 index 0000000..3bdb204 --- /dev/null +++ b/nixos/_mixins/users/dsross/default.nix @@ -0,0 +1,18 @@ +{ libx, ... }: +let + init_password = libx.getSecret ../../../sensitive.nix "hlnelson_init_password"; +in +{ + users.users.dsross = { + # TODO: make this more generic + isNormalUser = true; + description = "Diane Ross"; + extraGroups = [ "networkmanager" "plugdev" "dialout" ]; + # The install script will change mark this user as needing a password change on first login. + # Note SDDM does not support password changes so this will need to be done via the command line. + initialPassword = init_password; + packages = [ + # Console Apps here + ]; + }; +}