summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------.pre-commit-config.yaml2
-rw-r--r--flake.lock24
-rw-r--r--modules/home-manager/personal/environment.nix24
-rw-r--r--modules/nixos/personal/gui.nix45
-rw-r--r--pkgs/static/wallpapers/default.nix54
5 files changed, 85 insertions, 64 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 011ba58..69e64d6 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": 1703066966,
+ "narHash": "sha256-MbX0XYOEvAuXwi80emHKJsjo1IGQZhoKKnEp2uzgNx4=",
"owner": "cachix",
"repo": "devenv",
- "rev": "a7c4dd8f4eb1f98a6b8f04bf08364954e1e73e4f",
+ "rev": "405a4c6a3fecfd2a7fb37cc13f4e760658e522e6",
"type": "github"
},
"original": {
@@ -136,11 +136,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1701626906,
- "narHash": "sha256-ugr1QyzzwNk505ICE4VMQzonHQ9QS5W33xF2FXzFQ00=",
+ "lastModified": 1702938738,
+ "narHash": "sha256-O7Vb0xC9s4Dmgxj8APEpuuMj7HsLgPbpy1UKvNVJp7o=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "0c6d8c783336a59f4c59d4a6daed6ab269c4b361",
+ "rev": "dd8e82f3b4017b8faa52c2b1897a38d53c3c26cb",
"type": "github"
},
"original": {
@@ -202,11 +202,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1701589523,
- "narHash": "sha256-7LK019+Y9khM18WjIt4ISK2yd1P5z+CXJq0ts+E13UA=",
+ "lastModified": 1702938738,
+ "narHash": "sha256-O7Vb0xC9s4Dmgxj8APEpuuMj7HsLgPbpy1UKvNVJp7o=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "ec04772e7516b6d58d98b491e68b329b7558b14d",
+ "rev": "dd8e82f3b4017b8faa52c2b1897a38d53c3c26cb",
"type": "github"
},
"original": {
@@ -216,11 +216,11 @@
},
"nur": {
"locked": {
- "lastModified": 1701636328,
- "narHash": "sha256-tUG15xG0nx5aG1Ezw3Y3OOdVqb0NFiXDu7Dnla+T6Vs=",
+ "lastModified": 1703075302,
+ "narHash": "sha256-HrfEvMw4DPoNJ/uPS/bu1T8lUU7V3oSabfS+u6a73Og=",
"owner": "nix-community",
"repo": "NUR",
- "rev": "d52153ca963cb8072332dc18c3665626fec86647",
+ "rev": "075964f8e9a623bb8df3e414a682b2715b9c4b6e",
"type": "github"
},
"original": {
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;
+ };
};
- };
- }))
+ }))
]);
}
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