From 7b10e526a7001d79b65a04f0c49a6f5454edfee1 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Thu, 23 Nov 2023 22:55:58 +0300 Subject: [PATCH] Use my FlakeTools and rearrange specialArgs --- flake.lock | 36 +----------------------------- flake.nix | 29 +++++++++++++++--------- machines/enka/default.nix | 2 +- machines/enka/dunst/default.nix | 6 +++-- machines/enka/fuzzel/default.nix | 6 +++-- machines/enka/hyprland/default.nix | 8 ++++--- machines/enka/kitty/default.nix | 6 +++-- machines/enka/nushell/default.nix | 2 +- 8 files changed, 38 insertions(+), 57 deletions(-) diff --git a/flake.lock b/flake.lock index 7a7eb8e..ae9deb9 100644 --- a/flake.lock +++ b/flake.lock @@ -125,8 +125,7 @@ "fenix": "fenix", "homeManager": "homeManager", "hyprland": "hyprland", - "nixpkgs": "nixpkgs_2", - "utils": "utils" + "nixpkgs": "nixpkgs_2" } }, "rust-analyzer-src": { @@ -161,39 +160,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "utils": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "wlroots": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 2ae251a..a998997 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - utils = { - url = "github:numtide/flake-utils"; + tools = { + url = "github:RGBCube/FlakeTools"; + inputs.nixpkgs.follows = "nixpkgs"; }; fenix = { @@ -37,12 +38,22 @@ }; }; - outputs = { nixpkgs, homeManager, utils, fenix, ... } @ inputs: utils.lib.eachDefaultSystem (system: let + outputs = { nixpkgs, homeManager, tools, fenix, ... } @ inputs: tools.eachDefaultArch (system: let + upkgs = { + theme = import ./themes/gruvbox.nix; + + hyprland = inputs.hyprland.packages.${system}.default; + }; + lib = nixpkgs.lib; - ulib = rec { - recursiveUpdate3 = x: y: z: lib.recursiveUpdate x (lib.recursiveUpdate y z); + ulib = { + inherit (tools) recursiveUpdateMap; + recursiveUpdate3 = x: y: z: lib.recursiveUpdate x (lib.recursiveUpdate y z); + }; + + abstractions = rec { importAll = paths: { imports = paths; }; @@ -76,10 +87,6 @@ }; }; - theme = import ./themes/gruvbox.nix; - - hyprland = inputs.hyprland.packages.${system}.default; - defaultConfiguration = host: ulib.systemConfiguration { nix.gc = { automatic = true; @@ -110,8 +117,8 @@ home-manager.useUserPackages = true; }; - specialArgs = ulib // { - inherit theme hyprland; + specialArgs = abstractions // { + inherit upkgs ulib; }; importConfiguration = host: lib.nixosSystem { diff --git a/machines/enka/default.nix b/machines/enka/default.nix index 23fbf05..ece306a 100644 --- a/machines/enka/default.nix +++ b/machines/enka/default.nix @@ -1,4 +1,4 @@ -{ recursiveUpdate3, systemConfiguration, homeConfiguration, importAll, ... }: recursiveUpdate3 +{ ulib, systemConfiguration, homeConfiguration, importAll, ... }: ulib.recursiveUpdate3 (systemConfiguration { boot.loader = { diff --git a/machines/enka/dunst/default.nix b/machines/enka/dunst/default.nix index 9686ed3..efffbb1 100644 --- a/machines/enka/dunst/default.nix +++ b/machines/enka/dunst/default.nix @@ -1,7 +1,9 @@ -{ pkgs, theme, homeConfiguration, enabled, ... }: +{ pkgs, upkgs, homeConfiguration, enabled, ... }: homeConfiguration "nixos" { - services.dunst = enabled { + services.dunst = let + inherit (upkgs) theme; + in enabled { iconTheme = { name = "Gruvbox-Dark"; package = pkgs.gruvbox-dark-icons-gtk; diff --git a/machines/enka/fuzzel/default.nix b/machines/enka/fuzzel/default.nix index b3b84f1..f35b391 100644 --- a/machines/enka/fuzzel/default.nix +++ b/machines/enka/fuzzel/default.nix @@ -1,4 +1,4 @@ -{ theme, homeConfiguration, enabled, ... }: +{ upkgs, homeConfiguration, enabled, ... }: homeConfiguration "nixos" { programs.fuzzel = enabled { @@ -16,7 +16,9 @@ homeConfiguration "nixos" { inner-pad = 10; }; - settings.colors = { + settings.colors = let + inherit (upkgs) theme; + in { background = theme.background + theme.transparency; text = theme.foreground + theme.transparency; match = theme.activeHighlight + theme.transparency; diff --git a/machines/enka/hyprland/default.nix b/machines/enka/hyprland/default.nix index 391d4ef..b52de95 100644 --- a/machines/enka/hyprland/default.nix +++ b/machines/enka/hyprland/default.nix @@ -1,4 +1,4 @@ -{ pkgs, recursiveUpdate3, hyprland, theme, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: recursiveUpdate3 +{ pkgs, upkgs, ulib, theme, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: ulib.recursiveUpdate3 (systemConfiguration { hardware.opengl = enabled {}; @@ -12,9 +12,11 @@ (homeConfiguration "nixos" { wayland.windowManager.hyprland = enabled { - package = hyprland; + package = upkgs.hyprland; - extraConfig = + extraConfig = let + inherit (upkgs) theme; + in '' monitor = , preferred, auto, 1 '' diff --git a/machines/enka/kitty/default.nix b/machines/enka/kitty/default.nix index afd9bac..29d1404 100644 --- a/machines/enka/kitty/default.nix +++ b/machines/enka/kitty/default.nix @@ -1,4 +1,4 @@ -{ pkgs, theme, homeConfiguration, enabled, ... }: +{ pkgs, upkgs, homeConfiguration, enabled, ... }: homeConfiguration "nixos" { programs.kitty = enabled { @@ -12,7 +12,9 @@ homeConfiguration "nixos" { theme = "Gruvbox Dark"; - settings = { + settings = let + inherit (upkgs) theme; + in { allow_remote_control = true; confirm_os_window_close = 0; focus_follows_mouse = true; diff --git a/machines/enka/nushell/default.nix b/machines/enka/nushell/default.nix index 23b8a22..1c7a9e4 100644 --- a/machines/enka/nushell/default.nix +++ b/machines/enka/nushell/default.nix @@ -1,4 +1,4 @@ -{ pkgs, recursiveUpdate3, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: recursiveUpdate3 +{ pkgs, ulib, systemConfiguration, homeConfiguration, homePackages, enabled, ... }: ulib.recursiveUpdate3 (systemConfiguration { users.defaultUserShell = pkgs.nushell;