Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit3d363513f847850b834dacc4715b5c22b42b7079 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-11-28 22:01:11 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-11-28 22:01:11 +0200
Files4fb4b0602184e990d620398093636c215cb1817f
nix-3d363513f847850b834dacc4715b5c22b42b7079.tar
nix-3d363513f847850b834dacc4715b5c22b42b7079.tar.gz
nix-3d363513f847850b834dacc4715b5c22b42b7079.zip
Parentf1f6b27853d6b2271817859bdc6eb2d33ea064aa (diff)
(autoconfig/packages) Added machine type and name checks
3 files changed, 21 insertions, 6 deletions
-rw-r--r--autoconfig.nix5
-rw-r--r--packages.nix6
-rw-r--r--packages/default.nix16
diff --git a/autoconfig.nix b/autoconfig.nix
index 8f74c7f..0d2055c 100644
--- a/autoconfig.nix
+++ b/autoconfig.nix
@@ -49,7 +49,10 @@ in {
in
_mergeAttrs [config config-from-group])
{}
- package-groups; # TODO: filter on machine type
+ (lib.filterAttrs
+ (_: prop: ((prop ? for.type) -> (builtins.elem sysidentity.type prop.for.type)) &&
+ ((prop ? for.name) -> (builtins.elem sysidentity.name prop.for.name)))
+ package-groups);
in
lib.nixosSystem {
diff --git a/packages.nix b/packages.nix
index ecc6209..8a37e2f 100644
--- a/packages.nix
+++ b/packages.nix
@@ -52,9 +52,6 @@ in {
laptop = [
brightnessctl powertop upower libinput-gestures acpid tlp epkowa
];
- juno = [
- thinkfan xorg.xf86inputsynaptics
- ];
desktop = [
timeshift
];
@@ -82,8 +79,7 @@ in {
lowdown wakatime cloc go php fontforge
];
in cli-userspace ++ openboxDE-userspace ++ openboxDE-core ++ dev ++
- (if sysidentity.type == "laptop" then laptop else desktop) ++
- (if sysidentity.name == "juno" then juno else []);
+ (if sysidentity.type == "laptop" then laptop else desktop);
fonts.fonts = with pkgs; [
# Note to self: DO NOT INSTALL ADOBE FONTS!
diff --git a/packages/default.nix b/packages/default.nix
index 4d58753..2ee094f 100644
--- a/packages/default.nix
+++ b/packages/default.nix
@@ -23,4 +23,20 @@
hardware.bluetooth.enable = true;
};
};
+
+ power-control = {
+ for.type = [ "laptop" ];
+
+ list = with pkgs; [
+ powertop upower acpid tlp
+ ];
+ };
+
+ thinkpad = {
+ for.name = [ "juno" ];
+
+ list = with pkgs; [
+ thinkfan xorg.xf86inputsynaptics
+ ];
+ };
}