diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2023-12-20 13:33:35 +0100 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2023-12-20 13:33:35 +0100 |
| commit | c89edb0b37c6343d32c146547dfb54fcdb69b158 (patch) | |
| tree | f810c4f730d391fc6a40dfc807fb1b6a302dcf99 /modules | |
| parent | c62c1c07b9acaebc4d51d8464d35fd0c3b0dfc20 (diff) | |
| parent | 29f64105bca9f528d2b9812cb7d490a27c6a2633 (diff) | |
Merge branch 'master' into devenv
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/home-manager/personal/environment.nix | 24 | ||||
| -rw-r--r-- | modules/nixos/personal/gui.nix | 45 |
2 files changed, 38 insertions, 31 deletions
diff --git a/modules/home-manager/personal/environment.nix b/modules/home-manager/personal/environment.nix index c97faff..867757e 100644 --- a/modules/home-manager/personal/environment.nix +++ b/modules/home-manager/personal/environment.nix @@ -1,11 +1,14 @@ -{ config, lib, pkgs, ... }: - { - home.packages = with pkgs; [ coreutils moreutils ]; + config, + lib, + pkgs, + ... +} @ inputs: { + home.packages = with pkgs; [coreutils moreutils]; personal.home.wallpaper = - lib.mkDefault pkgs.personal.static.wallpapers.nga-1973-68-1; + lib.mkDefault (inputs.osConfig.stylix.image or (pkgs.personal.static.wallpapers.nga-1973-68-1.override {gravity = "north";})); - programs.bash = { enable = lib.mkDefault true; }; + programs.bash = {enable = lib.mkDefault true;}; home = { shellAliases = { @@ -14,15 +17,16 @@ ssh = "TERM=xterm-256color ssh"; edit = "$EDITOR"; }; - sessionVariables = { CDPATH = "~"; }; + sessionVariables = {CDPATH = "~";}; }; services.gpg-agent = { enableBashIntegration = lib.mkDefault config.programs.bash.enable; - pinentryFlavor = lib.mkDefault (if config.personal.gui.enable then - "qt" - else - "tty"); + pinentryFlavor = lib.mkDefault ( + if config.personal.gui.enable + then "qt" + else "tty" + ); grabKeyboardAndMouse = lib.mkDefault false; # insecure, but necessary with keepass auto-type }; diff --git a/modules/nixos/personal/gui.nix b/modules/nixos/personal/gui.nix index 64c732e..88f8fa2 100644 --- a/modules/nixos/personal/gui.nix +++ b/modules/nixos/personal/gui.nix @@ -1,8 +1,11 @@ -{ config, lib, pkgs, ... }@extraArgs: - -let +{ + config, + lib, + pkgs, + ... +} @ extraArgs: let cfg = config.personal.gui; - wallpaper = pkgs.personal.static.wallpapers.nga-1973-68-1; + wallpaper = pkgs.personal.static.wallpapers.nga-1973-68-1.override {gravity = "north";}; importedStylix = extraArgs ? stylix; in { imports = lib.optional importedStylix extraArgs.stylix.nixosModules.stylix; @@ -22,7 +25,7 @@ in { displayManager = { lightdm = { enable = true; - background = lib.mkDefault wallpaper; + background = lib.mkDefault (config.stylix.image or wallpaper); greeters.gtk = { enable = true; extraConfig = '' @@ -56,22 +59,22 @@ in { }; }) (lib.mkIf cfg.stylix.enable ({ - assertions = let - missingArgAssertion = name: { - assertion = lib.hasAttr name extraArgs; - message = - "attribute ${name} missing: add it in lib.nixosSystem's specialArgs, or set config.personal.gui.stylix.enable to false"; - }; - in [ (missingArgAssertion "stylix") ]; - } // lib.optionalAttrs importedStylix { - stylix = { - image = lib.mkDefault wallpaper; - polarity = lib.mkDefault "dark"; - fonts.sizes = { - applications = 10; - desktop = 12; + assertions = let + missingArgAssertion = name: { + assertion = lib.hasAttr name extraArgs; + message = "attribute ${name} missing: add it in lib.nixosSystem's specialArgs, or set config.personal.gui.stylix.enable to false"; + }; + in [(missingArgAssertion "stylix")]; + } + // lib.optionalAttrs importedStylix { + stylix = { + image = lib.mkDefault wallpaper; + polarity = lib.mkDefault "dark"; + fonts.sizes = { + applications = 10; + desktop = 12; + }; }; - }; - })) + })) ]); } |
