From a56f275e61dc48ec995da1c456ee66a8f4309de6 Mon Sep 17 00:00:00 2001 From: aristote Date: Mon, 18 Dec 2023 16:13:27 +0100 Subject: flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'devenv': 'github:cachix/devenv/a7c4dd8f4eb1f98a6b8f04bf08364954e1e73e4f' (2023-11-28) → 'github:cachix/devenv/e681a99ffe2d2882f413a5d771129223c838ddce' (2023-12-14) • Updated input 'devenv/nixpkgs': 'github:NixOS/nixpkgs/ec04772e7516b6d58d98b491e68b329b7558b14d' (2023-12-03) → 'github:NixOS/nixpkgs/aa9d4729cbc99dabacb50e3994dcefb3ea0f7447' (2023-12-14) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/ec04772e7516b6d58d98b491e68b329b7558b14d' (2023-12-03) → 'github:NixOS/nixpkgs/aa9d4729cbc99dabacb50e3994dcefb3ea0f7447' (2023-12-14) • Updated input 'nur': 'github:nix-community/NUR/d52153ca963cb8072332dc18c3665626fec86647' (2023-12-03) → 'github:nix-community/NUR/5d62db8546cf2cade0992be6d7a3878f3a88a4b2' (2023-12-18) --- .pre-commit-config.yaml | 2 +- flake.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c42ee1f..3c88dcc 120000 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1 +1 @@ -/nix/store/25dvkf0gi6kqdg32vjf5snzh50aqipx1-pre-commit-config.json \ No newline at end of file +/nix/store/r9vc7y39vl5v8p5r88apn8ncxzf2i70g-pre-commit-config.json \ No newline at end of file diff --git a/flake.lock b/flake.lock index 54899ff..f43e8b6 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1701187605, - "narHash": "sha256-NctguPdUeDVLXFsv6vI1RlEiHLsXkeW3pgZe/mwn1BU=", + "lastModified": 1702549996, + "narHash": "sha256-mEN+8gjWUXRxBCcixeth+jlDNuzxbpFwZNOEc4K22vw=", "owner": "cachix", "repo": "devenv", - "rev": "a7c4dd8f4eb1f98a6b8f04bf08364954e1e73e4f", + "rev": "e681a99ffe2d2882f413a5d771129223c838ddce", "type": "github" }, "original": { @@ -136,11 +136,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701589523, - "narHash": "sha256-7LK019+Y9khM18WjIt4ISK2yd1P5z+CXJq0ts+E13UA=", + "lastModified": 1702539185, + "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ec04772e7516b6d58d98b491e68b329b7558b14d", + "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", "type": "github" }, "original": { @@ -202,11 +202,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1701589523, - "narHash": "sha256-7LK019+Y9khM18WjIt4ISK2yd1P5z+CXJq0ts+E13UA=", + "lastModified": 1702539185, + "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ec04772e7516b6d58d98b491e68b329b7558b14d", + "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", "type": "github" }, "original": { @@ -216,11 +216,11 @@ }, "nur": { "locked": { - "lastModified": 1701636328, - "narHash": "sha256-tUG15xG0nx5aG1Ezw3Y3OOdVqb0NFiXDu7Dnla+T6Vs=", + "lastModified": 1702910532, + "narHash": "sha256-pbuL3mLubyEEJMTuNKHiIuzO6A4UFRSfsq2IZWswVcw=", "owner": "nix-community", "repo": "NUR", - "rev": "d52153ca963cb8072332dc18c3665626fec86647", + "rev": "5d62db8546cf2cade0992be6d7a3878f3a88a4b2", "type": "github" }, "original": { -- cgit v1.2.3 From 9499aa240e5ad0d040e52bd9732619350fc0b950 Mon Sep 17 00:00:00 2001 From: aristote Date: Mon, 18 Dec 2023 16:16:28 +0100 Subject: nixos & home: use commmon wallpaper by default --- modules/home-manager/personal/environment.nix | 24 ++++++++------- modules/nixos/personal/gui.nix | 43 ++++++++++++++------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/modules/home-manager/personal/environment.nix b/modules/home-manager/personal/environment.nix index c97faff..3c674de 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); - 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..6e2a5d7 100644 --- a/modules/nixos/personal/gui.nix +++ b/modules/nixos/personal/gui.nix @@ -1,6 +1,9 @@ -{ config, lib, pkgs, ... }@extraArgs: - -let +{ + config, + lib, + pkgs, + ... +} @ extraArgs: let cfg = config.personal.gui; wallpaper = pkgs.personal.static.wallpapers.nga-1973-68-1; importedStylix = extraArgs ? 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; + }; }; - }; - })) + })) ]); } -- cgit v1.2.3 From 29f64105bca9f528d2b9812cb7d490a27c6a2633 Mon Sep 17 00:00:00 2001 From: aristote Date: Mon, 18 Dec 2023 17:04:26 +0100 Subject: pkgs: wallpapers: change options --- modules/home-manager/personal/environment.nix | 2 +- modules/nixos/personal/gui.nix | 2 +- pkgs/static/wallpapers/default.nix | 54 +++++++++++++++++---------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/modules/home-manager/personal/environment.nix b/modules/home-manager/personal/environment.nix index 3c674de..867757e 100644 --- a/modules/home-manager/personal/environment.nix +++ b/modules/home-manager/personal/environment.nix @@ -6,7 +6,7 @@ } @ inputs: { home.packages = with pkgs; [coreutils moreutils]; personal.home.wallpaper = - lib.mkDefault (inputs.osConfig.stylix.image or 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;}; diff --git a/modules/nixos/personal/gui.nix b/modules/nixos/personal/gui.nix index 6e2a5d7..88f8fa2 100644 --- a/modules/nixos/personal/gui.nix +++ b/modules/nixos/personal/gui.nix @@ -5,7 +5,7 @@ ... } @ 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; diff --git a/pkgs/static/wallpapers/default.nix b/pkgs/static/wallpapers/default.nix index f0b8d46..a0efda3 100644 --- a/pkgs/static/wallpapers/default.nix +++ b/pkgs/static/wallpapers/default.nix @@ -1,22 +1,36 @@ -{ stdenv, fetchurl, imagemagick, lib }: - -let +{ + stdenv, + fetchurl, + imagemagick, + lib, +}: let fetchWallpaper = lib.makeOverridable ( - { name, url, sha256, resolution ? "1920x1080", offset ? "0x0" }: - stdenv.mkDerivation { - inherit name; - src = fetchurl { - inherit url sha256; - }; - buildInputs = [ imagemagick ]; - phases = [ "unpackPhase" ]; - unpackPhase = '' - convert "$src" -resize "${resolution}^" \ - -crop "${resolution}+${offset}" \ - "$out" - ''; - }); + { + name, + url, + sha256, + resolution ? "1920x1080", + ratio ? "16:9", + gravity ? "center", + }: + stdenv.mkDerivation { + inherit name; + src = fetchurl { + inherit url sha256; + }; + buildInputs = [imagemagick]; + phases = ["unpackPhase"]; + unpackPhase = '' + convert "$src" -gravity '${gravity}' \ + -extent '${ratio}' \ + -resize '${resolution}!' \ + "$out" + ''; + } + ); sources = lib.importJSON ./sources.json; -in { - fetcher = fetchWallpaper; -} // builtins.mapAttrs (_: fetchWallpaper) sources +in + { + fetcher = fetchWallpaper; + } + // builtins.mapAttrs (_: fetchWallpaper) sources -- cgit v1.2.3