Make pkgsets accessible to service configurations.
This commit is contained in:
parent
206c2e42af
commit
cc21ece351
7 changed files with 29 additions and 35 deletions
|
@ -14,7 +14,7 @@ in {
|
|||
machineOpts
|
||||
./config/default.nix
|
||||
./pkgs/nixpkgs.nix
|
||||
./pkgs/pkgsets.nix
|
||||
./pkgs/systemPackages.nix
|
||||
./services/containers.nix
|
||||
./services/default.nix
|
||||
];
|
||||
|
|
|
@ -25,7 +25,7 @@ with lib;
|
|||
"extra"
|
||||
"cpp"
|
||||
"haskell"
|
||||
"mailutils"
|
||||
"mail_utils"
|
||||
"python3"
|
||||
"rustpkgs"
|
||||
"xpkgs"
|
||||
|
|
|
@ -10,7 +10,5 @@
|
|||
|
||||
networking.dhcpcd.extraConfig = "noarp";
|
||||
|
||||
environment.systemPackages = with pkgs; [ xdiskusage ];
|
||||
|
||||
system.stateVersion = "19.09";
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ with lib;
|
|||
"extra"
|
||||
"cpp"
|
||||
"haskell"
|
||||
"mailutils"
|
||||
"mail_utils"
|
||||
"python3"
|
||||
"rustpkgs"
|
||||
"xpkgs"
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
mpv.vaapiSupport = (lib.elem "xserver" config.machine.services);
|
||||
|
||||
packageOverrides = pkgs: with pkgs; rec {
|
||||
theme_flat-remix = callPackage ./flat-remix { };
|
||||
theme_sddm_midnight = callPackage ./sddm_midnight { };
|
||||
xdiskusage = callPackage ./xdiskusage { };
|
||||
packageOverrides = {
|
||||
pkgsets = import ./pkgsets.nix { inherit config lib pkgs; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
optPkgs = package: pkgstring: optionals (elem pkgstring cfg.pkgs) (toList package);
|
||||
gitpkgs = import /nixpkgs {};
|
||||
stablepkgs = import <nixos-stable> {};
|
||||
|
||||
callPackage = pkgs.callPackage;
|
||||
theme_flat-remix = callPackage ./flat-remix { };
|
||||
theme_sddm_midnight = callPackage ./sddm_midnight { };
|
||||
xdiskusage = callPackage ./xdiskusage { };
|
||||
in {
|
||||
# Programms I'm likely to want on every machine and/or may execute as root
|
||||
base = with pkgs; [
|
||||
alsaUtils
|
||||
|
@ -236,7 +240,7 @@ let
|
|||
# flask_testing
|
||||
# flask_wtf
|
||||
# flaskbabel
|
||||
] ++ optionals (elem "i3" cfg.desktop.wms) [ py3status pytz tzlocal ]);
|
||||
] ++ optionals (elem "i3" config.machine.desktop.wms) [ py3status pytz tzlocal ]);
|
||||
|
||||
rustpkgs = with stablepkgs; [
|
||||
rustup
|
||||
|
@ -272,26 +276,4 @@ let
|
|||
xorg.xbacklight
|
||||
xdiskusage
|
||||
];
|
||||
|
||||
in {
|
||||
environment.systemPackages = base
|
||||
++ (optPkgs dict "dict")
|
||||
++ (optPkgs emacs "emacs")
|
||||
++ (optPkgs extra "extra")
|
||||
++ (optPkgs mail_utils "mailutils")
|
||||
++ (optPkgs cpp "cpp")
|
||||
++ (optPkgs haskell "haskell")
|
||||
++ (optPkgs java "java")
|
||||
++ (optPkgs python3 "python3")
|
||||
++ (optPkgs rustpkgs "rustpkgs")
|
||||
++ (optPkgs server "server")
|
||||
++ (optPkgs uniProgs "uniProgs")
|
||||
++ (optPkgs xpkgs "xpkgs");
|
||||
|
||||
services.emacs = mkIf (elem "emacs" cfg.pkgs) {
|
||||
defaultEditor = true;
|
||||
enable = true;
|
||||
install = true;
|
||||
package = emacs;
|
||||
};
|
||||
}
|
||||
|
|
16
pkgs/systemPackages.nix
Normal file
16
pkgs/systemPackages.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
in {
|
||||
environment.systemPackages = flatten (attrVals cfg.pkgs pkgs.pkgsets);
|
||||
|
||||
services.emacs = mkIf (elem "emacs" cfg.pkgs) {
|
||||
defaultEditor = true;
|
||||
enable = true;
|
||||
install = true;
|
||||
package = pkgs.pkgsets.emacs;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue