Compare commits
3 Commits
cceb4da041
...
5e96618d8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e96618d8a | ||
|
|
6573392c3b | ||
|
|
f1e6015d39 |
@@ -168,37 +168,38 @@
|
||||
};
|
||||
fonts = {
|
||||
fontconfig.enable = true;
|
||||
packages = let
|
||||
customFonts = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "custom-fonts";
|
||||
src = inputs.fonts;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts
|
||||
find $src -type f \( \
|
||||
-name "*.ttf" -o \
|
||||
-name "*.otf" -o \
|
||||
-name "*.woff" -o \
|
||||
-name "*.woff2" \
|
||||
\) -exec cp {} $out/share/fonts/ \;
|
||||
'';
|
||||
packages =
|
||||
let
|
||||
customFonts = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "custom-fonts";
|
||||
src = inputs.fonts;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/fonts
|
||||
find $src -type f \( \
|
||||
-name "*.ttf" -o \
|
||||
-name "*.otf" -o \
|
||||
-name "*.woff" -o \
|
||||
-name "*.woff2" \
|
||||
\) -exec cp {} $out/share/fonts/ \;
|
||||
'';
|
||||
};
|
||||
in
|
||||
builtins.attrValues {
|
||||
inherit customFonts;
|
||||
inherit (pkgs)
|
||||
symbola
|
||||
comic-neue
|
||||
cascadia-code
|
||||
corefonts
|
||||
;
|
||||
inherit (pkgs.nerd-fonts)
|
||||
caskaydia-cove
|
||||
open-dyslexic
|
||||
comic-shanns-mono
|
||||
iosevka
|
||||
agave
|
||||
;
|
||||
};
|
||||
in
|
||||
builtins.attrValues {
|
||||
inherit customFonts;
|
||||
inherit (pkgs)
|
||||
symbola
|
||||
comic-neue
|
||||
cascadia-code
|
||||
corefonts
|
||||
;
|
||||
inherit (pkgs.nerd-fonts)
|
||||
caskaydia-cove
|
||||
open-dyslexic
|
||||
comic-shanns-mono
|
||||
iosevka
|
||||
agave
|
||||
;
|
||||
};
|
||||
};
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
||||
|
||||
@@ -4,31 +4,28 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
enableForDerek = {
|
||||
enable = true;
|
||||
users = "bearded_dragonn";
|
||||
};
|
||||
in
|
||||
{
|
||||
my = {
|
||||
apps = {
|
||||
art.enable = true;
|
||||
art.users = "bearded_dragonn";
|
||||
gaming.enable = true;
|
||||
gaming.users = "bearded_dragonn";
|
||||
multimedia.videoEditing.enable = true;
|
||||
multimedia.videoEditing.users = "bearded_dragonn";
|
||||
art = enableForDerek;
|
||||
gaming = enableForDerek;
|
||||
multimedia.videoEditing = enableForDerek;
|
||||
};
|
||||
dev = {
|
||||
nix.enable = true;
|
||||
nix.users = "bearded_dragonn";
|
||||
python.enable = true;
|
||||
python.users = "bearded_dragonn";
|
||||
sh.enable = true;
|
||||
sh.users = "bearded_dragonn";
|
||||
nix = enableForDerek;
|
||||
python = enableForDerek;
|
||||
sh = enableForDerek;
|
||||
};
|
||||
shell = {
|
||||
exercism.enable = true;
|
||||
exercism.users = "bearded_dragonn";
|
||||
tools.enable = true;
|
||||
tools.users = "bearded_dragonn";
|
||||
multimedia.enable = true;
|
||||
multimedia.users = "bearded_dragonn";
|
||||
exercism = enableForDerek;
|
||||
tools = enableForDerek;
|
||||
multimedia = enableForDerek;
|
||||
};
|
||||
};
|
||||
sops.secrets = lib.mkIf config.my.secureHost {
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
options.my.stylix = {
|
||||
enable = lib.mkEnableOption "system-wide theming with Stylix";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.stylix;
|
||||
description = "Users to apply Stylix theming for";
|
||||
};
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
{ inputs }:
|
||||
let
|
||||
inherit (inputs.self.lib) mkEnabled mkEnabledWithProxy enableList;
|
||||
inherit (inputs.self.lib)
|
||||
mkEnabled
|
||||
mkEnabledWithUsers
|
||||
mkEnabledWithProxy
|
||||
enableList
|
||||
;
|
||||
in
|
||||
{
|
||||
emacs.enable = true;
|
||||
enableProxy = true;
|
||||
websites.portfolio.enableProxy = true;
|
||||
apps = enableList mkEnabled [
|
||||
apps = enableList mkEnabledWithUsers [
|
||||
"dictionaries"
|
||||
];
|
||||
services = enableList mkEnabled [
|
||||
"network"
|
||||
];
|
||||
shell = enableList mkEnabled [
|
||||
shell = enableList mkEnabledWithUsers [
|
||||
"tools"
|
||||
"multimedia"
|
||||
];
|
||||
dev = enableList mkEnabled [
|
||||
dev = enableList mkEnabledWithUsers [
|
||||
"nix"
|
||||
"python"
|
||||
"sh"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, inputs }:
|
||||
let
|
||||
inherit (inputs.self.lib) mkEnabled enableList;
|
||||
inherit (inputs.self.lib) mkEnabled mkEnabledWithUsers enableList;
|
||||
mkEnabledIp = inputs.self.lib.mkEnabledIp config.my.ips.wg-server;
|
||||
in
|
||||
{
|
||||
@@ -10,7 +10,8 @@ in
|
||||
enableProxy = true;
|
||||
enableContainers = true;
|
||||
apps.dictionaries.enable = true;
|
||||
shell = enableList mkEnabled [
|
||||
apps.dictionaries.users = "jawz";
|
||||
shell = enableList mkEnabledWithUsers [
|
||||
"tools"
|
||||
"multimedia"
|
||||
];
|
||||
@@ -19,7 +20,7 @@ in
|
||||
"nvidia"
|
||||
"syncthing"
|
||||
];
|
||||
dev = enableList mkEnabled [
|
||||
dev = enableList mkEnabledWithUsers [
|
||||
"nix"
|
||||
"python"
|
||||
"sh"
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
{ inputs }:
|
||||
let
|
||||
inherit (inputs.self.lib) mkEnabled enableList;
|
||||
inherit (inputs.self.lib) mkEnabled mkEnabledWithUsers enableList;
|
||||
in
|
||||
{
|
||||
stylix.enable = true;
|
||||
emacs.enable = true;
|
||||
enableContainers = true;
|
||||
servers.drpp.enable = true;
|
||||
apps = enableList mkEnabled [
|
||||
"art"
|
||||
"dictionaries"
|
||||
"gaming"
|
||||
"switch"
|
||||
"internet"
|
||||
"multimedia"
|
||||
"office"
|
||||
"misc"
|
||||
];
|
||||
dev = enableList mkEnabled [
|
||||
apps =
|
||||
(enableList mkEnabledWithUsers [
|
||||
"art"
|
||||
"dictionaries"
|
||||
"gaming"
|
||||
"internet"
|
||||
"multimedia"
|
||||
"office"
|
||||
"misc"
|
||||
])
|
||||
// {
|
||||
switch.enable = true;
|
||||
};
|
||||
dev = enableList mkEnabledWithUsers [
|
||||
"nix"
|
||||
"python"
|
||||
"sh"
|
||||
];
|
||||
shell = enableList mkEnabled [
|
||||
shell = enableList mkEnabledWithUsers [
|
||||
"exercism"
|
||||
"multimedia"
|
||||
"tools"
|
||||
|
||||
@@ -40,7 +40,7 @@ in
|
||||
apps.art = {
|
||||
enable = lib.mkEnableOption "digital art and creative applications";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install art packages for";
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
options.my.apps.dictionaries = {
|
||||
enable = lib.mkEnableOption "dictionaries and language tools";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install dictionaries packages for";
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ in
|
||||
gaming = {
|
||||
enable = lib.mkEnableOption "gaming applications and emulators";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install gaming packages for";
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ in
|
||||
options.my.apps.internet = {
|
||||
enable = lib.mkEnableOption "internet browsers and communication apps";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install internet packages for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.apps.misc = {
|
||||
enable = lib.mkEnableOption "miscellaneous desktop applications";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install misc packages for";
|
||||
};
|
||||
|
||||
@@ -33,14 +33,14 @@ in
|
||||
options.my.apps.multimedia = {
|
||||
enable = lib.mkEnableOption "multimedia applications and media players";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install multimedia packages for";
|
||||
};
|
||||
videoEditing = {
|
||||
enable = lib.mkEnableOption "video editing applications";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install video editing packages for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.apps.piano = {
|
||||
enable = lib.mkEnableOption "piano learning and music theory apps";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install piano packages for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.apps.office = {
|
||||
enable = lib.mkEnableOption "office applications and productivity tools";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.apps;
|
||||
description = "Users to install office packages for";
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
my.dev.cc = {
|
||||
enable = lib.mkEnableOption "Install C/C++ tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install C/C++ packages for";
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
my.dev.docker = {
|
||||
enable = lib.mkEnableOption "Install Docker tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Docker packages for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.emacs = {
|
||||
enable = lib.mkEnableOption "Doom Emacs configuration";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Emacs packages for";
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ in
|
||||
my.dev.go = {
|
||||
enable = lib.mkEnableOption "Install Go tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Go packages for";
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ in
|
||||
my.dev.haskell = {
|
||||
enable = lib.mkEnableOption "Install Haskell tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Haskell packages for";
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ in
|
||||
my.dev.javascript = {
|
||||
enable = lib.mkEnableOption "Install JavaScript tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install JavaScript packages for";
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ in
|
||||
my.dev.julia = {
|
||||
enable = lib.mkEnableOption "Install Julia globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Julia packages for";
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ in
|
||||
my.dev.nix = {
|
||||
enable = lib.mkEnableOption "Install Nix tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Nix packages for";
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ in
|
||||
my.dev.python = {
|
||||
enable = lib.mkEnableOption "Install Python tools globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Python packages for";
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ in
|
||||
my.dev.ruby = {
|
||||
enable = lib.mkEnableOption "Install Ruby tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Ruby packages for";
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ in
|
||||
my.dev.rust = {
|
||||
enable = lib.mkEnableOption "Install Rust tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Rust packages for";
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
my.dev.sh = {
|
||||
enable = lib.mkEnableOption "Install shell scripting tools globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install shell scripting packages for";
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ in
|
||||
my.dev.zig = {
|
||||
enable = lib.mkEnableOption "Install Zig tooling globally";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.dev;
|
||||
description = "Users to install Zig packages for";
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
install = lib.mkEnableOption "Whether to install the script package";
|
||||
service = lib.mkEnableOption "Whether to enable the script service";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.scripts;
|
||||
description = "Users to install this script for";
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ in
|
||||
options.my.services.printing = {
|
||||
enable = lib.mkEnableOption "printing services and drivers";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.services;
|
||||
description = "Users to install printing packages for";
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
description = "The shell to use system-wide (bash or zsh)";
|
||||
};
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to configure shell for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.shell.exercism = {
|
||||
enable = lib.mkEnableOption "Exercism coding practice platform";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to install Exercism for";
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
options.my.shell.multimedia = {
|
||||
enable = lib.mkEnableOption "multimedia CLI tools and codecs";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to install multimedia shell tools for";
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ in
|
||||
options.my.shell.tools = {
|
||||
enable = lib.mkEnableOption "shell tools and utilities";
|
||||
users = lib.mkOption {
|
||||
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
||||
type = inputs.self.lib.usersOptionType lib;
|
||||
default = config.my.toggleUsers.shell;
|
||||
description = "Users to install shell tools for";
|
||||
};
|
||||
|
||||
@@ -175,6 +175,13 @@ in
|
||||
inherit name;
|
||||
value.enable = true;
|
||||
};
|
||||
mkEnabledWithUsers = name: {
|
||||
inherit name;
|
||||
value = {
|
||||
enable = true;
|
||||
users = "jawz";
|
||||
};
|
||||
};
|
||||
mkEnabledWithProxy = name: {
|
||||
inherit name;
|
||||
value = {
|
||||
@@ -237,6 +244,20 @@ in
|
||||
}) (inputs.self.lib.normalizeUsers users)
|
||||
);
|
||||
getFirstUser = users: if builtins.isString users then users else (builtins.head users);
|
||||
usersOptionType =
|
||||
lib:
|
||||
lib.mkOptionType {
|
||||
name = "usersOption";
|
||||
description = "Either a single user (string) or multiple users (list of strings)";
|
||||
check = x: builtins.isString x || (builtins.isList x && lib.all builtins.isString x);
|
||||
merge =
|
||||
_loc: defs:
|
||||
let
|
||||
normalize = users: if builtins.isString users then [ users ] else users;
|
||||
allUsers = lib.foldl' (acc: def: acc ++ (normalize def.value)) [ ] defs;
|
||||
in
|
||||
lib.unique allUsers;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user