Nixos: Remove mkLink + mkEnableOpt and rename mkBoolOpt
This commit is contained in:
@ -46,6 +46,9 @@
|
||||
inherit system;
|
||||
|
||||
config.allowUnfree = true;
|
||||
|
||||
# Alternative to setting config.allowUnfree.
|
||||
# I read somewhere that this is more suitable when running HM standalone.
|
||||
config.allowUnfreePredicate = pkg: true;
|
||||
|
||||
# Overlays define changes in the nixpkgs package set.
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "TEMPLATE";
|
||||
enable = mkEnableOption "TEMPLATE";
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Enable Alacritty";
|
||||
enable = mkEnableOption "Enable Alacritty";
|
||||
}
|
||||
|
@ -5,44 +5,44 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Audio module";
|
||||
enable = mkEnableOption "Audio module";
|
||||
|
||||
# TODO: Group these in categories (like instruments/VSTs or sth)
|
||||
# TODO: Make it easier to add many yes/no options, similar to the flatpak stuff
|
||||
|
||||
# Hosts/Editing
|
||||
carla.enable = mkEnableOpt "Carla (VST host)";
|
||||
bitwig.enable = mkEnableOpt "Bitwig (Digital audio workstation)";
|
||||
tenacity.enable = mkEnableOpt "Tenacity (Audacity fork)";
|
||||
carla.enable = mkEnableOption "Carla (VST host)";
|
||||
bitwig.enable = mkEnableOption "Bitwig (Digital audio workstation)";
|
||||
tenacity.enable = mkEnableOption "Tenacity (Audacity fork)";
|
||||
|
||||
# Instruments/Plugins
|
||||
# vcvrack.enable = mkEnableOpt "VCV-Rack (Eurorack simulator)"; # Replaced by cardinal
|
||||
cardinal.enable = mkEnableOpt "Open Source VCV-Rack plugin wrapper";
|
||||
# vital.enable = mkEnableOpt "Vital (Wavetable synthesizer)"; # Replaced by distrho
|
||||
distrho.enable = mkEnableOpt "Distrho (Linux VST ports)";
|
||||
# vcvrack.enable = mkEnableOption "VCV-Rack (Eurorack simulator)"; # Replaced by cardinal
|
||||
cardinal.enable = mkEnableOption "Open Source VCV-Rack plugin wrapper";
|
||||
# vital.enable = mkEnableOption "Vital (Wavetable synthesizer)"; # Replaced by distrho
|
||||
distrho.enable = mkEnableOption "Distrho (Linux VST ports)";
|
||||
|
||||
# Misc
|
||||
faust.enable = mkEnableOpt "Faust (functional DSP language)";
|
||||
bottles.enable = mkEnableOpt "Bottles (flatpak)";
|
||||
faust.enable = mkEnableOption "Faust (functional DSP language)";
|
||||
bottles.enable = mkEnableOption "Bottles (flatpak)";
|
||||
|
||||
# TODO: Automatically add the needed paths, depends on the bottle though
|
||||
# /home/christoph/.var/app/com.usebottles.bottles/data/bottles/bottles/Audio/drive_c/Program Files/Common Files/VST3
|
||||
# /home/christoph/.var/app/com.usebottles.bottles/data/bottles/bottles/Audio/drive_c/Program Files/VstPlugins
|
||||
yabridge = {
|
||||
enable = mkEnableOpt "Yabridge (Windows VST plugin manager)";
|
||||
autoSync = mkBoolOpt false "Sync yabridge plugins on nixos-rebuild";
|
||||
enable = mkEnableOption "Yabridge (Windows VST plugin manager)";
|
||||
autoSync = mkBoolOption false "Sync yabridge plugins on nixos-rebuild";
|
||||
};
|
||||
|
||||
noisesuppression = {
|
||||
noisetorch = {
|
||||
enable = mkEnableOpt "Noisetorch";
|
||||
autostart = mkBoolOpt false "Autoload Noisetorch suppression";
|
||||
enable = mkEnableOption "Noisetorch";
|
||||
autostart = mkBoolOption false "Autoload Noisetorch suppression";
|
||||
};
|
||||
|
||||
# TODO: Store easyeffects presets/config (dconf com/github/wwmm/easyeffects ?)
|
||||
easyeffects = {
|
||||
enable = mkEnableOpt "EasyEffects";
|
||||
autostart = mkBoolOpt false "Autoload EasyEffects suppression profile";
|
||||
enable = mkEnableOption "EasyEffects";
|
||||
autostart = mkBoolOption false "Autoload EasyEffects suppression profile";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -5,16 +5,16 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Emacs module";
|
||||
enable = mkEnableOption "Emacs module";
|
||||
|
||||
# TODO: Use an enum for this not individual options
|
||||
nixpkgs = mkBoolOpt false "Use Emacs from the official repositories";
|
||||
nativeComp = mkBoolOpt false "Use Emacs 28.x branch with native comp support";
|
||||
pgtkNativeComp = mkBoolOpt false "Use Emacs 29.x branch with native comp and pure gtk support";
|
||||
nixpkgs = mkBoolOption false "Use Emacs from the official repositories";
|
||||
nativeComp = mkBoolOption false "Use Emacs 28.x branch with native comp support";
|
||||
pgtkNativeComp = mkBoolOption false "Use Emacs 29.x branch with native comp and pure gtk support";
|
||||
|
||||
doom = {
|
||||
enable = mkEnableOpt "Doom Emacs framework";
|
||||
autoSync = mkBoolOpt false "Sync Doom Emacs on nixos-rebuild";
|
||||
autoUpgrade = mkBoolOpt false "Upgrade Doom Emacs on nixos-rebuild";
|
||||
enable = mkEnableOption "Doom Emacs framework";
|
||||
autoSync = mkBoolOption false "Sync Doom Emacs on nixos-rebuild";
|
||||
autoUpgrade = mkBoolOption false "Upgrade Doom Emacs on nixos-rebuild";
|
||||
};
|
||||
}
|
||||
|
@ -5,12 +5,12 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Email";
|
||||
autosync = mkEnableOpt "Automatically call \"notmuch new\" via systemd timer";
|
||||
imapnotify = mkEnableOpt "Use imapnotify to sync and index mail automatically";
|
||||
enable = mkEnableOption "Email";
|
||||
autosync = mkEnableOption "Automatically call \"notmuch new\" via systemd timer";
|
||||
imapnotify = mkEnableOption "Use imapnotify to sync and index mail automatically";
|
||||
|
||||
kmail = {
|
||||
enable = mkEnableOpt "Kmail";
|
||||
autostart = mkEnableOpt "Autostart Kmail";
|
||||
enable = mkEnableOption "Kmail";
|
||||
autostart = mkEnableOption "Autostart Kmail";
|
||||
};
|
||||
}
|
||||
|
@ -5,22 +5,22 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Flatpak module";
|
||||
fontFix = mkBoolOpt true "Link fonts to ~/.local/share/fonts so flatpak apps can find them";
|
||||
iconFix = mkBoolOpt true "Link icons to ~/.local/share/icons so flatpak apps can find them";
|
||||
autoUpdate = mkBoolOpt false "Update flatpak apps on nixos-rebuild";
|
||||
autoPrune = mkBoolOpt false "Remove unused packages on nixos-rebuild";
|
||||
enable = mkEnableOption "Flatpak module";
|
||||
fontFix = mkBoolOption true "Link fonts to ~/.local/share/fonts so flatpak apps can find them";
|
||||
iconFix = mkBoolOption true "Link icons to ~/.local/share/icons so flatpak apps can find them";
|
||||
autoUpdate = mkBoolOption false "Update flatpak apps on nixos-rebuild";
|
||||
autoPrune = mkBoolOption false "Remove unused packages on nixos-rebuild";
|
||||
|
||||
# TODO: Add library function to make this easier
|
||||
# TODO: The flatpak name should be included and a list of all enabled apps should be available
|
||||
# TODO: Do this for strings + packages
|
||||
discord.enable = mkEnableOpt "Discord";
|
||||
spotify.enable = mkEnableOpt "Spotify";
|
||||
flatseal.enable = mkEnableOpt "Flatseal";
|
||||
bottles.enable = mkEnableOpt "Bottles";
|
||||
obsidian.enable = mkEnableOpt "Obsidian";
|
||||
jabref.enable = mkEnableOpt "Jabref";
|
||||
# xwaylandvideobridge = mkEnableOpt "XWayland Video Bridge"; # TODO
|
||||
discord.enable = mkEnableOption "Discord";
|
||||
spotify.enable = mkEnableOption "Spotify";
|
||||
flatseal.enable = mkEnableOption "Flatseal";
|
||||
bottles.enable = mkEnableOption "Bottles";
|
||||
obsidian.enable = mkEnableOption "Obsidian";
|
||||
jabref.enable = mkEnableOption "Jabref";
|
||||
# xwaylandvideobridge = mkEnableOption "XWayland Video Bridge"; # TODO
|
||||
|
||||
# TODO: Can I use extraInstall = { "com.valve.Steam" = true/false; } and pass the module option as value?
|
||||
# This is mainly used by other modules to allow them to use flatpak packages
|
||||
|
@ -5,19 +5,19 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Gaming module";
|
||||
enable = mkEnableOption "Gaming module";
|
||||
|
||||
# discordElectron.enable = mkEnableOpt "Discord (Electron) (nixpkgs)";
|
||||
# discordChromium.enable = mkEnableOpt "Discord (Chromium)";
|
||||
prism.enable = mkEnableOpt "PrismLauncher for Minecraft (flatpak)";
|
||||
bottles.enable = mkEnableOpt "Bottles (flatpak)";
|
||||
# dwarffortress.enable = mkEnableOpt "Dwarf Fortress";
|
||||
cemu.enable = mkEnableOpt "Cemu (nixpkgs)";
|
||||
# discordElectron.enable = mkEnableOption "Discord (Electron) (nixpkgs)";
|
||||
# discordChromium.enable = mkEnableOption "Discord (Chromium)";
|
||||
prism.enable = mkEnableOption "PrismLauncher for Minecraft (flatpak)";
|
||||
bottles.enable = mkEnableOption "Bottles (flatpak)";
|
||||
# dwarffortress.enable = mkEnableOption "Dwarf Fortress";
|
||||
cemu.enable = mkEnableOption "Cemu (nixpkgs)";
|
||||
|
||||
steam = {
|
||||
enable = mkEnableOpt "Steam (flatpak)";
|
||||
gamescope = mkBoolOpt false "Enable the gamescope micro compositor (flatpak)";
|
||||
adwaita = mkBoolOpt false "Enable the adwaita-for-steam skin";
|
||||
protonup = mkBoolOpt false "Enable ProtonUP-QT";
|
||||
enable = mkEnableOption "Steam (flatpak)";
|
||||
gamescope = mkBoolOption false "Enable the gamescope micro compositor (flatpak)";
|
||||
adwaita = mkBoolOption false "Enable the adwaita-for-steam skin";
|
||||
protonup = mkBoolOption false "Enable ProtonUP-QT";
|
||||
};
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Helix Editor";
|
||||
enable = mkEnableOption "Helix Editor";
|
||||
}
|
||||
|
@ -5,15 +5,15 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Misc module";
|
||||
enable = mkEnableOption "Misc module";
|
||||
|
||||
keepass = {
|
||||
enable = mkEnableOpt "KeePassXC";
|
||||
autostart = mkBoolOpt false "Autostart KeePassXC";
|
||||
enable = mkEnableOption "KeePassXC";
|
||||
autostart = mkBoolOption false "Autostart KeePassXC";
|
||||
};
|
||||
|
||||
protonmail = {
|
||||
enable = mkEnableOpt "ProtonMail";
|
||||
autostart = mkBoolOpt false "Autostart ProtonMail Bridge";
|
||||
enable = mkEnableOption "ProtonMail";
|
||||
autostart = mkBoolOption false "Autostart ProtonMail Bridge";
|
||||
};
|
||||
}
|
||||
|
@ -5,6 +5,6 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Nextcloud Client";
|
||||
autostart = mkBoolOpt false "Autostart the Nextcloud client (systemd)";
|
||||
enable = mkEnableOption "Nextcloud Client";
|
||||
autostart = mkBoolOption false "Autostart the Nextcloud client (systemd)";
|
||||
}
|
||||
|
@ -5,6 +5,6 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Ranger";
|
||||
preview = mkBoolOpt false "Enable Ranger image preview";
|
||||
enable = mkEnableOption "Ranger";
|
||||
preview = mkBoolOption false "Enable Ranger image preview";
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Visual Studio Code";
|
||||
enable = mkEnableOption "Visual Studio Code";
|
||||
}
|
||||
|
@ -5,6 +5,6 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Chromium";
|
||||
google = mkEnableOpt "Google Chrome";
|
||||
enable = mkEnableOption "Chromium";
|
||||
google = mkEnableOption "Google Chrome";
|
||||
}
|
||||
|
@ -5,10 +5,10 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Firefox";
|
||||
wayland = mkBoolOpt false "Enable firefox wayland support";
|
||||
vaapi = mkBoolOpt false "Enable firefox vaapi support";
|
||||
disableTabBar = mkBoolOpt false "Disable the firefox tab bar (for TST)";
|
||||
defaultBookmarks = mkBoolOpt false "Preset standard bookmarks and folders";
|
||||
gnomeTheme = mkBoolOpt false "Use Firefox gnome theme (rafaelmardojai)";
|
||||
enable = mkEnableOption "Firefox";
|
||||
wayland = mkBoolOption false "Enable firefox wayland support";
|
||||
vaapi = mkBoolOption false "Enable firefox vaapi support";
|
||||
disableTabBar = mkBoolOption false "Disable the firefox tab bar (for TST)";
|
||||
defaultBookmarks = mkBoolOption false "Preset standard bookmarks and folders";
|
||||
gnomeTheme = mkBoolOption false "Use Firefox gnome theme (rafaelmardojai)";
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Fish";
|
||||
enable = mkEnableOption "Fish";
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
# TODO: Use the home-manager module instead of generating my own scuffed config files
|
||||
#
|
||||
# TODO: The keys to reset the workspaces need to depend on actual workspace config
|
||||
# TODO: Many of the text file generations can be made simpler with pipe and concatLines functions...
|
||||
# TODO: The border color does not fit the current theme
|
||||
{
|
||||
config,
|
||||
@ -39,7 +40,6 @@ in {
|
||||
};
|
||||
|
||||
services = {
|
||||
# TODO: Make a module out of this
|
||||
# Notification service
|
||||
dunst = {
|
||||
enable = true;
|
||||
@ -78,14 +78,11 @@ in {
|
||||
};
|
||||
|
||||
home = {
|
||||
# TODO: catppuccin-cursors
|
||||
pointerCursor = {
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Classic";
|
||||
# package = pkgs.catppuccin-cursors.latteMauve;
|
||||
# name = "Catppuccin-Latte-Mauve-Cursors";
|
||||
size = 16;
|
||||
};
|
||||
|
||||
@ -118,13 +115,22 @@ in {
|
||||
#
|
||||
|
||||
file = {
|
||||
# Polkit
|
||||
# Link the main Hyprland configuration file.
|
||||
# This file imports all the other generated files.
|
||||
# TODO: Generate this, so only existing files are imported.
|
||||
".config/hypr/hyprland.conf".source = ../../../config/hyprland/hyprland.conf;
|
||||
|
||||
# Provide a polkit authentication UI.
|
||||
# This is used for example when running systemd commands without root.
|
||||
".config/hypr/polkit.conf".text = ''
|
||||
exec-once = ${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1
|
||||
exec-once = ${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1
|
||||
'';
|
||||
|
||||
# Monitors for different systems
|
||||
# Configure different monitors.
|
||||
".config/hypr/monitors.conf".text = let
|
||||
# This function is mapped to the "cfg.monitors" attrSet.
|
||||
# For each key-value entry in "cfg.monitors",
|
||||
# the key will be assigned to "name" and the value to "conf".
|
||||
mkMonitor = name: conf: "monitor = ${name}, ${toString conf.width}x${toString conf.height}@${toString conf.rate}, ${toString conf.x}x${toString conf.y}, ${toString conf.scale}";
|
||||
in
|
||||
lib.pipe cfg.monitors [
|
||||
@ -133,7 +139,7 @@ in {
|
||||
(builtins.concatStringsSep "\n")
|
||||
];
|
||||
|
||||
# Bind workspaces to monitors
|
||||
# Configure how workspaces are mapped to monitors.
|
||||
".config/hypr/workspaces.conf".text = let
|
||||
mkWorkspace = monitor: workspace: "workspace = ${toString workspace}, monitor:${toString monitor}";
|
||||
mkWorkspaces = monitor: workspace-list: map (mkWorkspace monitor) workspace-list;
|
||||
@ -259,14 +265,6 @@ in {
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
activation = {
|
||||
# TODO: Don't symlink at all, why not just tell Hyprland where the config is? Much easier
|
||||
# NOTE: Keep the hyprland config symlinked, to allow easy changes with hotreload
|
||||
linkHyprlandConfig =
|
||||
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||
(mylib.modules.mkLink "~/NixFlake/config/hyprland/hyprland.conf" "~/.config/hypr/hyprland.conf");
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Hyprland Window Manager + Compositor";
|
||||
enable = mkEnableOption "Hyprland Window Manager + Compositor";
|
||||
|
||||
kb-layout = mkOption {
|
||||
type = types.str;
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Kitty";
|
||||
enable = mkEnableOption "Kitty";
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Enable LaTeX";
|
||||
enable = mkEnableOption "Enable LaTeX";
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "NeoVim";
|
||||
alias = mkBoolOpt false "Link nvim to vim/vi";
|
||||
neovide = mkEnableOpt "NeoVide";
|
||||
enable = mkEnableOption "NeoVim";
|
||||
alias = mkBoolOption false "Link nvim to vim/vi";
|
||||
neovide = mkEnableOption "NeoVide";
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "NNN File Manager";
|
||||
enable = mkEnableOption "NNN File Manager";
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
# VPN and Container modules should use this rofi module to enable their menus then
|
||||
{
|
||||
config,
|
||||
nixosConfig,
|
||||
lib,
|
||||
mylib,
|
||||
pkgs,
|
||||
@ -34,14 +33,9 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
home.activation = {
|
||||
# NOTE: Keep the rofi config symlinked, to allow easy changes with hotreload
|
||||
linkRofiConfig =
|
||||
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||
(mylib.modules.mkLink "~/NixFlake/config/rofi/rofi.rasi" "~/.config/rofi/config.rasi");
|
||||
linkRofiColors =
|
||||
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||
(mylib.modules.mkLink "~/NixFlake/config/rofi/colors/${cfg.theme}.rasi" "~/.config/rofi/colors.rasi");
|
||||
home.file = {
|
||||
".config/rofi/config.rasi".source = ../../../config/rofi/rofi.rasi;
|
||||
".config/rofi/colors.rasi".source = ../../../config/rofi/colors/${cfg.theme}.rasi;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Rofi";
|
||||
enable = mkEnableOption "Rofi";
|
||||
|
||||
theme = mkOption {
|
||||
type = types.str;
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Waybar";
|
||||
enable = mkEnableOption "Waybar";
|
||||
|
||||
monitor = mkOption {
|
||||
type = types.str;
|
||||
|
@ -5,5 +5,5 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Enable Zathura";
|
||||
enable = mkEnableOption "Enable Zathura";
|
||||
}
|
||||
|
@ -4,6 +4,9 @@
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Import my own library functions.
|
||||
# Those are defined as functions returning sets of library functions,
|
||||
# so those functions have to be called when importing.
|
||||
nixos = import ./nixos.nix {inherit inputs pkgs lib;};
|
||||
modules = import ./modules.nix {inherit inputs pkgs lib;};
|
||||
networking = import ./networking.nix {inherit inputs pkgs lib;};
|
||||
|
@ -1,63 +1,44 @@
|
||||
# TODO: Easier mkLink/mkUnlink (include more hm.dag stuff into the function)
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: rec {
|
||||
# Conveniance wrapper for mkOption with boolean type
|
||||
mkBoolOpt = def: desc:
|
||||
# Convenience wrapper for "mkOption" with boolean type.
|
||||
mkBoolOption = def: desc:
|
||||
lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = def;
|
||||
description = desc;
|
||||
};
|
||||
|
||||
# Alias for consistency
|
||||
mkEnableOpt = lib.mkEnableOption;
|
||||
|
||||
# Like mkIf but the predicate is inverted
|
||||
# Like "lib.mkIf" but the predicate is inverted.
|
||||
# Returns "do" if "pred" is false.
|
||||
mkElse = pred: do: (lib.mkIf (!pred) do);
|
||||
|
||||
# Creates a symlink if it doesn't exist
|
||||
# If it exists renew the link
|
||||
mkLink = src: dest: ''
|
||||
if [ -L "${dest}" ]; then
|
||||
rm ${dest}
|
||||
fi
|
||||
ln -sf ${src} ${dest}
|
||||
'';
|
||||
|
||||
# Removes a symlink if it exists
|
||||
mkUnlink = dest: ''
|
||||
if [ -L "${dest}" ]; then
|
||||
rm ${dest}
|
||||
fi
|
||||
'';
|
||||
|
||||
# Returns true if base contains element
|
||||
# Returns "true" if "base" contains "element".
|
||||
contains = base: element:
|
||||
lib.any (x: x == element) base;
|
||||
|
||||
# Returns base without occurences of elements that are also in remove
|
||||
# Returns "base" without occurences of elements that are also in "remove".
|
||||
without = base: remove:
|
||||
lib.filter (x: !(contains remove x)) base;
|
||||
|
||||
# For use with single element sets
|
||||
# Used with attrSets with a single element.
|
||||
# Returns the name of the single attr.
|
||||
attrName = set: let
|
||||
names = lib.attrNames set;
|
||||
in (
|
||||
in
|
||||
if (names != [])
|
||||
then (lib.head names)
|
||||
else null
|
||||
);
|
||||
else null;
|
||||
|
||||
# For use with single element sets
|
||||
# Used with attrSets with a single element.
|
||||
# Returns the value of the single attr.
|
||||
attrValue = set: let
|
||||
values = lib.attrValues set;
|
||||
in (
|
||||
in
|
||||
if (values != [])
|
||||
then (lib.head values)
|
||||
else null
|
||||
);
|
||||
else null;
|
||||
}
|
||||
|
@ -14,36 +14,40 @@
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
# Make our inputs available to the configuration.nix (for importing modules)
|
||||
# specialArgs are propagated to all modules
|
||||
# Values in "specialArgs" are propagated to all system modules.
|
||||
specialArgs = {inherit inputs hostname mylib system username;};
|
||||
|
||||
modules = builtins.concatLists [
|
||||
[
|
||||
# Replace the pkgs to include overlays/unfree
|
||||
# Replace the default "pkgs" with my configured version
|
||||
# to allow installation of unfree software and my own overlays.
|
||||
{nixpkgs.pkgs = pkgs;}
|
||||
|
||||
# Main config file for all configs/hosts
|
||||
# Import the toplevel system configuration module.
|
||||
../system
|
||||
]
|
||||
|
||||
extraModules
|
||||
|
||||
# HM is installed as a system module
|
||||
# HM is installed as a system module when using mkNixosConfigWithHomeManagerModule.
|
||||
[
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
# extraSpecialArgs are propagated to all hm config modules
|
||||
home-manager.extraSpecialArgs = {inherit inputs hostname username mylib;};
|
||||
home-manager = {
|
||||
# Values in "extraSpecialArgs" are propagated to all HM modules.
|
||||
extraSpecialArgs = {inherit inputs hostname username mylib;};
|
||||
|
||||
# Use systems pkgs, disables nixpkgs.* options in home.nix
|
||||
home-manager.useGlobalPkgs = true;
|
||||
# Use the "pkgs" from the system configuration.
|
||||
# This disables "nixpkgs.*" options in HM modules.
|
||||
useGlobalPkgs = true;
|
||||
|
||||
# Enable installing packages through users.christoph.packages to /etc/profiles instead of ~/.nix-profile
|
||||
home-manager.useUserPackages = true;
|
||||
# Packages in "users.${username}.packages" will be installed
|
||||
# to /etc/profiles instead of ~/.nix-profile.
|
||||
useUserPackages = true;
|
||||
|
||||
# User specific config file
|
||||
home-manager.users.${username}.imports = [../home/${username}];
|
||||
# Import the user-specific HM toplevel module.
|
||||
users.${username}.imports = [../home/${username}];
|
||||
};
|
||||
}
|
||||
]
|
||||
];
|
||||
@ -58,16 +62,16 @@
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
# Make our inputs available to the configuration.nix (for importing modules)
|
||||
# specialArgs are propagated to all modules
|
||||
# Values in "specialArgs" are propagated to all system modules.
|
||||
specialArgs = {inherit inputs hostname mylib system;};
|
||||
|
||||
modules = builtins.concatLists [
|
||||
[
|
||||
# Replace the pkgs to include overlays/unfree
|
||||
# Replace the default "pkgs" with my configured version
|
||||
# to allow installation of unfree software and my own overlays.
|
||||
{nixpkgs.pkgs = pkgs;}
|
||||
|
||||
# Main config file for all configs/hosts
|
||||
# Import the toplevel system configuration module.
|
||||
../system
|
||||
]
|
||||
|
||||
@ -85,11 +89,12 @@
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
# HM propagates these to every module
|
||||
# Values in "extraSpecialArgs" are propagated to all HM modules.
|
||||
extraSpecialArgs = {inherit inputs system mylib username hostname;};
|
||||
|
||||
modules = builtins.concatLists [
|
||||
[
|
||||
# Import the user-specific HM toplevel module.
|
||||
../home/${username}
|
||||
]
|
||||
|
||||
|
@ -9,35 +9,35 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Enable OCI Containers";
|
||||
enable = mkEnableOption "Enable OCI Containers";
|
||||
|
||||
homeassistant = {
|
||||
enable = mkEnableOpt "Enable HomeAssistant Container";
|
||||
enable = mkEnableOption "Enable HomeAssistant Container";
|
||||
};
|
||||
stablediffusion = {
|
||||
enable = mkEnableOpt "Enable StableDiffusion Container with Automatic1111 WebUI";
|
||||
enable = mkEnableOption "Enable StableDiffusion Container with Automatic1111 WebUI";
|
||||
};
|
||||
jellyfin = {
|
||||
enable = mkEnableOpt "Enable Jellyfin Container";
|
||||
enable = mkEnableOption "Enable Jellyfin Container";
|
||||
};
|
||||
fileflows = {
|
||||
enable = mkEnableOpt "Enable FileFlows Container";
|
||||
enable = mkEnableOption "Enable FileFlows Container";
|
||||
};
|
||||
sonarr = {
|
||||
enable = mkEnableOpt "Enable Sonarr Container";
|
||||
enable = mkEnableOption "Enable Sonarr Container";
|
||||
};
|
||||
radarr = {
|
||||
enable = mkEnableOpt "Enable Radarr Container";
|
||||
enable = mkEnableOption "Enable Radarr Container";
|
||||
};
|
||||
hydra = {
|
||||
enable = mkEnableOpt "Enable Hydra Container";
|
||||
enable = mkEnableOption "Enable Hydra Container";
|
||||
};
|
||||
sabnzbd = {
|
||||
enable = mkEnableOpt "Enable SabNzbd Container";
|
||||
enable = mkEnableOption "Enable SabNzbd Container";
|
||||
};
|
||||
|
||||
rofiIntegration = {
|
||||
enable = mkEnableOpt "Enable Rofi Menu for Container Servicing";
|
||||
enable = mkEnableOption "Enable Rofi Menu for Container Servicing";
|
||||
hotkey = mkOption {
|
||||
type = types.str;
|
||||
example = ''
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Polkit";
|
||||
enable = mkEnableOption "Polkit";
|
||||
|
||||
allowed-system-services = mkOption {
|
||||
type = types.listOf types.str;
|
||||
|
@ -5,7 +5,7 @@
|
||||
}:
|
||||
with lib;
|
||||
with mylib.modules; {
|
||||
enable = mkEnableOpt "Systemd Network Configuration";
|
||||
enable = mkEnableOption "Systemd Network Configuration";
|
||||
|
||||
hostname = mkOption {
|
||||
type = types.str;
|
||||
|
Reference in New Issue
Block a user