Compare commits

..

No commits in common. "c74103f1055d62dc46d0e473922bc0c74f449284" and "ef59fd800ecda8e8111831ca8c8352a89e210898" have entirely different histories.

71 changed files with 272 additions and 613 deletions

View file

@ -1,18 +1,11 @@
{ pkgs, lib, config, options, ... }: { pkgs, lib, config, options, ... }:
let
inherit (lib)
mkEnableOption
mkIf
optional
;
in
{ {
options.my.gui = { options.my.gui = {
enable = mkEnableOption "System has some kind of screen attached"; enable = lib.mkEnableOption "System has some kind of screen attached";
isNvidia = mkEnableOption "System a NVIDIA GPU"; isNvidia = lib.mkEnableOption "System a NVIDIA GPU";
}; };
config = mkIf config.my.gui.enable { config = lib.mkIf config.my.gui.enable {
my.displayManager.sddm.enable = true; my.displayManager.sddm.enable = true;
services = { services = {
@ -28,13 +21,13 @@ in
}; };
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = with pkgs; [
inherit (pkgs)
element-desktop element-desktop
feh feh
firefox firefox
ffmpeg ffmpeg
gimp gimp
gnome.nautilus
imagemagick imagemagick
mpv mpv
obs-studio obs-studio
@ -46,12 +39,9 @@ in
thunderbird thunderbird
virt-manager virt-manager
zathura zathura
;
inherit (pkgs.gnome) nautilus; unstable.discord
];
inherit (pkgs.unstable) discord;
};
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
programs.nm-applet.enable = true; programs.nm-applet.enable = true;

View file

@ -1,12 +1,6 @@
{ lib, ... }: { lib, ... }:
let
inherit (lib)
mkOption
types
;
in
{ {
options.my.networking.externalInterface = mkOption { options.my.networking.externalInterface = with lib; mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
example = "eth0"; example = "eth0";

View file

@ -19,8 +19,7 @@
bandwhich.enable = true; bandwhich.enable = true;
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = with pkgs; [
inherit (pkgs)
# shell usage # shell usage
fd fd
ripgrep ripgrep
@ -40,6 +39,8 @@
pinentry-curses pinentry-curses
python3 python3
vim vim
clang_11
llvmPackages_11.bintools
# terminal utilities # terminal utilities
bottom bottom
@ -53,11 +54,5 @@
# nix pkgs lookup # nix pkgs lookup
nix-index nix-index
; ];
inherit (pkgs.llvmPackages_11)
bintools
clang
;
};
} }

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"emacs-overlay": { "emacs-overlay": {
"locked": { "locked": {
"lastModified": 1641901534, "lastModified": 1641149178,
"narHash": "sha256-Nvm6Zj80fVtzmGsUFYlz9XGFyLnyAe9VoduPmDBu+js=", "narHash": "sha256-Mt+oT5YZ6G9zHctDKV5pY+3vIdsMmAg0HMvz6rxsIc0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "57378ea2f62e9f450f420dc9d01cc06e0d3dd15e", "rev": "f3c435a5e5cfa3ce1b2f50ba37b9cacfec4139d9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,11 +39,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1641915897, "lastModified": 1641121012,
"narHash": "sha256-C5Vw7B8BKA/kr9tWVYjEdD3AjstXFqoxkkzrOwfQZxk=", "narHash": "sha256-svaOMxNMQgFHjcxdmLojOxTxfqSENtnO+S3kb+npIwY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "5209ea0d8c77399ec4987590e9738953f15f8d80", "rev": "8e7a10602d1eb1d242c9d3f9b822203d5751a8c6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -71,11 +71,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1641710811, "lastModified": 1640959792,
"narHash": "sha256-yVJ+CtwWZY8BnkNIJ/ue5a28yrRM6CkDF1LvmGmqqwM=", "narHash": "sha256-zYSR//06FU2TDOpKKj0Hkff6unsxk3NwwNFuB1loU6E=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0ecf7d414811f831060cf55707c374d54fbb1dec", "rev": "59bfda72480496f32787cec8c557182738b1bd3f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -87,11 +87,11 @@
}, },
"nixpkgs-unstable-small": { "nixpkgs-unstable-small": {
"locked": { "locked": {
"lastModified": 1641865627, "lastModified": 1641125298,
"narHash": "sha256-B3b7KCThCx5bcDtWCX9ZZIl/EVs/lB8iDdI277/tvNA=", "narHash": "sha256-oNIG2UsyMk/osOmnjxHp53d8nJMudpW5a2+dcgsJzmE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3fe528dec572a26404f130893d2c22a35646247c", "rev": "c1d8e77ac2ca4248886632c597debea233700b2b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -60,8 +60,6 @@
}; };
}; };
overlays = import ./overlays;
nixosConfigurations = nixosConfigurations =
let let
system = "x86_64-linux"; system = "x86_64-linux";
@ -75,7 +73,7 @@
config.allowUnfree = true; config.allowUnfree = true;
}; };
}) })
] ++ builtins.attrValues self.overlays; ];
sharedModules = [ sharedModules = [
home-manager.nixosModule home-manager.nixosModule
{ nixpkgs.overlays = shared_overlays; } { nixpkgs.overlays = shared_overlays; }

View file

@ -1,17 +1,12 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.alacritty; cfg = config.my.home.alacritty;
alacrittyTheme = config.my.theme.alacrittyTheme; alacrittyTheme = config.my.theme.alacrittyTheme;
in in
{ {
options.my.home.alacritty.enable = (mkEnableOption "Alacritty terminal") // { default = config.my.home.x.enable; }; options.my.home.alacritty.enable = (lib.mkEnableOption "Alacritty terminal") // { default = config.my.home.x.enable; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
@ -39,8 +34,9 @@ in
}; };
}; };
home.packages = [ pkgs.iosevka-bin ]; home.packages = with pkgs; [
iosevka-bin
];
# make sure font is discoverable # make sure font is discoverable
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
}; };

