From 097e1a1e35d81b54c54f78bc689f2fbc019ad071 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 2 Aug 2024 10:10:11 -0500 Subject: [PATCH] add user config setting for use in hardcoded paths --- modules/desktop/gui.nix | 2 +- modules/desktop/window-managers/hyprland.nix | 2 +- modules/development/cli.nix | 2 +- modules/languages/python.nix | 2 +- modules/languages/roc.nix | 2 +- modules/languages/zig.nix | 2 +- modules/networking/vpn.nix | 4 ++-- modules/nix.nix | 2 +- modules/oizys.nix | 13 ++++++++++--- modules/storage/restic.nix | 4 ++-- todo.md | 1 + 11 files changed, 22 insertions(+), 14 deletions(-) diff --git a/modules/desktop/gui.nix b/modules/desktop/gui.nix index 2ed5d17..2cc1b72 100644 --- a/modules/desktop/gui.nix +++ b/modules/desktop/gui.nix @@ -2,7 +2,7 @@ pkgs, config, lib, -flake, + flake, ... }: let diff --git a/modules/desktop/window-managers/hyprland.nix b/modules/desktop/window-managers/hyprland.nix index ef5688c..883377f 100644 --- a/modules/desktop/window-managers/hyprland.nix +++ b/modules/desktop/window-managers/hyprland.nix @@ -3,7 +3,7 @@ config, mkOizysModule, enabled, -flake, + flake, ... }: diff --git a/modules/development/cli.nix b/modules/development/cli.nix index c87dd77..decbde1 100644 --- a/modules/development/cli.nix +++ b/modules/development/cli.nix @@ -3,7 +3,7 @@ config, enabled, mkDefaultOizysModule, -flake, + flake, ... }: mkDefaultOizysModule config "cli" { diff --git a/modules/languages/python.nix b/modules/languages/python.nix index c910d11..1af1a57 100644 --- a/modules/languages/python.nix +++ b/modules/languages/python.nix @@ -2,7 +2,7 @@ config, lib, pkgs, -flake, + flake, ... }: let diff --git a/modules/languages/roc.nix b/modules/languages/roc.nix index f9130c2..77a1964 100644 --- a/modules/languages/roc.nix +++ b/modules/languages/roc.nix @@ -2,7 +2,7 @@ config, lib, inputs, -flake, + flake, ... }: let diff --git a/modules/languages/zig.nix b/modules/languages/zig.nix index 40c6cb2..157a165 100644 --- a/modules/languages/zig.nix +++ b/modules/languages/zig.nix @@ -1,7 +1,7 @@ { config, lib, -flake, + flake, ... }: let diff --git a/modules/networking/vpn.nix b/modules/networking/vpn.nix index 117e931..c25cb82 100644 --- a/modules/networking/vpn.nix +++ b/modules/networking/vpn.nix @@ -13,8 +13,8 @@ mkOizysModule config "vpn" { services.openvpn.servers = { express-ny = { config = '' - config /home/daylin/.config/openvpn/express-ny/config.ovpn - auth-user-pass /home/daylin/.config/openvpn/express-ny/credentials + config /home/${config.oizys.user}/.config/openvpn/express-ny/config.ovpn + auth-user-pass /home/${config.oizys.user}/.config/openvpn/express-ny/credentials ''; autoStart = false; updateResolvConf = true; diff --git a/modules/nix.nix b/modules/nix.nix index 0cbf848..8720d1a 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -3,7 +3,7 @@ pkgs, lib, enabled, -flake, + flake, ... }: let diff --git a/modules/oizys.nix b/modules/oizys.nix index 854987d..b3ce59c 100644 --- a/modules/oizys.nix +++ b/modules/oizys.nix @@ -5,7 +5,7 @@ ... }: let - inherit (lib) mkEnableOption; + inherit (lib) mkEnableOption mkOption; in { imports = with self.nixosModules; [ @@ -39,8 +39,15 @@ in restic ]; - options.oizys.desktop.enable = mkEnableOption "is desktop"; - options.oizys.docker.enable = mkEnableOption "enable docker support"; + options.oizys = { + user = mkOption { + type = lib.types.string; + default = "daylin"; + description = "main user account"; + }; + desktop.enable = mkEnableOption "is desktop"; + docker.enable = mkEnableOption "enable docker support"; + }; config = { networking.hostName = hostName; time.timeZone = "US/Central"; diff --git a/modules/storage/restic.nix b/modules/storage/restic.nix index 8d306c6..f1e2a91 100644 --- a/modules/storage/restic.nix +++ b/modules/storage/restic.nix @@ -12,8 +12,8 @@ mkOizysModule config "backups" { # workaround for now `mkdir ~/.conda && touch ~/.conda/environments.txt` extraBackupArgs = [ - "--exclude-file /home/daylin/.config/restic/excludes.txt" - "--exclude-file /home/daylin/.conda/environments.txt" + "--exclude-file /home/${config.oizys.user}/.config/restic/excludes.txt" + "--exclude-file /home/${config.oizys.user}/.conda/environments.txt" "--verbose" "--one-file-system" "--tag systemd.timer" diff --git a/todo.md b/todo.md index a3745a2..4e6dca7 100644 --- a/todo.md +++ b/todo.md @@ -16,3 +16,4 @@ > kernel: ucsi_acpi USBC000:00: error -EINVAL: PPM init failed +