From c5c6a28509c79b07f4b26ab936343467249aefa2 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 18:04:52 -0400 Subject: [PATCH 01/10] theme: fix css warnings --- homeManagerModules/theme.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/homeManagerModules/theme.nix b/homeManagerModules/theme.nix index c993771c..a98ed1f9 100644 --- a/homeManagerModules/theme.nix +++ b/homeManagerModules/theme.nix @@ -39,17 +39,17 @@ in { window.background { border-radius: ${toString cfg.borders.radius}; } tooltip { - &.background { - background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); - border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; - } - background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); border-radius: ${toString cfg.borders.radius}; border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; color: white; } + tooltip.background { + background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); + border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; + } + ${ lib.optionalString (config.stylix.polarity == "light") " tooltip { From 6c8e97ef473cf7cdd5218b8df7087abc71996122 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 18:25:23 -0400 Subject: [PATCH 02/10] use 24.05 release of stylix --- flake.lock | 57 ++++--------------- flake.nix | 2 +- .../services/randomWallpaper/default.nix | 2 +- 3 files changed, 12 insertions(+), 49 deletions(-) diff --git a/flake.lock b/flake.lock index 94ff3605..74b77e62 100644 --- a/flake.lock +++ b/flake.lock @@ -124,15 +124,15 @@ "base16-vim": { "flake": false, "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", - "owner": "tinted-theming", + "lastModified": 1663659192, + "narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=", + "owner": "chriskempson", "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d", "type": "github" }, "original": { - "owner": "tinted-theming", + "owner": "chriskempson", "repo": "base16-vim", "type": "github" } @@ -271,27 +271,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": [ - "stylix", - "systems" - ] - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -618,24 +597,23 @@ "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", "nixpkgs": [ "nixpkgs" - ], - "systems": "systems_4" + ] }, "locked": { - "lastModified": 1726170940, - "narHash": "sha256-sobkRkGBaMX9pD0bwU1iVPWi0WtQvZqlHyl1YtvNDio=", + "lastModified": 1718122552, + "narHash": "sha256-A+dBkSwp8ssHKV/WyXb9uqIYrHBqHvtSedU24Lq9lqw=", "owner": "danth", "repo": "stylix", - "rev": "35233f929629c8eb64e939e35260fc8347f94df9", + "rev": "e59d2c1725b237c362e4a62f5722f5b268d566c7", "type": "github" }, "original": { "owner": "danth", + "ref": "release-24.05", "repo": "stylix", "type": "github" } @@ -685,21 +663,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "wallpapers": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 44965c37..feef103c 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ stylix = { inputs.nixpkgs.follows = "nixpkgs"; - url = "github:danth/stylix"; + url = "github:danth/stylix/release-24.05"; }; wallpapers = { diff --git a/homeManagerModules/services/randomWallpaper/default.nix b/homeManagerModules/services/randomWallpaper/default.nix index 9bdd66bd..1a4c8ee1 100644 --- a/homeManagerModules/services/randomWallpaper/default.nix +++ b/homeManagerModules/services/randomWallpaper/default.nix @@ -8,7 +8,7 @@ in { config = lib.mkIf config.ar.home.services.randomWallpaper.enable { services.hyprpaper.enable = lib.mkForce false; - stylix.targets.hyprpaper.enable = lib.mkForce false; + # stylix.targets.hyprpaper.enable = lib.mkForce false; wayland.windowManager.sway.config.output."*" = lib.mkForce {}; # Dirty. TODO: make more elegant. systemd.user.services.randomWallpaper = { From 98f29bb022531b3cceeb3d7b438b8921194951c7 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 19:09:13 -0400 Subject: [PATCH 03/10] slateport: set image for stylix even though we don't use it --- hosts/slateport/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/slateport/default.nix b/hosts/slateport/default.nix index e2b99b75..a8b4d041 100644 --- a/hosts/slateport/default.nix +++ b/hosts/slateport/default.nix @@ -40,6 +40,11 @@ syncthing.guiAddress = "0.0.0.0:8384"; }; + stylix = { + enable = false; + image = "${self.inputs.wallpapers}/wallhaven-mp886k.jpg"; + }; + system.stateVersion = "24.05"; zramSwap.memoryPercent = 100; From 5ffd4dfc8bb8a616d7755eec123370489cad470d Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 19:38:22 -0400 Subject: [PATCH 04/10] backblaze: drop module --- homeManagerModules/apps/backblaze/default.nix | 29 ------------------- homeManagerModules/apps/default.nix | 1 - homeManagerModules/options.nix | 16 ---------- homes/aly/common.nix | 8 ----- homes/aly/secrets.nix | 2 -- hosts/mauville/home.nix | 11 +++++-- 6 files changed, 9 insertions(+), 58 deletions(-) delete mode 100644 homeManagerModules/apps/backblaze/default.nix diff --git a/homeManagerModules/apps/backblaze/default.nix b/homeManagerModules/apps/backblaze/default.nix deleted file mode 100644 index cf2d1fb7..00000000 --- a/homeManagerModules/apps/backblaze/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.ar.home.apps.backblaze; -in { - config = lib.mkIf cfg.enable { - home = { - activation.backblazeAuthentication = lib.hm.dag.entryAfter ["reloadSystemd"] '' - ${ - if ((cfg.keyIdFile != null) && (cfg.keyFile != null)) - then - ( - if !(builtins.pathExists "${config.xdg.configHome}/b2/account_info") - then '' - XDG_RUNTIME_DIR=''${XDG_RUNTIME_DIR:-/run/user/$(id -u)} - run --quiet ${lib.getExe pkgs.backblaze-b2} authorize_account `${lib.getExe' pkgs.coreutils "cat"} ${cfg.keyIdFile}` `${lib.getExe' pkgs.coreutils "cat"} ${cfg.keyFile}`'' - else ''run echo "backblaze: Already authenticated."'' - ) - else ''run echo "backblaze: Missing keyIDfile and keyFile."'' - } - ''; - - packages = with pkgs; [backblaze-b2]; - }; - }; -} diff --git a/homeManagerModules/apps/default.nix b/homeManagerModules/apps/default.nix index afeaf7d0..49eb4ece 100644 --- a/homeManagerModules/apps/default.nix +++ b/homeManagerModules/apps/default.nix @@ -1,7 +1,6 @@ { imports = [ ./alacritty - ./backblaze ./chromium ./emacs ./fastfetch diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index 10ce5f2f..f8eaf7de 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -11,22 +11,6 @@ in { apps = { alacritty.enable = lib.mkEnableOption "Alacritty terminal."; - backblaze = { - enable = lib.mkEnableOption "Backblaze-b2 client with declarative authentication."; - - keyIdFile = lib.mkOption { - description = "Backblaze key ID."; - default = null; - type = lib.types.nullOr lib.types.str; - }; - - keyFile = lib.mkOption { - description = "Backblaze application key."; - default = null; - type = lib.types.nullOr lib.types.str; - }; - }; - chromium = { enable = lib.mkEnableOption "Chromium-based browser with default extensions."; package = lib.mkPackageOption pkgs "brave" {}; diff --git a/homes/aly/common.nix b/homes/aly/common.nix index 8b07c359..d57c42f4 100644 --- a/homes/aly/common.nix +++ b/homes/aly/common.nix @@ -1,5 +1,4 @@ { - config, pkgs, ... }: { @@ -7,7 +6,6 @@ homeDirectory = "/home/aly"; packages = with pkgs; [ - browsh curl ]; @@ -47,12 +45,6 @@ ar.home = { apps = { - backblaze = { - enable = true; - keyIdFile = config.age.secrets.backblazeKeyId.path; - keyFile = config.age.secrets.backblazeKey.path; - }; - fastfetch.enable = true; helix.enable = true; shell.enable = true; diff --git a/homes/aly/secrets.nix b/homes/aly/secrets.nix index 65a1ad65..3e42d545 100644 --- a/homes/aly/secrets.nix +++ b/homes/aly/secrets.nix @@ -2,8 +2,6 @@ age.secrets = { achacegaGmail.file = ../../secrets/aly/mail/achacega_gmail.age; alyraffaufFastmail.file = ../../secrets/aly/mail/alyraffauf_fastmail.age; - backblazeKeyId.file = ../../secrets/aly/backblaze/keyId.age; - backblazeKey.file = ../../secrets/aly/backblaze/key.age; transmissionRemote = { file = ../../secrets/aly/transmissionRemote.age; diff --git a/hosts/mauville/home.nix b/hosts/mauville/home.nix index 1fbd291b..05dda53f 100644 --- a/hosts/mauville/home.nix +++ b/hosts/mauville/home.nix @@ -33,9 +33,14 @@ } ]; - users.aly = lib.mkForce { + users.aly = lib.mkForce ({config, ...}: { imports = [self.homeManagerModules.aly]; + age.secrets = { + backblazeKeyId.file = ../../secrets/aly/backblaze/keyId.age; + backblazeKey.file = ../../secrets/aly/backblaze/key.age; + }; + systemd.user = { services.backblaze-sync = { Unit.Description = "Backup to Backblaze."; @@ -61,6 +66,8 @@ ['/mnt/Archive/Shows']="b2://aly-shows" ) + backblaze-b2 authorize_account `cat ${config.age.secrets.backblazeKeyId.path}` `cat ${config.age.secrets.backblazeKey.path}` + # Recursively backup folders to B2 with sanity checks. for folder in "''${!backups[@]}"; do if [ -d "$folder" ] && [ "$(ls -A "$folder")" ]; then @@ -80,6 +87,6 @@ Unit.Description = "Daily backups to Backblaze."; }; }; - }; + }); }; } From c1198d679190769ece47b92b3db97d1cb0f53bf1 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 20:36:14 -0400 Subject: [PATCH 05/10] theme: better gtk css --- homeManagerModules/theme.nix | 100 +++++++++++++++++------------------ homes/aly/common.nix | 5 +- 2 files changed, 49 insertions(+), 56 deletions(-) diff --git a/homeManagerModules/theme.nix b/homeManagerModules/theme.nix index a98ed1f9..dcc25943 100644 --- a/homeManagerModules/theme.nix +++ b/homeManagerModules/theme.nix @@ -4,9 +4,9 @@ config, ... }: let - cfg = config.ar.home.theme; + cfg = config.ar.home; in { - config = lib.mkIf cfg.enable { + config = lib.mkIf cfg.theme.enable { home.packages = [ pkgs.gnome.adwaita-icon-theme pkgs.liberation_ttf @@ -35,60 +35,56 @@ in { }; }; - stylix.targets.gtk.extraCss = '' - window.background { border-radius: ${toString cfg.borders.radius}; } + stylix.targets.gtk.extraCss = builtins.concatStringsSep "\n" [ + (lib.optionalString (cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) '' + window.background { border-radius: ${toString cfg.theme.borders.radius}; } - tooltip { - background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); - border-radius: ${toString cfg.borders.radius}; - border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; - color: white; - } - - tooltip.background { - background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); - border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; - } - - ${ - lib.optionalString (config.stylix.polarity == "light") " tooltip { - &.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); } - background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); - }" - } + background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); + border-radius: ${toString cfg.theme.borders.radius}; + border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; + color: white; + } - ${ - lib.strings.optionalString - cfg.gtk.hideTitleBar - '' - /* No (default) title bar on wayland */ - headerbar.default-decoration { - /* You may need to tweak these values depending on your GTK theme */ - border-radius: 0; - border: 0; - box-shadow: none; - font-size: 0; - margin-bottom: 50px; - margin-top: -100px; - min-height: 0; - padding: 0; - } + tooltip.background { + background-color: alpha(${config.lib.stylix.colors.withHashtag.base00}, ${builtins.toString config.stylix.opacity.popups}); + border: 1px solid ${config.lib.stylix.colors.withHashtag.base0D}; + }'') - .titlebar, - .titlebar .background - { - border-radius: 0; - } + (lib.optionalString ( + (cfg.desktop.hyprland.enable || cfg.desktop.sway.enable) && (config.stylix.polarity == "light") + ) '' + tooltip { + &.background { background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); } + background-color: alpha(${config.lib.stylix.colors.withHashtag.base05}, ${builtins.toString config.stylix.opacity.popups}); + }'') - /* rm -rf window shadows */ - window.csd, /* gtk4? */ - window.csd decoration { /* gtk3 */ - border-radius: 0; - box-shadow: none; - } - '' - } - ''; + (lib.optionalString cfg.theme.gtk.hideTitleBar '' + /* No (default) title bar on wayland */ + headerbar.default-decoration { + /* You may need to tweak these values depending on your GTK theme */ + border-radius: 0; + border: 0; + box-shadow: none; + font-size: 0; + margin-bottom: 50px; + margin-top: -100px; + min-height: 0; + padding: 0; + } + + .titlebar, + .titlebar .background + { + border-radius: 0; + } + + /* rm -rf window shadows */ + window.csd, /* gtk4? */ + window.csd decoration { /* gtk3 */ + border-radius: 0; + box-shadow: none; + }'') + ]; }; } diff --git a/homes/aly/common.nix b/homes/aly/common.nix index d57c42f4..953dcad8 100644 --- a/homes/aly/common.nix +++ b/homes/aly/common.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: { +{pkgs, ...}: { home = { homeDirectory = "/home/aly"; From 3707a50b67a713aeb7b9c7aa757c67d70e2dbb17 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 21:31:31 -0400 Subject: [PATCH 06/10] aly: simplify hm config --- homes/aly/common.nix | 1 - homes/aly/gui.nix | 16 ++-------------- homes/aly/mail/default.nix | 2 +- hosts/lavaridge/default.nix | 3 +++ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/homes/aly/common.nix b/homes/aly/common.nix index 953dcad8..a19804af 100644 --- a/homes/aly/common.nix +++ b/homes/aly/common.nix @@ -45,7 +45,6 @@ fastfetch.enable = true; helix.enable = true; shell.enable = true; - tmux.enable = true; yazi.enable = true; }; }; diff --git a/homes/aly/gui.nix b/homes/aly/gui.nix index f48908d6..46138f44 100644 --- a/homes/aly/gui.nix +++ b/homes/aly/gui.nix @@ -1,9 +1,4 @@ -self: { - config, - lib, - pkgs, - ... -}: { +self: {pkgs, ...}: { imports = [ ./common.nix ./firefox @@ -34,11 +29,7 @@ self: { username = "aly"; }; - programs = { - git.extraConfig.core.editor = "${lib.getExe config.ar.home.apps.zed.package} --wait"; - rbw.settings.pinentry = pkgs.pinentry-gnome3; - }; - + programs.rbw.settings.pinentry = pkgs.pinentry-gnome3; systemd.user.startServices = "legacy"; # Needed for auto-mounting agenix secrets. ar.home = { @@ -46,14 +37,11 @@ self: { chromium.enable = true; firefox.enable = true; kitty.enable = true; - tmux.enable = true; vsCodium.enable = true; - zed.enable = true; }; defaultApps = { enable = true; - editor = config.ar.home.apps.zed.package; fileManager = pkgs.xfce.thunar; }; diff --git a/homes/aly/mail/default.nix b/homes/aly/mail/default.nix index 7794a813..5918424f 100644 --- a/homes/aly/mail/default.nix +++ b/homes/aly/mail/default.nix @@ -20,7 +20,7 @@ in { text = '' Thank you, Aly Raffauf - https://alyraffauf.com + https://aly.raffauflabs.com ''; showSignature = "append"; diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index a5d644a4..3abeacf1 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -39,6 +39,9 @@ environment.variables.GDK_SCALE = "2"; networking.hostName = "lavaridge"; programs.firefox.policies.Preferences."media.ffmpeg.vaapi.enabled" = lib.mkForce false; + # services.xserver.enable = true; + # services.xserver.displayManager.gdm.enable = true; + # services.xserver.desktopManager.gnome.enable = true; system.stateVersion = "24.05"; ar = { From d76f755c0697889a43315ac57ef38311215a8cb3 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 22:11:08 -0400 Subject: [PATCH 07/10] aly/firefox: install bitwarden --- homes/aly/firefox/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homes/aly/firefox/default.nix b/homes/aly/firefox/default.nix index d7c33cb2..158ee4a9 100644 --- a/homes/aly/firefox/default.nix +++ b/homes/aly/firefox/default.nix @@ -10,6 +10,7 @@ default = { extensions = with config.nur.repos.rycee.firefox-addons; [ augmented-steam + bitwarden omnivore raindropio sidebery From dba25d24af3788550b12b59faf7718697543d066 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 17 Sep 2024 22:12:20 -0400 Subject: [PATCH 08/10] slateport/fail2ban: increase bantime 8h->24h --- hosts/slateport/raffauflabs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/slateport/raffauflabs.nix b/hosts/slateport/raffauflabs.nix index 9204ea4d..0079ab31 100644 --- a/hosts/slateport/raffauflabs.nix +++ b/hosts/slateport/raffauflabs.nix @@ -38,7 +38,7 @@ in { fail2ban = { enable = true; - bantime = "1h"; + bantime = "24h"; bantime-increment.enable = true; }; From 2d9ae2764ab9cbcf5c39fc983e7329df1495819a Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 18 Sep 2024 08:14:15 -0400 Subject: [PATCH 09/10] flake: bump nixhw --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 74b77e62..c57cd188 100644 --- a/flake.lock +++ b/flake.lock @@ -444,11 +444,11 @@ ] }, "locked": { - "lastModified": 1726585211, - "narHash": "sha256-6Ra4qRRWYurpdn0vsIysNxpGXz+m/9IGbXdHr0P+gac=", + "lastModified": 1726660103, + "narHash": "sha256-6dTw76l3zyBxW2a5Xn6UfY+uFzcJgyN4IiM8tI9Vu5I=", "owner": "alyraffauf", "repo": "nixhw", - "rev": "f7aad63bc3f59826fd16ff748dfa3607ce2f490e", + "rev": "19c6cdbfe1b757aa71b9ef9e9285fb1581704be9", "type": "github" }, "original": { From e30d92fd7045a90e98a0f13a2c6bd943a233eca3 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 18 Sep 2024 12:33:00 -0400 Subject: [PATCH 10/10] wifi: add new wifi --- common/wifi.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/wifi.nix b/common/wifi.nix index 4e41e127..04e09c7a 100644 --- a/common/wifi.nix +++ b/common/wifi.nix @@ -42,6 +42,7 @@ in { "InmanPerkCustomer" = mkWPA2WiFi "InmanPerkCustomer" "$InmanPerkCustomerPSK"; "Muchacho Guest" = mkOpenWiFi "Muchacho Guest"; "PERCguest" = mkWPA2WiFi "PERCguest" "$PERCguestPSK"; + "PERC COFFEE 5 Guest" = mkWPA2WiFi "PERC COFFEE 5 Guest" "$PERCguestPSK"; "Parkgrounds1" = mkWPA2WiFi "Parkgrounds1" "$Parkgrounds1PSK"; "Stargate-Discovery" = mkWPA2WiFi "Stargate-Discovery" "$StargateDiscoveryPSK"; "Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi";