327 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 *

This commit is contained in:
Max Känner 2024-05-20 20:53:29 +02:00
parent 3667246bf0
commit da0bf720dd
8 changed files with 63 additions and 26 deletions

View File

@ -14,11 +14,11 @@
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
music.enable = true; myConfig = {
greetd.enable = true; enable = true;
wifi.enable = true; desktop = true;
wifi.tray = true; laptop = true;
sway.enable = true; };
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;

View File

@ -1,3 +1,26 @@
{...}: { {
lib,
config,
...
}: let
cfg = config.myConfig;
in {
options.myConfig = {
enable = lib.mkEnableOption "my custom config";
desktop = lib.mkEnableOption "custom config with desktop support";
laptop = lib.mkEnableOption "extra stuff for laptops like wifi";
};
imports = [./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix]; imports = [./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix];
config.myConfig = lib.mkIf cfg.enable {
rebuild.enable = true;
greetd.enable = lib.mkIf cfg.desktop true;
sway.enable = lib.mkIf cfg.desktop true;
music.enable = lib.mkIf cfg.desktop true;
wifi.tray = lib.mkIf cfg.desktop true;
sway.laptop = lib.mkIf cfg.laptop true;
wifi.enable = lib.mkIf cfg.laptop true;
};
} }

View File

@ -4,15 +4,15 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.greetd; cfg = config.myConfig.greetd;
themeEnv = '' themeEnv = ''
export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS" export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
''; '';
in { in {
options = { options.myConfig.greetd = {
greetd.enable = lib.mkEnableOption "greetd, a light weight greater deamon"; enable = lib.mkEnableOption "greetd, a light weight greater deamon";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,10 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.music; cfg = config.myConfig.music;
in { in {
options = { options.myConfig.music = {
music.enable = lib.mkEnableOption "sound system"; enable = lib.mkEnableOption "sound system";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -1,4 +1,11 @@
{pkgs, ...}: let {
lib,
config,
pkgs,
...
}: let
cfg = config.myConfig.rebuild;
# script for rebuilding nixos # script for rebuilding nixos
rebuild = pkgs.writeShellScriptBin "rebuild" '' rebuild = pkgs.writeShellScriptBin "rebuild" ''
# A rebuild script that commits on a successful build # A rebuild script that commits on a successful build
@ -37,5 +44,11 @@
${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available ${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
''; '';
in { in {
options.myConfig.rebuild = {
enable = lib.mkEnableOption "rebuild script with automatic git commits";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [rebuild]; environment.systemPackages = [rebuild];
};
} }

View File

@ -3,10 +3,10 @@
config, config,
... ...
}: let }: let
cfg = config.secrets; cfg = config.myConfig.sops;
in { in {
options = { options.myConfig.sops = {
secrets.enable = lib.mkEnableOption "sops, an secrets manager"; enable = lib.mkEnableOption "sops, an secrets manager";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -4,10 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.sway; cfg = config.myConfig.sway;
in { in {
options = { options.myConfig.sway = {
sway.enable = lib.mkEnableOption "sway"; enable = lib.mkEnableOption "sway";
laptop = lib.mkEnableOption "enable laptop things (backlight)";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -38,7 +39,7 @@ in {
# make brightness keys work # make brightness keys work
users.users.max.extraGroups = ["video" "input"]; users.users.max.extraGroups = ["video" "input"];
programs.light.enable = true; programs.light.enable = lib.mkIf cfg.laptop true;
# make swaylock work # make swaylock work
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};

View File

@ -4,11 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
cfg = config.wifi; cfg = config.myConfig.wifi;
in { in {
options = { options.myConfig.wifi = {
wifi.enable = lib.mkEnableOption "wifi"; enable = lib.mkEnableOption "wifi";
wifi.tray = lib.mkEnableOption "nm tray entry"; tray = lib.mkEnableOption "nm tray entry";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -26,7 +26,7 @@ in {
environment.systemPackages = lib.optional cfg.tray pkgs.nm-tray; environment.systemPackages = lib.optional cfg.tray pkgs.nm-tray;
secrets.enable = true; myConfig.sops.enable = true;
sops = { sops = {
secrets = { secrets = {
"home/ssid" = { "home/ssid" = {