refactor(flake): refactor lib for flake-parts

This commit is contained in:
Artur Manuel 2025-02-02 16:37:47 +00:00
commit 6f79c94f11
6 changed files with 70 additions and 71 deletions

40
flake.lock generated
View file

@ -9,11 +9,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1738328739, "lastModified": 1738499276,
"narHash": "sha256-LHxIpDEsQ1MoIeAJSuUznJWLzFhceUPcCb8x1mRe/Fk=", "narHash": "sha256-w1DEom//LsBM+hQ7PO5p4tpTE7yBmW05Rgw94uPkIUY=",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "61b2c985f6b4e07a7f2c44928a0e45fe6315ed96", "rev": "316741ee3d1b0f6baea9af0f177db26455bf728b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -100,11 +100,11 @@
"nixpkgs-lib": ["nixpkgs"] "nixpkgs-lib": ["nixpkgs"]
}, },
"locked": { "locked": {
"lastModified": 1736143030, "lastModified": 1738453229,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -314,11 +314,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1738142207, "lastModified": 1738410390,
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -374,11 +374,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1738142207, "lastModified": 1738410390,
"narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -615,11 +615,11 @@
"nvf": "nvf" "nvf": "nvf"
}, },
"locked": { "locked": {
"lastModified": 1738191670, "lastModified": 1738465927,
"narHash": "sha256-9FdrtLQvXKKsWwu1jLQrV0UnC54+9HBkfs1h2a8XlcM=", "narHash": "sha256-HWfSQMxa4Cpxyo44cY3Y4OzsBu4etaeejsENUjUHUss=",
"ref": "master", "ref": "master",
"rev": "dbc066fed939618282f1f079ddc5b4d5e89c39a7", "rev": "841cddc0a522974439fe3332233ff334b7309e96",
"revCount": 20, "revCount": 21,
"type": "git", "type": "git",
"url": "https://codeberg.org/amadaluzia/painless-neovim.git" "url": "https://codeberg.org/amadaluzia/painless-neovim.git"
}, },
@ -3444,16 +3444,16 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1738363663, "lastModified": 1738503390,
"narHash": "sha256-e3OQX21urTH68U80oL4PxIIISD6LuI1aJa62YNCPAZM=", "narHash": "sha256-k+lXb31oXWD2Sc8/+F4Tw9IAOEvi14e3hnx/hpBSbcE=",
"owner": "amadaluzia", "owner": "amadaluzia",
"repo": "wallpkgs", "repo": "wallpkgs",
"rev": "c0e09f07d46e3fe51e8198fee9003ac3ed282fbe", "rev": "bd56d6c493bc7338000842663b07362085fc1462",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "amadaluzia", "owner": "amadaluzia",
"ref": "nord", "ref": "docs-fixup",
"repo": "wallpkgs", "repo": "wallpkgs",
"type": "github" "type": "github"
} }

View file

@ -35,7 +35,7 @@
type = "github"; type = "github";
owner = "amadaluzia"; owner = "amadaluzia";
repo = "wallpkgs"; repo = "wallpkgs";
ref = "nord"; ref = "docs-fixup";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
pankomacs = { pankomacs = {
@ -67,11 +67,10 @@
}; };
outputs = inputs @ { outputs = inputs @ {
self, self,
nixpkgs,
flake-parts, flake-parts,
... ...
}: let }: let
lib = nixpkgs.lib.extend (import ./lib {inherit inputs self;}); inherit ((import ./lib {inherit inputs self;}).flake) lib;
in in
flake-parts.lib.mkFlake { flake-parts.lib.mkFlake {
inherit inputs; inherit inputs;
@ -82,7 +81,7 @@
./hosts ./hosts
./overlays ./overlays
./shells ./shells
./lib
]; ];
flake = {inherit lib;};
}; };
} }

View file

@ -4,7 +4,7 @@
... ...
}: { }: {
flake = { flake = {
nixosConfigurations = lib.mkHosts { nixosConfigurations = builtins.mapAttrs (n: v: lib.mkHost (v // {host = n;})) {
python = { python = {
system = "x86_64-linux"; system = "x86_64-linux";
extraModules = [ extraModules = [

View file

@ -8,13 +8,12 @@
tmpfiles = { tmpfiles = {
".config/qutebrowser/config.py" = ./configs/qutebrowser/config.py; ".config/qutebrowser/config.py" = ./configs/qutebrowser/config.py;
".config/qutebrowser/theme" = ./configs/qutebrowser/theme; ".config/qutebrowser/theme" = ./configs/qutebrowser/theme;
".config/vesktop/themes/system24.theme.css" = pkgs.fetchurl { ".config/vesktop/themes/theme.user.css" = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/refact0r/system24/refs/heads/main/theme/system24.theme.css"; url = "https://github.com/deathbeam/base16-discord/raw/refs/heads/main/themes/base16-nord.theme.css";
hash = "sha256-WJYNWeo1DdgOh7cFne6QSEHQagqapFznqWfeoCsqM+8="; hash = "sha256-LofqgsVl+XKisk/dmb/PpwuLEWdEgchIfIw4xZs6LQw=";
}; };
".config/vesktop/settings/quickCss.css" = ./configs/vesktop/quickCss.css; ".config/vesktop/settings/quickCss.css" = ./configs/vesktop/quickCss.css;
".config/kanshi/" = ./configs/kanshi; ".config/kanshi/" = ./configs/kanshi;
".config/kitty/" = ./configs/kitty;
".config/dunst/" = ./configs/dunst; ".config/dunst/" = ./configs/dunst;
".config/niri/" = ./configs/niri; ".config/niri/" = ./configs/niri;
}; };

View file

@ -1,6 +1,6 @@
[main] [main]
pad=6x6 pad=8x8
font=monospace:size=15 font=monospace:size=13
[colors] [colors]
foreground=e5e9f0 foreground=e5e9f0

View file

@ -1,7 +1,9 @@
{ {
inputs, inputs,
self, self,
}: _: _: let ...
}: {
flake.lib = inputs.nixpkgs.lib.extend (_: _: {
mkHost = { mkHost = {
host, host,
system, system,
@ -42,6 +44,5 @@
inherit inputs self; inherit inputs self;
}; };
}; };
in { });
mkHosts = builtins.mapAttrs (n: v: mkHost (v // {host = n;}));
} }