refactor: what can I say

This commit is contained in:
2025-04-19 12:42:19 +08:00
parent d34da2b672
commit 2242e26ede
51 changed files with 211 additions and 332 deletions

View File

@@ -3,11 +3,11 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line tools";
optionPath = [
"cmd"
"cli"
"all"
];
config' = {
my.cmd = {
my.cli = {
media.all.enable = true;
misc.enable = true;
monitor.all.enable = true;

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line media tools";
optionPath = [
"cmd"
"cli"
"media"
"all"
];
config' = {
my.cmd.media = {
my.cli.media = {
cava.enable = true;
go-musicfox.enable = true;
mpd.enable = true;

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "cava";
packagePath = [ "cava" ];
optionPath = [
"cmd"
"cli"
"media"
"cava"
];

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "ffmpeg";
packagePath = [ "ffmpeg" ];
optionPath = [
"cmd"
"cli"
"media"
"ffmpeg"
];

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config;
optionName = "go-musicfox";
optionPath = [
"cmd"
"cli"
"media"
"go-musicfox"
];
@@ -22,7 +22,7 @@ lib.my.makeSwitch {
xdg.configFile."go-musicfox/go-musicfox.ini".source = ./go-musicfox.ini;
};
cmd.media.mpd.enable = true;
cli.media.mpd.enable = true;
};
};
}

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config;
optionName = "mpd";
optionPath = [
"cmd"
"cli"
"media"
"mpd"
];

View File

@@ -11,7 +11,7 @@ lib.my.makeSwitch {
default = true;
optionName = "misc command line tools";
optionPath = [
"cmd"
"cli"
"misc"
];
config' = {

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line monitor tools";
optionPath = [
"cmd"
"cli"
"monitor"
"all"
];
config' = {
my.cmd.monitor = {
my.cli.monitor = {
btop.enable = true;
};
};

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "btop";
packagePath = [ "btop" ];
optionPath = [
"cmd"
"cli"
"monitor"
"btop"
];

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all shells";
optionPath = [
"cmd"
"cli"
"shell"
"all"
];
config' = {
my.cmd.shell = {
my.cli.shell = {
zsh.enable = true;
};
};

View File

@@ -9,7 +9,7 @@ lib.my.makeSwitch {
default = true;
optionName = "default zsh settings";
optionPath = [
"cmd"
"cli"
"shell"
"zsh"
];

View File

@@ -5,7 +5,7 @@
}:
{
imports = [
./cmd
./cli
./coding
./virt
./desktop

View File

@@ -14,7 +14,6 @@ lib.my.makeSwitch {
config' = {
my.desktop.wm = {
cage.enable = true;
dwm.enable = true;
niri.enable = true;
};
};

View File

@@ -3,7 +3,6 @@
imports = [
./all.nix
./cage.nix
./dwm.nix
./niri
];
}

View File

@@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "dwm";
packagePath = [ "dwm" ];
optionPath = [
"desktop"
"wm"
"dwm"
];
}

View File

@@ -5,7 +5,10 @@
...
}:
{
my.home.systemd.user.services.swaync.Unit.After = [ "graphical-session.target" ];
my.home.systemd.user.services.swaync = {
Unit.After = [ "graphical-session.target" ];
Service.ExecStart = [ "swaync" ];
};
my.home.programs.niri.settings = {
input = {

View File

@@ -20,6 +20,11 @@ lib.my.makeSwitch {
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = [ "/etc/nix/path" ];
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
@@ -38,6 +43,7 @@ lib.my.makeSwitch {
];
};
# uncomment to enable auto gc
/*
nix.gc = {
automatic = true;
@@ -45,10 +51,5 @@ lib.my.makeSwitch {
options = "--delete-older-than 30d";
};
*/
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
};
}

View File

@@ -24,7 +24,7 @@ lib.my.makeSwitch {
mutableUsers = false;
users.${username} = {
isNormalUser = true;
description = "${userdesc}";
description = userdesc;
shell = pkgs.zsh;
extraGroups = [
"wheel"
@@ -38,7 +38,7 @@ lib.my.makeSwitch {
security.sudo.extraRules = [
{
users = [ "${username}" ];
users = [ username ];
commands = [
{
command = "ALL";
@@ -50,7 +50,7 @@ lib.my.makeSwitch {
nix.settings.trusted-users = [
"root"
"${username}"
username
];
my.home = {