systemPackages: refactor/simplify pkgset import and resolution
This commit is contained in:
parent
94b10b47b1
commit
2a49bbe041
2 changed files with 15 additions and 10 deletions
14
flake.nix
14
flake.nix
|
@ -6,6 +6,14 @@
|
|||
nixpkgs-unstable.url = "github:/NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:/NixOS/nixpkgs/nixos-unstable";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
catppuccin = {
|
||||
url = "github:catppuccin/nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
mailserver.url = "gitlab:/simple-nixos-mailserver/nixos-mailserver";
|
||||
|
@ -19,6 +27,7 @@
|
|||
};
|
||||
nvim-lazy = {
|
||||
url = "git+https://git.ophanim.de/derped/lazy.nvim.nix.git";
|
||||
# url = "git+file:///home/derped/Projects/nvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
@ -51,6 +60,10 @@
|
|||
path = toString ./pkgs;
|
||||
fullPath = true;
|
||||
};
|
||||
pkgsetFiles = fn.lst {
|
||||
path = toString ./pkgsets;
|
||||
fullPath = true;
|
||||
};
|
||||
serviceFiles = fn.lst {
|
||||
path = toString ./services;
|
||||
fullPath = true;
|
||||
|
@ -85,6 +98,7 @@
|
|||
++ machineFiles
|
||||
++ configFiles
|
||||
++ pkgsFiles
|
||||
++ pkgsetFiles
|
||||
++ serviceFiles;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
fn,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.machine;
|
||||
pkgsets = fn.lst {
|
||||
path = toString ../pkgsets;
|
||||
fullPath = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = pkgsets;
|
||||
|
||||
environment.systemPackages = flatten (
|
||||
lists.forEach (attrVals (filter (v: !(strings.hasInfix "::" v)) cfg.pkgs) cfg.pkgsets) (
|
||||
v: v.pkgwrap
|
||||
)
|
||||
map (setName: lib.optionals (cfg.pkgsets ? "${setName}") cfg.pkgsets."${setName}".pkgwrap) cfg.pkgs
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue