Split up more nix functions

This commit is contained in:
Bun 2025-03-24 04:28:36 -04:00
parent 0b8d1f4eaf
commit b7a5fc7197
6 changed files with 48 additions and 50 deletions

View file

@ -1,11 +1,6 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
services.udev.packages = [
(pkgs.writeTextFile {
name = "10-oculus.rules";
text = ''KERNEL=="hidraw*", ATTRS{idVendor}=="0e6f", ATTRS{idProduct}=="0184", MODE="0660", TAG+="uaccess"'';
destination = "/etc/udev/rules.d/10-oculus.rules";
})
services.udev.packages = lib.mkIf config.system.desktop.enable [
(pkgs.writeTextFile {
name = "10-pdp.rules";
text = ''SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666"'';

View file

@ -9,8 +9,6 @@
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099";
};
};
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
];
extraPortals = with pkgs; [ xdg-desktop-portal-gnome ];
};
}

View file

@ -1,29 +1,24 @@
{ config, lib, pkgs, unstable, ... }:
{
imports = [ ./gc ];
imports = [
./gc
./unfree
];
options.nixpkgs.allowUnfreePackages = lib.mkOption {
type = with lib.types; listOf str;
nix = {
package = pkgs.lix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
trusted-users = [ "@wheel" ];
};
};
config = {
nix = {
package = pkgs.lix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
trusted-users = [ "@wheel" ];
};
};
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowUnfreePackages;
_module.args.pkgsUnstable = import unstable {
inherit (pkgs.stdenv.hostPlatform) system;
inherit (config.nixpkgs) config;
};
_module.args.pkgsUnstable = import unstable {
inherit (pkgs.stdenv.hostPlatform) system;
inherit (config.nixpkgs) config;
};
}

View file

@ -0,0 +1,8 @@
{ config, lib, ... }:
{
options.nixpkgs.allowUnfreePackages = lib.mkOption {
type = with lib.types; listOf str;
};
config.nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.nixpkgs.allowUnfreePackages;
}