View file

@ -1,19 +1,14 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.bat; cfg = config.my.home.bat;
batTheme = config.my.theme.batTheme; batTheme = config.my.theme.batTheme;
in in
{ {
options.my.home.bat = { options.my.home.bat = with lib; {
enable = (mkEnableOption "bat code display tool") // { default = true; }; enable = (mkEnableOption "bat code display tool") // { default = true; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.bat = { programs.bat = {
enable = true; enable = true;

View file

@ -1,31 +1,23 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
in
{ {
options.my.home.emacs = { options.my.home.emacs = with lib; {
enable = mkEnableOption "Emacs daemon configuration"; enable = mkEnableOption "Emacs daemon configuration";
}; };
config = mkIf config.my.home.emacs.enable { config = lib.mkIf config.my.home.emacs.enable {
home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ]; home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
home.sessionVariables = { home.sessionVariables = {
EDITOR = "emacsclient -t"; EDITOR = "emacsclient -t";
}; };
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
sqlite # needed by org-roam sqlite # needed by org-roam
# fonts used by my config # fonts used by my config
emacs-all-the-icons-fonts emacs-all-the-icons-fonts
iosevka-bin iosevka-bin
; ];
};
# make sure above fonts are discoverable # make sure above fonts are discoverable
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;

View file

@ -1,18 +1,13 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.firefox; cfg = config.my.home.firefox;
in in
{ {
options.my.home.firefox = { options.my.home.firefox = with lib; {
enable = (mkEnableOption "firefox config") // { default = config.my.home.x.enable; }; enable = (mkEnableOption "firefox config") // { default = config.my.home.x.enable; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox.override { package = pkgs.firefox.override {

View file

@ -1,16 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.fish; cfg = config.my.home.fish;
in in
{ {
options.my.home.fish.enable = (mkEnableOption "Fish shell") // { default = true; }; options.my.home.fish.enable = (lib.mkEnableOption "Fish shell") // { default = true; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.fish = { programs.fish = {
enable = true; enable = true;
}; };

View file

@ -1,18 +1,13 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.flameshot; cfg = config.my.home.flameshot;
in in
{ {
options.my.home.flameshot = { options.my.home.flameshot = with lib; {
enable = mkEnableOption "flameshot autolaunch"; enable = mkEnableOption "flameshot autolaunch";
}; };
config.services.flameshot = mkIf cfg.enable { config.services.flameshot = lib.mkIf cfg.enable {
enable = true; enable = true;
}; };
} }

View file

@ -1,16 +1,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.git; cfg = config.my.home.git;
in in
{ {
options.my.home.git.enable = (mkEnableOption "Git configuration") // { default = true; }; options.my.home.git.enable = (lib.mkEnableOption "Git configuration") // { default = true; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.git = { programs.git = {
enable = true; enable = true;

View file

@ -1,11 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
let
inherit (lib)
mkEnableOption
;
in
{ {
options.my.home.laptop = { options.my.home.laptop = with lib; {
enable = mkEnableOption "Laptop settings"; enable = mkEnableOption "Laptop settings";
}; };
} }

View file

@ -1,18 +1,13 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.lorri; cfg = config.my.home.lorri;
in in
{ {
options.my.home.lorri = { options.my.home.lorri = with lib; {
enable = (mkEnableOption "lorri daemon setup") // { default = true; }; enable = (mkEnableOption "lorri daemon setup") // { default = true; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.lorri.enable = true; services.lorri.enable = true;
programs.direnv = { programs.direnv = {
enable = true; enable = true;

View file

@ -1,18 +1,13 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.rofi; cfg = config.my.home.rofi;
in in
{ {
options.my.home.rofi = { options.my.home.rofi = with lib; {
enable = (mkEnableOption "rofi configuration") // { default = config.my.home.x.enable; }; enable = (mkEnableOption "rofi configuration") // { default = config.my.home.x.enable; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.rofi = { programs.rofi = {
enable = true; enable = true;

View file

@ -1,11 +1,5 @@
{ lib, ... }: { lib, ... }:
let with lib;
inherit (lib)
fileContents
mkOption
types
;
in
{ {
options.my.secrets = mkOption { options.my.secrets = mkOption {
type = types.attrs; type = types.attrs;

View file

@ -1,18 +1,13 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.ssh; cfg = config.my.home.ssh;
in in
{ {
options.my.home.ssh = { options.my.home.ssh = with lib; {
enable = (mkEnableOption "ssh configuration") // { default = true; }; enable = (mkEnableOption "ssh configuration") // { default = true; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.ssh = { programs.ssh = {
enable = true; enable = true;

View file

@ -1,10 +1,6 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib)
mkOption
types
;
mkColorOption = import ./color.nix { inherit lib; }; mkColorOption = import ./color.nix { inherit lib; };
primaryColorModule = types.submodule { primaryColorModule = types.submodule {

View file

@ -1,10 +1,5 @@
{ lib }: { lib }:
let with lib;
inherit (lib)
mkOption
types
;
in
types.submodule { types.submodule {
options = { options = {
name = mkOption { name = mkOption {

View file

@ -1,11 +1,6 @@
{ lib }: { lib }:
let let
inherit (lib) mkColorOption = with lib; {default ? "#000000", description ? "" }: mkOption {
mkOption
types
;
mkColorOption = {default ? "#000000", description ? "" }: mkOption {
inherit description default; inherit description default;
example = "#abcdef"; example = "#abcdef";
type = types.strMatching "#[0-9a-f]{6}"; type = types.strMatching "#[0-9a-f]{6}";

View file

@ -1,10 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
with lib;
let let
inherit (lib)
mkOption
types
;
themeType = types.submodule { themeType = types.submodule {
options = { options = {
alacrittyTheme = mkOption { alacrittyTheme = mkOption {
@ -33,7 +29,7 @@ in
}; };
options.my.themes = mkOption { options.my.themes = mkOption {
type = types.attrsOf themeType; type = with types; attrsOf themeType;
}; };
config.my.themes = { config.my.themes = {

View file

@ -1,10 +1,6 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib)
mkOption
types
;
mkColorOption = import ./color.nix { inherit lib; }; mkColorOption = import ./color.nix { inherit lib; };
barColorSetModule = types.submodule { barColorSetModule = types.submodule {

View file

@ -1,10 +1,6 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib)
mkOption
types
;
mkColorOption = import ./color.nix { inherit lib; }; mkColorOption = import ./color.nix { inherit lib; };
in in
types.submodule { types.submodule {

View file

@ -1,23 +1,7 @@
let let
inherit (import ./colors.nix) colors = import ./colors.nix;
base0
base00
base01
base02
base03
base1
base2
base3
blue
cyan
green
magenta
orange
red
violet
yellow
;
in in
with colors;
{ {
primary = { primary = {
background = base3; background = base3;

View file

@ -1,15 +1,7 @@
let let
inherit (import ./colors.nix) colors = import ./colors.nix;
base00
base2
base3
blue
magenta
orange
red
yellow
;
in in
with colors;
{ {
bar = { bar = {
background = base3; background = base3;

View file

@ -1,14 +1,7 @@
let let
inherit (import ./colors.nix) colors = import ./colors.nix;
base00
base2
base3
blue
green
red
yellow
;
in in
with colors;
{ {
theme = { theme = {
name = "solarized-light"; name = "solarized-light";

View file

@ -1,25 +1,20 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.tmux; cfg = config.my.home.tmux;
in in
{ {
options.my.home.tmux = { options.my.home.tmux = with lib; {
enable = (mkEnableOption "tmux dotfiles") // { default = true; }; enable = (mkEnableOption "tmux dotfiles") // { default = true; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.tmux = { programs.tmux = {
enable = true; enable = true;
baseIndex = 1; baseIndex = 1;
terminal = "screen-256color"; terminal = "screen-256color";
clock24 = true; clock24 = true;
plugins = let inherit (pkgs) tmuxPlugins; in [ plugins = with pkgs; [
{ {
plugin = tmuxPlugins.cpu; plugin = tmuxPlugins.cpu;
extraConfig = '' extraConfig = ''

View file

@ -1,18 +1,13 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.tridactyl; cfg = config.my.home.tridactyl;
in in
{ {
options.my.home.tridactyl = { options.my.home.tridactyl = with lib; {
enable = (mkEnableOption "tridactyl code display tool") // { default = config.my.home.firefox.enable; }; enable = (mkEnableOption "tridactyl code display tool") // { default = config.my.home.firefox.enable; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc; xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc;
}; };
} }

View file

@ -1,16 +1,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.x.cursor; cfg = config.my.home.x.cursor;
in in
{ {
options.my.home.x.cursor.enable = (mkEnableOption "X cursor") // { default = config.my.home.x.enable; }; options.my.home.x.cursor.enable = (lib.mkEnableOption "X cursor") // { default = config.my.home.x.enable; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
xsession.pointerCursor = { xsession.pointerCursor = {
package = pkgs.capitaine-cursors; package = pkgs.capitaine-cursors;
name = "capitaine-cursors"; name = "capitaine-cursors";

View file

@ -1,9 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
;
in
{ {
imports = [ imports = [
./cursor.nix ./cursor.nix
@ -11,7 +6,7 @@ in
./i3bar.nix ./i3bar.nix
]; ];
options.my.home.x = { options.my.home.x = with lib; {
enable = mkEnableOption "X server configuration"; enable = mkEnableOption "X server configuration";
}; };
} }

View file

@ -1,10 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkIf
mkOptionDefault
;
isEnabled = config.my.home.x.enable; isEnabled = config.my.home.x.enable;
myTerminal = myTerminal =
@ -22,12 +17,14 @@ let
i3Theme = config.my.theme.i3Theme; i3Theme = config.my.theme.i3Theme;
in in
{ {
config = mkIf isEnabled { config = lib.mkIf isEnabled {
my.home = { my.home = {
flameshot.enable = true; flameshot.enable = true;
}; };
home.packages = [ pkgs.betterlockscreen ]; home.packages = with pkgs; [
betterlockscreen
];
xsession.windowManager.i3 = { xsession.windowManager.i3 = {
enable = true; enable = true;
@ -80,7 +77,7 @@ in
size = 8.0; size = 8.0;
}; };
keybindings = mkOptionDefault { keybindings = lib.mkOptionDefault {
"${modifier}+Shift+e" = ''mode "${logoutMode}"''; "${modifier}+Shift+e" = ''mode "${logoutMode}"'';
"${modifier}+i" = "exec emacsclient -c"; "${modifier}+i" = "exec emacsclient -c";
@ -109,7 +106,7 @@ in
"Return" = "mode default"; "Return" = "mode default";
}; };
in in
mkOptionDefault { lib.mkOptionDefault {
"${logoutMode}" = makeModeBindings { "${logoutMode}" = makeModeBindings {
"l" = "exec --no-startup-id i3-msg exit, mode default"; "l" = "exec --no-startup-id i3-msg exit, mode default";
"s" = "exec --no-startup-id betterlockscreen --suspend, mode default"; "s" = "exec --no-startup-id betterlockscreen --suspend, mode default";

View file

@ -1,19 +1,11 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
lists
mkIf
mkOption
optional
types
;
isEnabled = config.my.home.x.enable; isEnabled = config.my.home.x.enable;
i3BarTheme = config.my.theme.i3BarTheme; i3BarTheme = config.my.theme.i3BarTheme;
cfg = config.my.home.x.i3bar; cfg = config.my.home.x.i3bar;
in in
{ {
options.my.home.x.i3bar = { options.my.home.x.i3bar = with lib; {
temperature.chip = mkOption { temperature.chip = mkOption {
type = types.str; type = types.str;
example = "coretemp-isa-*"; example = "coretemp-isa-*";
@ -32,14 +24,12 @@ in
}; };
}; };
config = mkIf isEnabled { config = lib.mkIf isEnabled {
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
iw # Used by `net` block iw # Used by `net` block
lm_sensors # Used by `temperature` block lm_sensors # Used by `temperature` block
font-awesome font-awesome
; ];
};
programs.i3status-rust = { programs.i3status-rust = {
enable = true; enable = true;
@ -89,7 +79,7 @@ in
chip = cfg.temperature.chip; chip = cfg.temperature.chip;
inputs = cfg.temperature.inputs; inputs = cfg.temperature.inputs;
} }
] ++ (lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0) ] ++ (lib.lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0)
(map (map
(interface: (interface:
{ {
@ -115,11 +105,11 @@ in
block = "sound"; block = "sound";
driver = "pulseaudio"; driver = "pulseaudio";
} }
] ++ (optional config.my.home.laptop.enable ] ++ (lib.lists.optionals config.my.home.laptop.enable [
{ {
block = "battery"; block = "battery";
} }
) ++ [ ]) ++ [
# { # {
# block = "notify"; # block = "notify";
# } # }

View file

@ -105,7 +105,9 @@ in
"rfkill-release" "rfkill-release"
]; ];
services.udev.packages = [ pkgs.packages.kaleidoscope-udev-rules ]; services.udev.packages = with pkgs; [
packages.kaleidoscope-udev-rules
];
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;

View file

@ -10,8 +10,7 @@
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
# some websites only work there :( # some websites only work there :(
chromium chromium
@ -20,9 +19,8 @@
# keyboard goodness # keyboard goodness
chrysalis chrysalis
;
inherit (pkgs.packages) spot; packages.spot
}; ];
}; };
} }

View file

@ -2,11 +2,7 @@
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let
inherit (lib)
mkDefault
;
in
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
@ -36,5 +32,5 @@ in
[ { device = "/dev/disk/by-uuid/381a9c5e-4d71-45b4-ac62-e7414b3768fc"; } [ { device = "/dev/disk/by-uuid/381a9c5e-4d71-45b4-ac62-e7414b3768fc"; }
]; ];
powerManagement.cpuFreqGovernor = mkDefault "ondemand"; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
} }

View file

@ -56,7 +56,9 @@ in
}; };
my.gui.enable = true; my.gui.enable = true;
environment.systemPackages = [ pkgs.arandr ]; environment.systemPackages = with pkgs; [
arandr
];
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;

View file

@ -2,11 +2,7 @@
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let
inherit (lib)
mkDefault
;
in
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
@ -44,7 +40,7 @@ in
swapDevices = [ ]; swapDevices = [ ];
powerManagement.cpuFreqGovernor = mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
} }

View file

@ -12,20 +12,18 @@
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight; my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
home.packages = builtins.attrValues { home.packages = with pkgs; [
inherit (pkgs)
# some websites only work there :( # some websites only work there :(
chromium chromium
wineWowPackages.stable
darktable darktable
# dev # dev
rustup rustup
;
inherit (pkgs.packages) spot; packages.spot
];
inherit (pkgs.wineWowPackages) stable;
};
}; };
} }

View file

@ -1,31 +1,23 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.displayManager.sddm; cfg = config.my.displayManager.sddm;
in in
{ {
options.my.displayManager.sddm.enable = mkEnableOption "SDDM setup"; options.my.displayManager.sddm.enable = lib.mkEnableOption "SDDM setup";
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.xserver.displayManager.sddm = { services.xserver.displayManager.sddm = {
enable = true; enable = true;
theme = "sugar-candy"; theme = "sugar-candy";
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = with pkgs; [
inherit (pkgs.packages) packages.sddm-sugar-candy
sddm-sugar-candy
;
inherit (pkgs.libsForQt5.qt5) # dependencies for sugar-candy theme
qtgraphicaleffects libsForQt5.qt5.qtgraphicaleffects
qtquickcontrols2 libsForQt5.qt5.qtquickcontrols2
qtsvg libsForQt5.qt5.qtsvg
; ];
};
}; };
} }

View file

@ -1,15 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
concatStringsSep
literalExample
mapAttrs'
mkIf
mkOption
nameValuePair
;
let
cfg = config.my.wakeonwlan; cfg = config.my.wakeonwlan;
mkWowlanService = name: cfg: mkWowlanService = name: cfg:
@ -27,7 +20,7 @@ let
}; };
in in
{ {
options.my.wakeonwlan = let inherit (lib) types; in { options.my.wakeonwlan = {
interfaces = mkOption { interfaces = mkOption {
default = { }; default = { };
description = "Wireless interfaces where you want to enable WoWLAN"; description = "Wireless interfaces where you want to enable WoWLAN";

View file

@ -1,3 +0,0 @@
{
i3status-rust = import ./i3status-rust;
}

View file

@ -1,19 +0,0 @@
final: prev:
{
# overlay created because nixpkgs's `i3status-rust` depended on `notmuch`, and
# `notmuch`'s tests were briefly broken. the features I'm disabling, I don't
# need anyway: (at the time of writing)
#
# - notmuch
# - maildir
i3status-rust = prev.i3status-rust.overrideAttrs (oldAttrs: {
buildInputs = builtins.attrValues {
inherit (final)
dbus
openssl
pulseaudio
;
};
cargoBuildFeatures = [ "pulseaudio" ];
});
}

View file

@ -1,9 +1,5 @@
{ stdenv, fetchFromGitHub, lib, ... }: { stdenv, fetchFromGitHub, lib, ... }:
let let
inherit (lib)
licenses
;
version = "0.9.0"; version = "0.9.0";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -24,7 +20,7 @@ stdenv.mkDerivation {
cp grafana/dashboard.json $out/dashboard.json cp grafana/dashboard.json $out/dashboard.json
''; '';
meta = { meta = with lib; {
description = "grafana dashboard for NGINX exporter"; description = "grafana dashboard for NGINX exporter";
homepage = "https://github.com/nginxinc/nginx-prometheus-exporter"; homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";
license = licenses.asl20; license = licenses.asl20;

View file

@ -1,9 +1,5 @@
{ stdenv, fetchFromGitHub, lib, ... }: { stdenv, fetchFromGitHub, lib, ... }:
let let
inherit (lib)
licenses
;
version = "7d61c79619e5749e629758ecd96748c010028120"; version = "7d61c79619e5749e629758ecd96748c010028120";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -24,7 +20,7 @@ stdenv.mkDerivation {
cp prometheus/node-exporter-full.json $out/node-exporter-full.json cp prometheus/node-exporter-full.json $out/node-exporter-full.json
''; '';
meta = { meta = with lib; {
description = "grafana dashboard for node exporter"; description = "grafana dashboard for node exporter";
homepage = "https://github.com/rfrail3/grafana-dashboards"; homepage = "https://github.com/rfrail3/grafana-dashboards";
license = licenses.lgpl3Only; license = licenses.lgpl3Only;

View file

@ -1,10 +1,6 @@
{ stdenv, lib, fetchFromGitHub }: { stdenv, lib, fetchFromGitHub }:
let let
inherit (lib)
licenses
;
version = "1.99.3"; version = "1.99.3";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -25,7 +21,7 @@ stdenv.mkDerivation {
cp etc/60-kaleidoscope.rules $out/lib/udev/rules.d/ cp etc/60-kaleidoscope.rules $out/lib/udev/rules.d/
''; '';
meta = { meta = with lib; {
description = "udev rules for kaleidoscope firmware keyboards"; description = "udev rules for kaleidoscope firmware keyboards";
homepage = "https://github.com/keyboardio/Kaleidoscope"; homepage = "https://github.com/keyboardio/Kaleidoscope";
license = licenses.gpl3Only; license = licenses.gpl3Only;

View file

@ -1,10 +1,5 @@
{ lib }: { lib }:
let
inherit (lib)
fileContents
;
in
{ {
boreal-repo = fileContents ./boreal-repo.secret; boreal-repo = lib.fileContents ./boreal-repo.secret;
poseidon-repo = fileContents ./poseidon-repo.secret; poseidon-repo = lib.fileContents ./poseidon-repo.secret;
} }

View file

@ -1,24 +1,20 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
let with lib;
inherit (lib) {
fileContents options.my.secrets = mkOption {
mkOption
;
in {
options.my.secrets = let inherit (lib) types; in mkOption {
type = types.attrs; type = types.attrs;
}; };
config.my.secrets = { config.my.secrets = {
matrix-registration-shared-secret = fileContents ./matrix-registration-shared-secret.secret; matrix-registration-shared-secret = lib.fileContents ./matrix-registration-shared-secret.secret;
shadow-hashed-password-alarsyo = fileContents ./shadow-hashed-password-alarsyo.secret; shadow-hashed-password-alarsyo = lib.fileContents ./shadow-hashed-password-alarsyo.secret;
shadow-hashed-password-root = fileContents ./shadow-hashed-password-root.secret; shadow-hashed-password-root = lib.fileContents ./shadow-hashed-password-root.secret;
miniflux-admin-credentials = fileContents ./miniflux-admin-credentials.secret; miniflux-admin-credentials = lib.fileContents ./miniflux-admin-credentials.secret;
transmission-password = fileContents ./transmission.secret; transmission-password = lib.fileContents ./transmission.secret;
nextcloud-admin-pass = ./nextcloud-admin-pass.secret; nextcloud-admin-pass = ./nextcloud-admin-pass.secret;
nextcloud-admin-user = fileContents ./nextcloud-admin-user.secret; nextcloud-admin-user = lib.fileContents ./nextcloud-admin-user.secret;
lohr-shared-secret = fileContents ./lohr-shared-secret.secret; lohr-shared-secret = lib.fileContents ./lohr-shared-secret.secret;
gandiKey = fileContents ./gandi-api-key.secret; gandiKey = lib.fileContents ./gandi-api-key.secret;
borg-backup = import ./borg-backup { inherit lib; }; borg-backup = import ./borg-backup { inherit lib; };
paperless = import ./paperless { inherit lib; }; paperless = import ./paperless { inherit lib; };

View file

@ -1,10 +1,5 @@
{ lib }: { lib }:
let
inherit (lib)
fileContents
;
in
{ {
secretKey = fileContents ./secret-key-file.secret; secretKey = lib.fileContents ./secret-key-file.secret;
adminPassword = fileContents ./admin-password.secret; adminPassword = lib.fileContents ./admin-password.secret;
} }

View file

@ -1,9 +1,4 @@
{ lib }: { lib }:
let
inherit (lib)
fileContents
;
in
{ {
poseidon-repo = fileContents ./poseidon-repo.secret; poseidon-repo = lib.fileContents ./poseidon-repo.secret;
} }

View file

@ -1,14 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption let cfg = config.my.services.borg-backup;
mkIf
mkOption
;
cfg = config.my.services.borg-backup;
in { in {
options.my.services.borg-backup = let inherit (lib) types; in { options.my.services.borg-backup = {
enable = mkEnableOption "Enable Borg backups for this host"; enable = mkEnableOption "Enable Borg backups for this host";
repo = mkOption { repo = mkOption {

View file

@ -1,11 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.services.fail2ban; cfg = config.my.services.fail2ban;
in { in {
options.my.services.fail2ban = { options.my.services.fail2ban = {

View file

@ -1,20 +1,16 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.fava; cfg = config.my.services.fava;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
secrets = config.my.secrets; secrets = config.my.secrets;
in in
{ {
options.my.services.fava = let inherit (lib) types; in { options.my.services.fava = {
enable = mkEnableOption "Fava"; enable = lib.mkEnableOption "Fava";
home = mkOption { home = mkOption {
type = types.str; type = types.str;
@ -47,6 +43,7 @@ in
User = "fava"; User = "fava";
Group = "fava"; Group = "fava";
}; };
path = with pkgs; [];
}; };
users.users.fava = { users.users.fava = {

View file

@ -1,18 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.gitea; cfg = config.my.services.gitea;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.gitea = let inherit (lib) types; in { options.my.services.gitea = {
enable = mkEnableOption "Personal Git hosting with Gitea"; enable = mkEnableOption "Personal Git hosting with Gitea";
privatePort = mkOption { privatePort = mkOption {

View file

@ -1,11 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
;
let
cfg = config.my.services.jellyfin; cfg = config.my.services.jellyfin;
my = config.my; my = config.my;
@ -18,7 +15,7 @@ in {
enable = mkEnableOption "Jellyfin"; enable = mkEnableOption "Jellyfin";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.jellyfin = { services.jellyfin = {
enable = true; enable = true;
group = "media"; group = "media";

View file

@ -1,12 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.lohr; cfg = config.my.services.lohr;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
@ -18,8 +14,8 @@ let
flake.defaultPackage."x86_64-linux"; # FIXME: use correct system flake.defaultPackage."x86_64-linux"; # FIXME: use correct system
in in
{ {
options.my.services.lohr = let inherit (lib) types; in { options.my.services.lohr = {
enable = mkEnableOption "Lohr Mirroring Daemon"; enable = lib.mkEnableOption "Lohr Mirroring Daemon";
home = mkOption { home = mkOption {
type = types.str; type = types.str;
@ -53,7 +49,9 @@ in
User = "lohr"; User = "lohr";
Group = "lohr"; Group = "lohr";
}; };
path = [ pkgs.git ]; path = with pkgs; [
git
];
}; };
users.users.lohr = { users.users.lohr = {

View file

@ -9,13 +9,9 @@
# #
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.matrix; cfg = config.my.services.matrix;
my = config.my; my = config.my;
@ -23,10 +19,10 @@ let
clientPort = { public = 443; private = 11339; }; clientPort = { public = 443; private = 11339; };
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.matrix = let inherit (lib) types; in { options.my.services.matrix = {
enable = mkEnableOption "Matrix Synapse"; enable = lib.mkEnableOption "Matrix Synapse";
registration_shared_secret = mkOption { registration_shared_secret = lib.mkOption {
type = types.str; type = types.str;
default = null; default = null;
example = "deadbeef"; example = "deadbeef";
@ -65,7 +61,7 @@ in {
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.postgresql = { services.postgresql = {
enable = true; enable = true;
}; };

View file

@ -1,17 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib) mediaServices = with config.my.services; [
mkIf
;
mediaServices = builtins.attrValues {
inherit (config.my.services)
jellyfin jellyfin
transmission transmission
; ];
};
needed = builtins.any (service: service.enable) mediaServices; needed = builtins.any (service: service.enable) mediaServices;
in in
{ {
config.users.groups.media = mkIf needed { }; config.users.groups.media = lib.mkIf needed { };
} }

View file

@ -1,18 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.miniflux; cfg = config.my.services.miniflux;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.miniflux = let inherit (lib) types; in { options.my.services.miniflux = {
enable = mkEnableOption "Serve a Miniflux instance"; enable = mkEnableOption "Serve a Miniflux instance";
adminCredentialsFile = mkOption { adminCredentialsFile = mkOption {

View file

@ -1,16 +1,12 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.monitoring; cfg = config.my.services.monitoring;
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.monitoring = let inherit (lib) types; in { options.my.services.monitoring = {
enable = mkEnableOption "Enable monitoring"; enable = mkEnableOption "Enable monitoring";
domain = mkOption { domain = mkOption {

View file

@ -1,17 +1,12 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
optional
;
let
cfg = config.my.services.navidrome; cfg = config.my.services.navidrome;
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.navidrome = let inherit (lib) types; in { options.my.services.navidrome = {
enable = mkEnableOption "Navidrome"; enable = mkEnableOption "Navidrome";
musicFolder = { musicFolder = {
path = mkOption { path = mkOption {
@ -22,7 +17,7 @@ in {
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.navidrome = { services.navidrome = {
enable = true; enable = true;
settings = { settings = {

View file

@ -3,11 +3,6 @@
# TODO: setup prometheus exporter # TODO: setup prometheus exporter
let let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.services.nextcloud; cfg = config.my.services.nextcloud;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
@ -15,10 +10,10 @@ let
in in
{ {
options.my.services.nextcloud = { options.my.services.nextcloud = {
enable = mkEnableOption "NextCloud"; enable = lib.mkEnableOption "NextCloud";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.postgresql = { services.postgresql = {
enable = true; enable = true;
@ -78,7 +73,7 @@ in
my.services.restic-backup = let my.services.restic-backup = let
nextcloudHome = config.services.nextcloud.home; nextcloudHome = config.services.nextcloud.home;
in mkIf cfg.enable { in lib.mkIf cfg.enable {
paths = [ nextcloudHome ]; paths = [ nextcloudHome ];
exclude = [ exclude = [
# borg can fail if *.part files disappear during backup # borg can fail if *.part files disappear during backup

View file

@ -2,15 +2,10 @@
# #
# https://github.com/delroth/infra.delroth.net # https://github.com/delroth/infra.delroth.net
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
inherit (lib)
mkIf
;
in
{ {
# Whenever something defines an nginx vhost, ensure that nginx defaults are # Whenever something defines an nginx vhost, ensure that nginx defaults are
# properly set. # properly set.
config = mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != [ "localhost" ]) { config = lib.mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != [ "localhost" ]) {
services.nginx = { services.nginx = {
enable = true; enable = true;
statusPage = true; # For monitoring scraping. statusPage = true; # For monitoring scraping.

View file

@ -1,17 +1,14 @@
{ config, lib, ... }: { config, lib, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
;
let
cfg = config.my.services.nuage; cfg = config.my.services.nuage;
my = config.my; my = config.my;
in in
{ {
options.my.services.nuage = { options.my.services.nuage = {
enable = mkEnableOption "Nuage redirect"; enable = lib.mkEnableOption "Nuage redirect";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,12 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.paperless; cfg = config.my.services.paperless;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
@ -14,8 +10,8 @@ let
secretKeyFile = pkgs.writeText "paperless-secret-key-file.env" my.secrets.paperless.secretKey; secretKeyFile = pkgs.writeText "paperless-secret-key-file.env" my.secrets.paperless.secretKey;
in in
{ {
options.my.services.paperless = let inherit (lib) types; in { options.my.services.paperless = {
enable = mkEnableOption "Paperless"; enable = lib.mkEnableOption "Paperless";
port = mkOption { port = mkOption {
type = types.port; type = types.port;

View file

@ -1,18 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
optionalAttrs
;
let
cfg = config.my.services.pipewire; cfg = config.my.services.pipewire;
my = config.my; my = config.my;
in in
{ {
options.my.services.pipewire = { options.my.services.pipewire = {
enable = mkEnableOption "Pipewire sound backend"; enable = lib.mkEnableOption "Pipewire sound backend";
}; };
# HACK: services.pipewire.alsa doesn't exist on 20.09, avoid evaluating this # HACK: services.pipewire.alsa doesn't exist on 20.09, avoid evaluating this
@ -73,6 +69,6 @@ in
# FIXME: a shame pactl isn't available by itself, eventually this should be # FIXME: a shame pactl isn't available by itself, eventually this should be
# replaced by pw-cli or a wrapper, I guess? # replaced by pw-cli or a wrapper, I guess?
environment.systemPackages = [ pkgs.pulseaudio ]; environment.systemPackages = with pkgs; [ pulseaudio ];
}); });
} }

View file

@ -1,11 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
;
let
cfg = config.my.services.postgresql-backup; cfg = config.my.services.postgresql-backup;
in { in {
options.my.services.postgresql-backup = { options.my.services.postgresql-backup = {

View file

@ -1,22 +1,16 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
attrsets
concatStringsSep
mkEnableOption
mkIf
mkOption
optional
;
let
cfg = config.my.services.restic-backup; cfg = config.my.services.restic-backup;
secrets = config.my.secrets; secrets = config.my.secrets;
excludeArg = "--exclude-file=" + (pkgs.writeText "excludes.txt" (concatStringsSep "\n" cfg.exclude)); excludeArg = with builtins; with pkgs;
"--exclude-file=" + (writeText "excludes.txt" (concatStringsSep "\n" cfg.exclude));
makePruneOpts = pruneOpts: makePruneOpts = pruneOpts:
attrsets.mapAttrsToList (name: value: "--keep-${name} ${toString value}") pruneOpts; attrsets.mapAttrsToList (name: value: "--keep-${name} ${toString value}") pruneOpts;
in { in {
options.my.services.restic-backup = let inherit (lib) types; in { options.my.services.restic-backup = {
enable = mkEnableOption "Enable Restic backups for this host"; enable = mkEnableOption "Enable Restic backups for this host";
repo = mkOption { repo = mkOption {
@ -28,7 +22,7 @@ in {
}; };
paths = mkOption { paths = mkOption {
type = types.listOf types.str; type = with types; listOf str;
default = [ ]; default = [ ];
example = [ example = [
"/var/lib" "/var/lib"
@ -38,7 +32,7 @@ in {
}; };
exclude = mkOption { exclude = mkOption {
type = types.listOf types.str; type = with types; listOf str;
default = [ ]; default = [ ];
example = [ example = [
# very large paths # very large paths

View file

@ -1,19 +1,16 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
;
let
cfg = config.my.services.tailscale; cfg = config.my.services.tailscale;
in in
{ {
options.my.services.tailscale = { options.my.services.tailscale = {
enable = mkEnableOption "Tailscale"; enable = lib.mkEnableOption "Tailscale";
# NOTE: still have to do `tailscale up --advertise-exit-node` # NOTE: still have to do `tailscale up --advertise-exit-node`
exitNode = mkEnableOption "Use as exit node"; exitNode = lib.mkEnableOption "Use as exit node";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,17 +1,14 @@
{ config, lib, ... }: { config, lib, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
;
let
cfg = config.my.services.tgv; cfg = config.my.services.tgv;
my = config.my; my = config.my;
in in
{ {
options.my.services.tgv = { options.my.services.tgv = {
enable = mkEnableOption "TGV redirect"; enable = lib.mkEnableOption "TGV redirect";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -1,11 +1,5 @@
{ config, lib, ... }: { config, lib, ... }:
let let
inherit (lib)
mkEnableOption
mkIf
mkOption
;
cfg = config.my.services.transmission; cfg = config.my.services.transmission;
domain = config.networking.domain; domain = config.networking.domain;
@ -17,7 +11,7 @@ let
downloadBase = "/media/torrents/"; downloadBase = "/media/torrents/";
in in
{ {
options.my.services.transmission = let inherit (lib) types; in { options.my.services.transmission = with lib; {
enable = mkEnableOption "Transmission torrent client"; enable = mkEnableOption "Transmission torrent client";
username = mkOption { username = mkOption {
@ -34,7 +28,7 @@ in
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.transmission = { services.transmission = {
enable = true; enable = true;
group = "media"; group = "media";

View file

@ -1,18 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with lib;
inherit (lib)
mkEnableOption
mkIf
mkOption
;
let
cfg = config.my.services.vaultwarden; cfg = config.my.services.vaultwarden;
my = config.my; my = config.my;
domain = config.networking.domain; domain = config.networking.domain;
in { in {
options.my.services.vaultwarden = let inherit (lib) types; in { options.my.services.vaultwarden = {
enable = mkEnableOption "Vaultwarden"; enable = mkEnableOption "Vaultwarden";
privatePort = mkOption { privatePort = mkOption {