From 9acd24afd47e5b358db8b3ccee463cca6742654f Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Wed, 2 Oct 2024 16:45:43 +0200 Subject: [PATCH] repo: add niri hm config, theme nixos instead of hm, add regreet/greetd config --- home/default.nix | 4 ---- home/profiles/vamos/default.nix | 8 ++++++- home/programs/niri/default.nix | 39 ++++++++++++++++++++++++++++++++ home/terminal/emulators/foot.nix | 4 ++-- hosts/default.nix | 13 ++++++++--- hosts/vamos/default.nix | 2 +- system/programs/niri/default.nix | 11 ++++----- system/services/greetd.nix | 24 -------------------- system/services/regreet.nix | 20 ++++++++++++++++ 9 files changed, 84 insertions(+), 41 deletions(-) create mode 100644 home/programs/niri/default.nix delete mode 100644 system/services/greetd.nix create mode 100644 system/services/regreet.nix diff --git a/home/default.nix b/home/default.nix index 9f93a5d..0f073b4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -5,7 +5,6 @@ }: { imports = [ ./terminal - self.nixosModules.theme ]; home = { username = "nezia"; @@ -14,7 +13,4 @@ }; programs.home-manager.enable = true; - - theme.wallpaper = lib.mkDefault ../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg; - theme.scheme = lib.mkDefault "catppuccin-frappe"; } diff --git a/home/profiles/vamos/default.nix b/home/profiles/vamos/default.nix index 1031b40..dc02b68 100644 --- a/home/profiles/vamos/default.nix +++ b/home/profiles/vamos/default.nix @@ -1,8 +1,14 @@ -{self, ...}: { +{ + self, + pkgs, + ... +}: { imports = [ "${self}/home/services/udiskie.nix" "${self}/home/programs" + + "${self}/home/programs/niri" "${self}/home/programs/fuzzel.nix" "${self}/home/terminal/emulators/foot.nix" diff --git a/home/programs/niri/default.nix b/home/programs/niri/default.nix new file mode 100644 index 0000000..661da1c --- /dev/null +++ b/home/programs/niri/default.nix @@ -0,0 +1,39 @@ +{ + config, + lib, + pkgs, + ... +}: let + appLauncher = lib.getExe pkgs.fuzzel; + terminal = lib.getExe pkgs.foot; +in { + # TODO: put this into the theme module to avoid repeating in greeter config + home.pointerCursor = { + gtk.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + }; + + programs.niri = { + settings = { + environment."NIXOS_OZONE_WL" = "1"; + prefer-no-csd = true; + binds = { + "Mod+D".action.spawn = appLauncher; + "Mod+Return".action.spawn = terminal; + "Mod+Shift+E".action.quit.skip-confirmation = true; + "Mod+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay; + "Mod+Q".action = config.lib.niri.actions.close-window; + "Mod+F".action = config.lib.niri.actions.maximize-column; + }; + window-rules = [ + { + matches = [ + {app-id = "foot";} + ]; + default-column-width = {proportion = 0.5;}; + } + ]; + }; + }; +} diff --git a/home/terminal/emulators/foot.nix b/home/terminal/emulators/foot.nix index cec4b0d..6fb3795 100644 --- a/home/terminal/emulators/foot.nix +++ b/home/terminal/emulators/foot.nix @@ -1,6 +1,6 @@ { inputs, - config, + nixosConfig, ... }: { programs.foot = { @@ -11,7 +11,7 @@ font = "monospace:size=14"; }; colors = let - inherit (config.theme) scheme; + inherit (nixosConfig.theme) scheme; schemeData = inputs.basix.schemeData.base16.${scheme}; in { background = schemeData.palette.base00; diff --git a/hosts/default.nix b/hosts/default.nix index 83f4170..e7dcedc 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,6 +1,7 @@ { self, inputs, + lib, ... }: { flake.nixosConfigurations = let @@ -19,11 +20,16 @@ ++ [ ./vamos - ../system/services/greetd.nix - - # "${mod}/programs/kde.nix" + ../system/services/regreet.nix "${mod}/programs/niri" + self.nixosModules.theme + + { + theme.wallpaper = lib.mkDefault ../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg; + theme.scheme = lib.mkDefault "catppuccin-frappe"; + } + { home-manager = { users.nezia.imports = homeImports.vamos; @@ -45,6 +51,7 @@ "${mod}/programs/kde.nix" "${mod}/hardware/nvidia.nix" + self.nixosModules.theme { home-manager = { users.nezia.imports = homeImports.solaire; diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index aaeae31..c81507f 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,4 +1,4 @@ -{...}: { +{lib, ...}: { imports = [ ./hardware-configuration.nix ]; diff --git a/system/programs/niri/default.nix b/system/programs/niri/default.nix index 92dd5c3..17c8b2a 100644 --- a/system/programs/niri/default.nix +++ b/system/programs/niri/default.nix @@ -1,9 +1,8 @@ -{ - inputs, - pkgs, - ... -}: { - imports = [inputs.niri.nixosModules.niri]; +{inputs, ...}: { + imports = [ + inputs.niri.nixosModules.niri + ]; + programs.niri = { enable = true; }; diff --git a/system/services/greetd.nix b/system/services/greetd.nix deleted file mode 100644 index 4195e3f..0000000 --- a/system/services/greetd.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: { - programs.regreet.enable = true; - - # greetd display manager - services.greetd = { - enable = true; - settings = { - default_session = let - greeter = lib.getExe config.programs.regreet.package; - program = "${lib.getExe pkgs.cage} -s"; - in { - command = "${program} -- ${greeter}"; - user = "nezia"; - }; - # unlock GPG keyring on login - security.pam.services.greetd.enableGnomeKeyring = true; - }; - }; -} diff --git a/system/services/regreet.nix b/system/services/regreet.nix new file mode 100644 index 0000000..3ac6d5e --- /dev/null +++ b/system/services/regreet.nix @@ -0,0 +1,20 @@ +{ + inputs, + config, + ... +}: { + programs.regreet = { + enable = true; + cageArgs = [ + "-s" + "-d" + ]; + settings = { + GTK = let + schemeData = inputs.basix.schemeData.base16.${config.theme.scheme}; + in { + application_prefer_dark_theme = schemeData.variant == "dark"; + }; + }; + }; +}