users/infinidoge: refactor packages into module
This commit is contained in:
parent
ab7d61ae5b
commit
f6df6d8d6f
2 changed files with 122 additions and 59 deletions
|
@ -22,22 +22,21 @@ in
|
||||||
./config
|
./config
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs.git = {
|
||||||
git = {
|
userEmail = "infinidoge@inx.moe";
|
||||||
userEmail = "infinidoge@inx.moe";
|
userName = "Infinidoge";
|
||||||
userName = "Infinidoge";
|
extraConfig = {
|
||||||
extraConfig = {
|
gpg.format = "ssh";
|
||||||
gpg.format = "ssh";
|
commit.gpgsign = true;
|
||||||
commit.gpgsign = true;
|
user.signingkey = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
||||||
user.signingkey = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
firefox = {
|
|
||||||
enable = main.info.graphical;
|
|
||||||
package = pkgs.firefox-devedition;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.firefox = {
|
||||||
|
enable = main.info.graphical;
|
||||||
|
package = pkgs.firefox-devedition;
|
||||||
|
};
|
||||||
|
|
||||||
services.unison = {
|
services.unison = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pairs = {
|
pairs = {
|
||||||
|
@ -68,52 +67,6 @@ in
|
||||||
POP_SMTP_PASSWORD = "$(cat ${secrets.smtp-personal})";
|
POP_SMTP_PASSWORD = "$(cat ${secrets.smtp-personal})";
|
||||||
UNISON = "$HOME/.local/state/unison";
|
UNISON = "$HOME/.local/state/unison";
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages =
|
|
||||||
with pkgs;
|
|
||||||
flatten [
|
|
||||||
bitwarden-cli
|
|
||||||
bsd-finger
|
|
||||||
ncdu
|
|
||||||
peaclock
|
|
||||||
pop
|
|
||||||
qrencode
|
|
||||||
reflex
|
|
||||||
unison
|
|
||||||
|
|
||||||
(lib.optionals (!main.universe.minimal.enable) [
|
|
||||||
gramma
|
|
||||||
jmtpfs
|
|
||||||
packwiz
|
|
||||||
presenterm
|
|
||||||
toot
|
|
||||||
])
|
|
||||||
|
|
||||||
(ifGraphical [
|
|
||||||
speedcrunch
|
|
||||||
(discord-canary.override {
|
|
||||||
withVencord = true;
|
|
||||||
withOpenASAR = true;
|
|
||||||
withTTS = false;
|
|
||||||
})
|
|
||||||
])
|
|
||||||
|
|
||||||
(lib.optionals (!main.universe.minimal.enable && main.info.graphical) [
|
|
||||||
(discord.override {
|
|
||||||
withVencord = true;
|
|
||||||
withOpenASAR = true;
|
|
||||||
withTTS = false;
|
|
||||||
})
|
|
||||||
schildichat-desktop
|
|
||||||
signal-desktop
|
|
||||||
teams-for-linux
|
|
||||||
thunderbird
|
|
||||||
tor-browser
|
|
||||||
bitwarden
|
|
||||||
qbittorrent
|
|
||||||
sqlitebrowser
|
|
||||||
])
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.tmpfiles.users.infinidoge.rules = mkIf config.universe.media.enable [
|
systemd.user.tmpfiles.users.infinidoge.rules = mkIf config.universe.media.enable [
|
||||||
|
|
110
users/modules/global/programs.nix
Normal file
110
users/modules/global/programs.nix
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
main,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) flip;
|
||||||
|
inherit (lib.our) mkBoolOpt' packageListOpt;
|
||||||
|
|
||||||
|
packagesOpt = kind: flip mkBoolOpt' "Package Set: ${kind}";
|
||||||
|
|
||||||
|
full = !main.universe.minimal.enable;
|
||||||
|
|
||||||
|
cfg = config.universe.programs;
|
||||||
|
|
||||||
|
ifGraphical = lib.optionals main.info.graphical;
|
||||||
|
ifGraphical' = lib.optional main.info.graphical;
|
||||||
|
|
||||||
|
addPackageLists = lib.mapAttrs (
|
||||||
|
name: value:
|
||||||
|
value
|
||||||
|
// {
|
||||||
|
minimal = packageListOpt;
|
||||||
|
full = packageListOpt;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.universe.programs = (
|
||||||
|
addPackageLists {
|
||||||
|
utility.enable = packagesOpt "Utility" true;
|
||||||
|
writing.enable = packagesOpt "Writing" true;
|
||||||
|
communication.enable = packagesOpt "Communication" true;
|
||||||
|
internet.enable = packagesOpt "Internet" true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
config = {
|
||||||
|
universe.programs = with pkgs; {
|
||||||
|
utility.minimal = [
|
||||||
|
bitwarden-cli
|
||||||
|
bsd-finger
|
||||||
|
ncdu
|
||||||
|
peaclock
|
||||||
|
pop
|
||||||
|
qrencode
|
||||||
|
reflex
|
||||||
|
unison
|
||||||
|
(ifGraphical [
|
||||||
|
speedcrunch
|
||||||
|
])
|
||||||
|
];
|
||||||
|
utility.full = [
|
||||||
|
jmtpfs
|
||||||
|
packwiz
|
||||||
|
presenterm
|
||||||
|
toot
|
||||||
|
(ifGraphical [
|
||||||
|
bitwarden
|
||||||
|
qbittorrent
|
||||||
|
sqlitebrowser
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
writing.full = [
|
||||||
|
gramma
|
||||||
|
];
|
||||||
|
|
||||||
|
communication.minimal = [
|
||||||
|
(ifGraphical [
|
||||||
|
(discord-canary.override {
|
||||||
|
withVencord = true;
|
||||||
|
withOpenASAR = true;
|
||||||
|
withTTS = false;
|
||||||
|
})
|
||||||
|
thunderbird
|
||||||
|
])
|
||||||
|
];
|
||||||
|
communication.full = [
|
||||||
|
(ifGraphical [
|
||||||
|
(discord.override {
|
||||||
|
withVencord = true;
|
||||||
|
withOpenASAR = true;
|
||||||
|
withTTS = false;
|
||||||
|
})
|
||||||
|
schildichat-desktop
|
||||||
|
signal-desktop
|
||||||
|
teams-for-linux
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
internet.full = [
|
||||||
|
(ifGraphical [
|
||||||
|
tor-browser
|
||||||
|
])
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = lib.concatMap (
|
||||||
|
v:
|
||||||
|
(lib.optionals (v ? minimal && v.enable) v.minimal)
|
||||||
|
++ (lib.optionals (v ? full && full && v.enable) v.full)
|
||||||
|
) (lib.attrValues cfg);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue