1
0
Fork 0

General: cleanup 'with lib;'s

This commit is contained in:
Aires 2024-08-02 17:55:48 -04:00
parent 148c11f8b9
commit 0f8a5d41a5
38 changed files with 215 additions and 321 deletions

View file

@ -1,9 +1,4 @@
{ { config, pkgs, ... }:
config,
lib,
pkgs,
...
}:
let let
# Do not change this value! This tracks when NixOS was installed on your system. # Do not change this value! This tracks when NixOS was installed on your system.

View file

@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:

View file

@ -1,10 +1,4 @@
{ { ... }:
config,
lib,
pkgs,
system,
...
}:
let let
# Do not change this value! This tracks when NixOS was installed on your system. # Do not change this value! This tracks when NixOS was installed on your system.

View file

@ -2,7 +2,6 @@
config, config,
pkgs, pkgs,
lib, lib,
nix-secrets,
... ...
}: }:
let let

View file

@ -1,13 +1,6 @@
# Raspberry Pi 4B # Raspberry Pi 4B
# See https://wiki.nixos.org/wiki/NixOS_on_ARM/Raspberry_Pi_4 # See https://wiki.nixos.org/wiki/NixOS_on_ARM/Raspberry_Pi_4
{ { lib, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
nixos-hardware,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -1,9 +1,4 @@
{ { config, pkgs, ... }:
config,
pkgs,
lib,
...
}:
let let
# Do not change this value! This tracks when NixOS was installed on your system. # Do not change this value! This tracks when NixOS was installed on your system.
stateVersion = "24.05"; stateVersion = "24.05";
@ -30,6 +25,12 @@ in
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
networking.hostName = hostName; networking.hostName = hostName;
# TESTING: Try out different GTK renderers: gl (old), ngl (new), or vulkan (new and unstable)
# See https://blog.gtk.org/2024/01/28/new-renderers-for-gtk/
environment.sessionVariables = {
"GSK_RENDERER" = "gl";
};
aux.system = { aux.system = {
apps = { apps = {
development.enable = true; development.enable = true;

View file

@ -1,11 +1,5 @@
# Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7) # Lenovo Legion Slim 7 Gen 7 AMD (16ARHA7)
{ { pkgs, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
let let
bootUUID = "AFCB-D880"; # The UUID of the boot partition. bootUUID = "AFCB-D880"; # The UUID of the boot partition.
luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition. luksUUID = "bcf67e34-339e-40b9-8ffd-bec8f7f55248"; # The UUID of the locked LUKS partition.

View file

@ -1,10 +1,4 @@
{ { pkgs, config, ... }:
pkgs,
home-manager,
lib,
config,
...
}:
let let
stateVersion = "24.05"; stateVersion = "24.05";
hostName = "Haven"; hostName = "Haven";

View file

@ -1,11 +1,5 @@
# Minisforum UM340 # Minisforum UM340
{ { config, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

View file

@ -2,7 +2,6 @@
{ {
config, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }:

View file

@ -8,17 +8,16 @@
let let
cfg = config.aux.system.apps.development; cfg = config.aux.system.apps.development;
in in
with lib;
{ {
options = { options = {
aux.system.apps.development = { aux.system.apps.development = {
enable = mkEnableOption (mdDoc "Enables development tools"); enable = lib.mkEnableOption "Enables development tools";
kubernetes.enable = mkEnableOption (mdDoc "Enables kubectl, virtctl, and similar tools."); kubernetes.enable = lib.mkEnableOption "Enables kubectl, virtctl, and similar tools.";
}; };
}; };
config = mkMerge [ config = lib.mkMerge [
(mkIf cfg.enable { (lib.mkIf cfg.enable {
aux.system = { aux.system = {
packages = with pkgs; [ nixd ]; packages = with pkgs; [ nixd ];
ui.flatpak = { ui.flatpak = {
@ -27,7 +26,7 @@ with lib;
}; };
}; };
}) })
(mkIf cfg.kubernetes.enable { (lib.mkIf cfg.kubernetes.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kubectl kubectl
kubernetes-helm kubernetes-helm

View file

@ -3,13 +3,12 @@
let let
cfg = config.aux.system.apps.dj; cfg = config.aux.system.apps.dj;
in in
with lib;
{ {
options = { options = {
aux.system.apps.dj.enable = mkEnableOption (mdDoc "Enables DJing tools (i.e. Mixxx)"); aux.system.apps.dj.enable = lib.mkEnableOption "Enables DJing tools (i.e. Mixxx)";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { aux.system.ui.flatpak = {
enable = true; enable = true;
packages = [ "org.mixxx.Mixxx" ]; packages = [ "org.mixxx.Mixxx" ];

View file

@ -14,13 +14,12 @@ let
sudo systemctl restart bluetooth.service sudo systemctl restart bluetooth.service
''; '';
in in
with lib;
{ {
options = { options = {
aux.system.apps.gaming.enable = mkEnableOption (mdDoc "Enables gaming features"); aux.system.apps.gaming.enable = lib.mkEnableOption "Enables gaming features";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { aux.system.ui.flatpak = {
enable = true; enable = true;
packages = [ packages = [

View file

@ -3,13 +3,12 @@
let let
cfg = config.aux.system.apps.media; cfg = config.aux.system.apps.media;
in in
with lib;
{ {
options = { options = {
aux.system.apps.media.enable = mkEnableOption (mdDoc "Enables media playback and editing apps"); aux.system.apps.media.enable = lib.mkEnableOption "Enables media playback and editing apps";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { aux.system.ui.flatpak = {
enable = true; enable = true;
packages = [ packages = [

View file

@ -3,13 +3,12 @@
let let
cfg = config.aux.system.apps.office; cfg = config.aux.system.apps.office;
in in
with lib;
{ {
options = { options = {
aux.system.apps.office.enable = mkEnableOption (mdDoc "Enables office and workstation apps"); aux.system.apps.office.enable = lib.mkEnableOption "Enables office and workstation apps";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak = { aux.system.ui.flatpak = {
enable = true; enable = true;
packages = [ packages = [

View file

@ -8,13 +8,12 @@
let let
cfg = config.aux.system.apps.recording; cfg = config.aux.system.apps.recording;
in in
with lib;
{ {
options = { options = {
aux.system.apps.recording.enable = mkEnableOption (mdDoc "Enables video editing tools"); aux.system.apps.recording.enable = lib.mkEnableOption "Enables video editing tools";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.flatpak.enable = true; aux.system.ui.flatpak.enable = true;
services.flatpak.packages = [ services.flatpak.packages = [

View file

@ -8,13 +8,12 @@
let let
cfg = config.aux.system.apps.social; cfg = config.aux.system.apps.social;
in in
with lib;
{ {
options = { options = {
aux.system.apps.social.enable = mkEnableOption (mdDoc "Enables chat apps"); aux.system.apps.social.enable = lib.mkEnableOption "Enables chat apps";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system = { aux.system = {
allowUnfree = true; allowUnfree = true;
ui.flatpak = { ui.flatpak = {

View file

@ -1,20 +1,14 @@
{ { config, lib, ... }:
pkgs,
config,
lib,
...
}:
let let
cfg = config.aux.system.apps.tmux; cfg = config.aux.system.apps.tmux;
in in
with lib;
{ {
options = { options = {
aux.system.apps.tmux.enable = mkEnableOption (mdDoc "Enables tmux - terminal multiplexer"); aux.system.apps.tmux.enable = lib.mkEnableOption "Enables tmux - terminal multiplexer";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
newSession = true; newSession = true;

View file

@ -1,27 +1,29 @@
# Auto-import modules in this folder, recursively. # Auto-import modules in this folder, recursively.
# Sourced from https://github.com/evanjs/nixos_cfg/blob/4bb5b0b84a221b25cf50853c12b9f66f0cad3ea4/config/new-modules/default.nix # Sourced from https://github.com/evanjs/nixos_cfg/blob/4bb5b0b84a221b25cf50853c12b9f66f0cad3ea4/config/new-modules/default.nix
{ lib, ... }: { lib, ... }:
with lib;
let let
# Recursively constructs an attrset of a given folder, recursing on directories, value of attrs is the filetype # Recursively constructs an attrset of a given folder, recursing on directories, value of attrs is the filetype
getDir = getDir =
dir: dir:
mapAttrs (file: type: if type == "directory" then getDir "${dir}/${file}" else type) ( lib.mapAttrs (file: type: if type == "directory" then getDir "${dir}/${file}" else type) (
builtins.readDir dir builtins.readDir dir
); );
# Collects all files of a directory as a list of strings of paths # Collects all files of a directory as a list of strings of paths
files = files =
dir: collect isString (mapAttrsRecursive (path: type: concatStringsSep "/" path) (getDir dir)); dir:
lib.collect lib.isString (
lib.mapAttrsRecursive (path: type: lib.concatStringsSep "/" path) (getDir dir)
);
# Search all files and folders within and below the current directory. # Search all files and folders within and below the current directory.
# Filters out directories that belong to home-manager, and don't end with .nix or are this file. # Filters out directories that belong to home-manager, and don't end with .nix or are this file.
validFiles = validFiles =
dir: dir:
map (file: ./. + "/${file}") ( map (file: ./. + "/${file}") (
filter (file: !hasInfix "home-manager" file && file != "autoimport.nix" && hasSuffix ".nix" file) ( lib.filter (
files dir file: !lib.hasInfix "home-manager" file && file != "autoimport.nix" && lib.hasSuffix ".nix" file
) ) (files dir)
); );
in in
{ {

View file

@ -1,17 +1,11 @@
{ { config, lib, ... }:
pkgs,
config,
lib,
...
}:
let let
cfg = config.aux.system.services.apcupsd; cfg = config.aux.system.services.apcupsd;
in in
with lib;
{ {
options = { options = {
aux.system.services.apcupsd = { aux.system.services.apcupsd = {
enable = mkEnableOption (mdDoc "Enables apcupsd"); enable = lib.mkEnableOption "Enables apcupsd";
configText = lib.mkOption { configText = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "The configuration to pass to apcupsd."; description = "The configuration to pass to apcupsd.";
@ -19,7 +13,7 @@ with lib;
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.apcupsd = { services.apcupsd = {
enable = true; enable = true;
configText = cfg.configText; configText = cfg.configText;

View file

@ -1,10 +1,5 @@
# Run automatic updates. Replaces system.autoUpgrade. # Run automatic updates. Replaces system.autoUpgrade.
{ { config, lib, ... }:
config,
lib,
pkgs,
...
}:
let let
cfg = config.aux.system.services.autoUpgrade; cfg = config.aux.system.services.autoUpgrade;

View file

@ -1,10 +1,5 @@
# Serves a binary cache for Nix packages # Serves a binary cache for Nix packages
{ { config, lib, ... }:
config,
lib,
self,
...
}:
let let
cfg = config.aux.system.services.cache; cfg = config.aux.system.services.cache;

View file

@ -9,20 +9,19 @@ let
cfg = config.aux.system.services.duplicacy-web; cfg = config.aux.system.services.duplicacy-web;
duplicacy-web = pkgs.callPackage ../../packages/duplicacy-web.nix { inherit pkgs lib; }; duplicacy-web = pkgs.callPackage ../../packages/duplicacy-web.nix { inherit pkgs lib; };
in in
with lib; {
rec {
options = { options = {
aux.system.services.duplicacy-web = { aux.system.services.duplicacy-web = {
enable = mkEnableOption (mdDoc "Enables duplicacy-web"); enable = lib.mkEnableOption "Enables duplicacy-web";
autostart = mkOption { autostart = lib.mkOption {
default = true; default = true;
type = types.bool; type = lib.types.bool;
description = "Whether to auto-start duplicacy-web on boot"; description = "Whether to auto-start duplicacy-web on boot";
}; };
environment = mkOption { environment = lib.mkOption {
default = ""; default = "";
type = types.str; type = lib.types.str;
description = "Environment where duplicacy-web stores its config files"; description = "Environment where duplicacy-web stores its config files";
}; };
}; };

View file

@ -4,13 +4,12 @@
let let
cfg = config.aux.system.services.msmtp; cfg = config.aux.system.services.msmtp;
in in
with lib;
{ {
options = { options = {
aux.system.services.msmtp.enable = mkEnableOption (mdDoc "Enables mail server"); aux.system.services.msmtp.enable = lib.mkEnableOption "Enables mail server";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.msmtp = { programs.msmtp = {
enable = true; enable = true;
accounts.default = { accounts.default = {

View file

@ -39,7 +39,7 @@ in
}; };
config = lib.mkMerge [ config = lib.mkMerge [
({ programs.virt-manager.enable = cfg.enable; }) { programs.virt-manager.enable = cfg.enable; }
(lib.mkIf (cfg.host.enable || cfg.host.vmBuilds.enable) { (lib.mkIf (cfg.host.enable || cfg.host.vmBuilds.enable) {
virtualisation = { virtualisation = {
libvirtd = { libvirtd = {

View file

@ -1,11 +1,5 @@
# Basic system-wide text editor configuration. # Basic system-wide text editor configuration.
{ { config, lib, ... }:
pkgs,
config,
lib,
inputs,
...
}:
let let
cfg = config.aux.system.editor; cfg = config.aux.system.editor;

View file

@ -1,6 +1,5 @@
# Core Nix configuration # Core Nix configuration
{ {
pkgs,
config, config,
lib, lib,
inputs, inputs,

View file

@ -1,10 +1,5 @@
# Enables the Budgie desktop environment. # Enables the Budgie desktop environment.
{ { config, lib, ... }:
pkgs,
config,
lib,
...
}:
let let
cfg = config.aux.system.ui.desktops.budgie; cfg = config.aux.system.ui.desktops.budgie;
in in

View file

@ -1,10 +1,5 @@
# Enables the Hyprland desktop environment. # Enables the Hyprland desktop environment.
{ { config, lib, ... }:
pkgs,
config,
lib,
...
}:
let let
cfg = config.aux.system.ui.desktops.hyprland; cfg = config.aux.system.ui.desktops.hyprland;
in in

View file

@ -1,10 +1,5 @@
# Enables the XFCE desktop environment. # Enables the XFCE desktop environment.
{ { config, lib, ... }:
pkgs,
config,
lib,
...
}:
let let
cfg = config.aux.system.ui.desktops.xfce; cfg = config.aux.system.ui.desktops.xfce;
in in

View file

@ -1,5 +1,4 @@
{ {
nix-flatpak,
pkgs, pkgs,
config, config,
lib, lib,

View file

@ -9,160 +9,161 @@
let let
cfg = config.aux.system.users.aires; cfg = config.aux.system.users.aires;
in in
with lib;
{ {
options = { options = {
aux.system.users.aires = { aux.system.users.aires = {
enable = mkEnableOption (mdDoc "Enables aires user account"); enable = lib.mkEnableOption "Enables aires user account";
autologin = mkEnableOption (mdDoc "Automatically logs aires in on boot"); autologin = lib.mkEnableOption "Automatically logs aires in on boot";
services.syncthing = { services.syncthing = {
enable = mkEnableOption (mdDoc "Enables Syncthing"); enable = lib.mkEnableOption "Enables Syncthing";
enableTray = mkEnableOption (mdDoc "Enables the Syncthing Tray application"); enableTray = lib.mkEnableOption "Enables the Syncthing Tray application";
autostart = mkOption { autostart = lib.mkOption {
default = true; default = true;
type = types.bool; type = lib.types.bool;
description = "Whether to auto-start Syncthing on boot"; description = "Whether to auto-start Syncthing on boot";
}; };
}; };
}; };
}; };
config = mkIf cfg.enable (mkMerge [ config = lib.mkIf cfg.enable (
{ lib.mkMerge [
users.users.aires = { {
isNormalUser = true; users.users.aires = {
description = "Aires"; isNormalUser = true;
uid = 1000; description = "Aires";
hashedPassword = config.secrets.users.aires.hashedPassword; uid = 1000;
extraGroups = [ hashedPassword = config.secrets.users.aires.hashedPassword;
"input" extraGroups = [
"networkmanager" "input"
"plugdev" "networkmanager"
"tss" "plugdev"
"wheel" "tss"
]; # tss group has access to TPM devices "wheel"
]; # tss group has access to TPM devices
# Allow systemd services to run even while aires is logged out # Allow systemd services to run even while aires is logged out
linger = true; linger = true;
}; };
# Configure home-manager # Configure home-manager
home-manager.users.aires = { home-manager.users.aires = {
imports = [ imports = [
../common/home-manager/gnome.nix ../common/home-manager/gnome.nix
../common/home-manager/zsh.nix ../common/home-manager/zsh.nix
];
home = {
# The state version is required and should stay at the version you originally installed.
stateVersion = "24.05";
# Basic setup
username = "aires";
homeDirectory = "/home/aires";
# Install extra packages, specifically gnome extensions
packages = lib.mkIf config.aux.system.ui.desktops.gnome.enable [
pkgs.gnomeExtensions.wallpaper-slideshow
];
# Set environment variables
sessionVariables = {
KUBECONFIG = "/home/aires/.kube/config";
};
# Create .face file
file.".face".source = ./face.png;
};
programs = {
# Let home Manager install and manage itself.
home-manager.enable = true;
# Set up git
git = {
enable = true;
userName = config.secrets.users.aires.firstName;
userEmail = config.secrets.users.aires.email;
extraConfig = {
push.autoSetupRemote = "true";
aliases.pull = "!git pull && git submodule foreach --recursive 'git pull origin main'";
};
};
# Set up SSH
ssh = {
enable = true;
matchBlocks = config.secrets.users.aires.sshConfig;
};
# Set up Zsh
zsh = {
oh-my-zsh = {
theme = "gentoo";
};
shellAliases = {
update = "upgrade";
upgrade = "nh os boot --update --ask";
};
loginExtra = "fastfetch";
};
};
# Gnome settings specific to aires on Shura
/*
dconf.settings = lib.mkIf (config.networking.hostName == "Shura") {
"org/gnome/desktop/interface" = {
# Increase font scaling;
text-scaling-factor = 1.3;
# Dark mode
color-scheme = "prefer-dark";
};
};
*/
};
}
# Autologin aires
(lib.mkIf cfg.autologin {
services.displayManager.autoLogin = {
enable = true;
user = "aires";
};
systemd.services = {
"getty@tty1".enable = false;
"autovt@tty1".enable = false;
};
})
# Enable Syncthing
(lib.mkIf cfg.services.syncthing.enable {
users.users.aires.packages = [
pkgs.syncthing
(lib.mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
]; ];
home = { # Open port 8080
# The state version is required and should stay at the version you originally installed. networking.firewall.allowedTCPPorts = [ 8080 ];
stateVersion = "24.05";
# Basic setup home-manager.users.aires = {
username = "aires"; # Syncthing options
homeDirectory = "/home/aires"; services.syncthing = {
# Install extra packages, specifically gnome extensions
packages = lib.mkIf config.aux.system.ui.desktops.gnome.enable [
pkgs.gnomeExtensions.wallpaper-slideshow
];
# Set environment variables
sessionVariables = {
KUBECONFIG = "/home/aires/.kube/config";
};
# Create .face file
file.".face".source = ./face.png;
};
programs = {
# Let home Manager install and manage itself.
home-manager.enable = true;
# Set up git
git = {
enable = true; enable = true;
userName = config.secrets.users.aires.firstName; extraOptions = [
userEmail = config.secrets.users.aires.email; "--gui-address=0.0.0.0:8080"
extraConfig = { "--home=${config.users.users.aires.home}/.config/syncthing"
push.autoSetupRemote = "true"; "--no-default-folder"
aliases.pull = "!git pull && git submodule foreach --recursive 'git pull origin main'"; ];
};
}; };
# Set up SSH # Override the default Syncthing settings so it doesn't start on boot
ssh = { systemd.user.services."syncthing" = lib.mkIf (!cfg.services.syncthing.autostart) {
enable = true; wantedBy = lib.mkForce { };
matchBlocks = config.secrets.users.aires.sshConfig;
};
# Set up Zsh
zsh = {
oh-my-zsh = {
theme = "gentoo";
};
shellAliases = {
update = "upgrade";
upgrade = "nh os boot --update --ask";
};
loginExtra = "fastfetch";
}; };
}; };
})
# Gnome settings specific to aires on Shura ]
/* );
dconf.settings = lib.mkIf (config.networking.hostName == "Shura") {
"org/gnome/desktop/interface" = {
# Increase font scaling;
text-scaling-factor = 1.3;
# Dark mode
color-scheme = "prefer-dark";
};
};
*/
};
}
# Autologin aires
(mkIf cfg.autologin {
services.displayManager.autoLogin = {
enable = true;
user = "aires";
};
systemd.services = {
"getty@tty1".enable = false;
"autovt@tty1".enable = false;
};
})
# Enable Syncthing
(mkIf cfg.services.syncthing.enable {
users.users.aires.packages = [
pkgs.syncthing
(mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
];
# Open port 8080
networking.firewall.allowedTCPPorts = [ 8080 ];
home-manager.users.aires = {
# Syncthing options
services.syncthing = {
enable = true;
extraOptions = [
"--gui-address=0.0.0.0:8080"
"--home=${config.users.users.aires.home}/.config/syncthing"
"--no-default-folder"
];
};
# Override the default Syncthing settings so it doesn't start on boot
systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) {
wantedBy = lib.mkForce { };
};
};
})
]);
} }

View file

@ -1,9 +1,4 @@
{ { lib, osConfig, ... }:
lib,
pkgs,
osConfig,
...
}:
{ {
# Additional Gnome configurations via home-manager. # Additional Gnome configurations via home-manager.
dconf.settings = lib.mkIf osConfig.aux.system.ui.desktops.gnome.enable { dconf.settings = lib.mkIf osConfig.aux.system.ui.desktops.gnome.enable {

View file

@ -9,26 +9,25 @@
let let
cfg = config.aux.system.users.gremlin; cfg = config.aux.system.users.gremlin;
in in
with lib;
{ {
options = { options = {
aux.system.users.gremlin = { aux.system.users.gremlin = {
enable = mkEnableOption (mdDoc "Enables gremlin user account"); enable = lib.mkEnableOption "Enables gremlin user account";
services.syncthing = { services.syncthing = {
enable = mkEnableOption (mdDoc "Enables Syncthing"); enable = lib.mkEnableOption "Enables Syncthing";
enableTray = mkEnableOption (mdDoc "Enables the Syncthing Tray application"); enableTray = lib.mkEnableOption "Enables the Syncthing Tray application";
autostart = mkOption { autostart = lib.mkOption {
default = true; default = true;
type = types.bool; type = lib.types.bool;
description = "Whether to auto-start Syncthing on boot"; description = "Whether to auto-start Syncthing on boot";
}; };
}; };
}; };
}; };
config = mkMerge [ config = lib.mkMerge [
(mkIf cfg.enable { (lib.mkIf cfg.enable {
# Add Gremlin account # Add Gremlin account
users.users.gremlin = { users.users.gremlin = {
isNormalUser = true; isNormalUser = true;
@ -110,11 +109,11 @@ with lib;
}) })
# Enable Syncthing # Enable Syncthing
(mkIf cfg.services.syncthing.enable { (lib.mkIf cfg.services.syncthing.enable {
users.users.gremlin = { users.users.gremlin = {
packages = [ packages = [
pkgs.syncthing pkgs.syncthing
(mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray) (lib.mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
]; ];
}; };
@ -130,7 +129,7 @@ with lib;
}; };
# Override the default Syncthing settings so it doesn't start on boot # Override the default Syncthing settings so it doesn't start on boot
systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) { systemd.user.services."syncthing" = lib.mkIf (!cfg.services.syncthing.autostart) {
wantedBy = lib.mkForce { }; wantedBy = lib.mkForce { };
}; };
}; };

View file

@ -1,24 +1,18 @@
{ { lib, config, ... }:
pkgs,
lib,
config,
...
}:
# Define user for managing media files # Define user for managing media files
let let
cfg = config.aux.system.users.media; cfg = config.aux.system.users.media;
in in
with lib;
{ {
options = { options = {
aux.system.users.media = { aux.system.users.media = {
enable = mkEnableOption (mdDoc "Enables media user account"); enable = lib.mkEnableOption "Enables media user account";
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
users.groups."media" = { users.groups."media" = {
gid = 1001; gid = 1001;
}; };

View file

@ -1,9 +1,4 @@
{ { config, lib, ... }:
config,
home-manager,
lib,
...
}:
{ {
# Give root user access to run remote builds # Give root user access to run remote builds
home-manager.users.root = { home-manager.users.root = {

View file

@ -23,11 +23,11 @@ stdenv.mkDerivation rec {
airsonic-starts = nixosTests.airsonic; airsonic-starts = nixosTests.airsonic;
}; };
meta = with lib; { meta = {
description = "Free, web-based media streamer providing ubiquitous access to your music."; description = "Free, web-based media streamer providing ubiquitous access to your music.";
homepage = "https://github.com/kagemomiji/airsonic-advanced/"; homepage = "https://github.com/kagemomiji/airsonic-advanced/";
sourceProvenance = with sourceTypes; [ binaryBytecode ]; sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
license = lib.licenses.gpl3; license = lib.licenses.gpl3;
platforms = platforms.all; platforms = lib.platforms.all;
}; };
} }

View file

@ -18,10 +18,10 @@ pkgs.stdenv.mkDerivation rec {
chmod a+x $out/duplicacy-web chmod a+x $out/duplicacy-web
''; '';
meta = with lib; { meta = {
homepage = "https://duplicacy.com"; homepage = "https://duplicacy.com";
description = "A new generation cloud backup tool"; description = "A new generation cloud backup tool";
platforms = platforms.linux; platforms = lib.platforms.linux;
license = licenses.unfreeRedistributable; license = lib.licenses.unfreeRedistributable;
}; };
} }