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
];
music.enable = true;
greetd.enable = true;
wifi.enable = true;
wifi.tray = true;
sway.enable = true;
myConfig = {
enable = true;
desktop = true;
laptop = true;
};
hardware.opengl = {
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];
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,
...
}: let
cfg = config.greetd;
cfg = config.myConfig.greetd;
themeEnv = ''
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-cursors}/share:$XDG_DATA_DIRS"
'';
in {
options = {
greetd.enable = lib.mkEnableOption "greetd, a light weight greater deamon";
options.myConfig.greetd = {
enable = lib.mkEnableOption "greetd, a light weight greater deamon";
};
config = lib.mkIf cfg.enable {

View File

@ -4,10 +4,10 @@
pkgs,
...
}: let
cfg = config.music;
cfg = config.myConfig.music;
in {
options = {
music.enable = lib.mkEnableOption "sound system";
options.myConfig.music = {
enable = lib.mkEnableOption "sound system";
};
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
rebuild = pkgs.writeShellScriptBin "rebuild" ''
# 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
'';
in {
options.myConfig.rebuild = {
enable = lib.mkEnableOption "rebuild script with automatic git commits";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [rebuild];
};
}

View File

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

View File

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

View File

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