Avoid possible infinite recursion

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-16 17:46:58 +03:00
parent df781012fd
commit 566b4e0157
38 changed files with 216 additions and 187 deletions

View File

@@ -1,9 +1,4 @@
{ { pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
environment.systemPackages = with pkgs; [ brightnessctl ]; environment.systemPackages = with pkgs; [ brightnessctl ];
@@ -18,15 +13,4 @@
ACTION=="add", SUBSYSTEM=="leds", RUN+="${chgrp} input /sys/class/leds/%k/brightness" ACTION=="add", SUBSYSTEM=="leds", RUN+="${chgrp} input /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="${chmod} g+w /sys/class/leds/%k/brightness" ACTION=="add", SUBSYSTEM=="leds", RUN+="${chmod} g+w /sys/class/leds/%k/brightness"
''; '';
users.groups =
let
members = builtins.attrNames (
lib.attrsets.filterAttrs (_: config: config.isNormalUser) config.users.users
);
in
{
video.members = members;
input.members = members;
};
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,7 +8,7 @@
... ...
}: }:
{ {
home-manager.users.${user.name}.systemd.user.services.mpris-proxy = { home-manager.users.${username}.systemd.user.services.mpris-proxy = {
Unit = { Unit = {
Description = "MPRIS proxy"; Description = "MPRIS proxy";
Requires = [ "sound.target" ]; Requires = [ "sound.target" ];

View File

@@ -1,7 +1,12 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
home-manager.users.${user.name}.home.packages = with pkgs; [ brightnessctl ]; users.users.${username}.extraGroups = [
"video"
"inputs"
];
home-manager.users.${username}.home.packages = with pkgs; [ brightnessctl ];
} }

View File

@@ -1,9 +1,9 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ ... }: { ... }:
{ {
home-manager.users.${user.name}.programs.btop = { home-manager.users.${username}.programs.btop = {
enable = true; enable = true;
settings = { settings = {
theme_background = false; theme_background = false;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,15 +8,16 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.git = { programs.git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
userName = user.fullName; userName = userConfig.fullName;
userEmail = user.email; userEmail = userConfig.email;
signing = { signing = {
signByDefault = true; signByDefault = true;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,11 +8,12 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
gpgPath = "${hmConfig.xdg.dataHome}/gnupg"; gpgPath = "${hmConfig.xdg.dataHome}/gnupg";
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.gpg = { programs.gpg = {
enable = true; enable = true;
homedir = gpgPath; homedir = gpgPath;
@@ -37,7 +38,7 @@ in
]; ];
runtimeEnv = { runtimeEnv = {
GNUPGHOME = gpgPath; GNUPGHOME = gpgPath;
HOME = user.home; HOME = userConfig.home;
}; };
text = builtins.readFile ./import-gpg-keys.sh; text = builtins.readFile ./import-gpg-keys.sh;
} }
@@ -64,7 +65,7 @@ in
Install.WantedBy = [ "default.target" ]; Install.WantedBy = [ "default.target" ];
}; };
tmpfiles.rules = [ "d ${gpgPath} 0700 ${user.name} users -" ]; tmpfiles.rules = [ "d ${gpgPath} 0700 ${username} users -" ];
}; };
sops.secrets = { sops.secrets = {

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ config, inputs, ... }: { config, inputs, ... }:
{ {
@@ -14,7 +14,7 @@
backupFileExtension = "bak"; backupFileExtension = "bak";
useGlobalPkgs = true; useGlobalPkgs = true;
users.${user.name} = { users.${username} = {
home.stateVersion = "24.05"; home.stateVersion = "24.05";
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
nix.settings = config.nix.settings; nix.settings = config.nix.settings;

View File

@@ -1,9 +1,9 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ ... }: { ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -7,22 +7,25 @@
lib, lib,
... ...
}: }:
let
userConfig = config.users.users.${username};
in
{ {
programs.fuse.userAllowOther = true; programs.fuse.userAllowOther = true;
systemd.tmpfiles.rules = ([ systemd.tmpfiles.rules = ([
"d /persist/home 0755 root root -" "d /persist/home 0755 root root -"
"d /cache/home 0755 root root -" "d /cache/home 0755 root root -"
"d /persist${user.home} 0700 ${user.name} users -" "d /persist${userConfig.home} 0700 ${username} users -"
"d /cache${user.home} 0700 ${user.name} users -" "d /cache${userConfig.home} 0700 ${username} users -"
]); ]);
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ]; imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
home.persistence = { home.persistence = {
"/persist${user.home}".allowOther = true; "/persist${userConfig.home}".allowOther = true;
"/cache${user.home}".allowOther = true; "/cache${userConfig.home}".allowOther = true;
}; };
}; };
} }

View File

@@ -1,9 +1,9 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ pkgs, ... }: { pkgs, ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home.packages = with pkgs; [ home.packages = with pkgs; [
wireplumber wireplumber
playerctl playerctl

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,17 +8,18 @@
... ...
}: }:
let let
userConfig = config.users.users.${username};
sopsKeyPath = ".config/sops-nix/key.txt"; sopsKeyPath = ".config/sops-nix/key.txt";
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ inputs.sops-nix.homeManagerModules.sops ]; imports = [ inputs.sops-nix.homeManagerModules.sops ];
sops.age.keyFile = "/persist${user.home}/${sopsKeyPath}"; sops.age.keyFile = "/persist${userConfig.home}/${sopsKeyPath}";
home = { home = {
persistence."/persist${user.home}".files = [ sopsKeyPath ]; persistence."/persist${userConfig.home}".files = [ sopsKeyPath ];
sessionVariables.SOPS_AGE_KEY_FILE = "${user.home}/${sopsKeyPath}"; sessionVariables.SOPS_AGE_KEY_FILE = "${userConfig.home}/${sopsKeyPath}";
}; };
}; };
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ config, ... }: { config, ... }:
{ {
@@ -14,17 +14,17 @@
sops.secrets = { sops.secrets = {
# openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:3072 # openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:3072
"syncthing/key" = { "syncthing/key" = {
owner = user.name; owner = username;
group = "users"; group = "users";
}; };
# openssl req -new -x509 -key key.pem -out cert.pem -days 9999 -subj "/CN=syncthing" # openssl req -new -x509 -key key.pem -out cert.pem -days 9999 -subj "/CN=syncthing"
"syncthing/cert" = { "syncthing/cert" = {
owner = user.name; owner = username;
group = "users"; group = "users";
}; };
}; };
home-manager.users.${user.name}.services.syncthing = { home-manager.users.${username}.services.syncthing = {
enable = true; enable = true;
key = config.sops.secrets."syncthing/key".path; key = config.sops.secrets."syncthing/key".path;
cert = config.sops.secrets."syncthing/cert".path; cert = config.sops.secrets."syncthing/cert".path;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,11 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
xdg = { xdg = {
@@ -22,13 +23,13 @@ in
userDirs = { userDirs = {
enable = true; enable = true;
extraConfig = { extraConfig = {
XDG_VM_DIR = "${user.home}/VMs"; XDG_VM_DIR = "${userConfig.home}/VMs";
XDG_GIT_DIR = "${user.home}/git"; XDG_GIT_DIR = "${userConfig.home}/git";
}; };
}; };
}; };
home.persistence."/persist${user.home}".directories = with hmConfig.xdg.userDirs; [ home.persistence."/persist${userConfig.home}".directories = with hmConfig.xdg.userDirs; [
relativeDesktop relativeDesktop
relativeDocuments relativeDocuments
relativeDownload relativeDownload

View File

@@ -1,12 +1,13 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ config, ... }: { config, ... }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
dotDir = "${hmConfig.xdg.relativeConfigHome}/zsh"; dotDir = "${hmConfig.xdg.relativeConfigHome}/zsh";
@@ -20,6 +21,8 @@ in
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
}; };
home.persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeDataHome}/zsh" ]; home.persistence."/persist${userConfig.home}".directories = [
"${hmConfig.xdg.relativeDataHome}/zsh"
];
}; };
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -9,11 +9,11 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
agsConfig = import ./config { inherit pkgs; }; agsConfig = import ./config { inherit pkgs; };
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ inputs.ags.homeManagerModules.default ]; imports = [ inputs.ags.homeManagerModules.default ];
programs.ags.enable = true; programs.ags.enable = true;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -10,7 +10,7 @@
{ {
services.blueman.enable = true; services.blueman.enable = true;
home-manager.users.${user.name} = { home-manager.users.${username} = {
services.blueman-applet.enable = true; services.blueman-applet.enable = true;
systemd.user.services.blueman-applet.Unit.After = [ "graphical-session.target" ]; systemd.user.services.blueman-applet.Unit.After = [ "graphical-session.target" ];
}; };

View File

@@ -1,9 +1,14 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
home-manager.users.${user.name}.wayland.windowManager.hyprland.settings.bindle = users.users.${username}.extraGroups = [
"video"
"inputs"
];
home-manager.users.${username}.wayland.windowManager.hyprland.settings.bindle =
let let
brightnessctl = lib.meta.getExe pkgs.brightnessctl; brightnessctl = lib.meta.getExe pkgs.brightnessctl;
in in

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,10 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs = { programs = {
btop.settings.color_theme = "matugen"; btop.settings.color_theme = "matugen";

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,7 +8,7 @@
... ...
}: }:
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
services.cbatticon = { services.cbatticon = {
enable = true; enable = true;
lowLevelPercent = 20; lowLevelPercent = 20;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,16 +8,19 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
wl-clipboard wl-clipboard
cliphist cliphist
]; ];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/cliphist" ]; persistence."/cache${userConfig.home}".directories = [
"${hmConfig.xdg.relativeCacheHome}/cliphist"
];
}; };
systemd.user.services = { systemd.user.services = {

View File

@@ -1,9 +1,17 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ lib, pkgs, ... }:
{ {
home-manager.users.${user.name} = { config,
lib,
pkgs,
...
}:
let
userConfig = config.users.users.${username};
in
{
home-manager.users.${username} = {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
@@ -122,8 +130,8 @@
wayland.windowManager.hyprland.settings.bind = [ "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" ]; wayland.windowManager.hyprland.settings.bind = [ "$mod, b, exec, ${lib.meta.getExe pkgs.firefox}" ];
home.persistence = { home.persistence = {
"/persist${user.home}".directories = [ ".mozilla" ]; "/persist${userConfig.home}".directories = [ ".mozilla" ];
"/cache${user.home}".directories = [ ".cache/mozilla" ]; "/cache${userConfig.home}".directories = [ ".cache/mozilla" ];
}; };
}; };
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,10 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
gtk = { gtk = {
enable = true; enable = true;

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,12 +8,12 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
programs.hyprland.enable = true; programs.hyprland.enable = true;
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,10 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
hyprshot hyprshot

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,11 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs = { programs = {
kitty = { kitty = {
enable = true; enable = true;
@@ -44,6 +45,8 @@ in
) )
} &"; } &";
home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" ]; home.persistence."/cache${userConfig.home}".directories = [
"${hmConfig.xdg.relativeCacheHome}/kitty"
];
}; };
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,10 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
programs.matugen = { programs.matugen = {

View File

@@ -1,9 +1,9 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ ... }: { ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
services.network-manager-applet.enable = true; services.network-manager-applet.enable = true;
systemd.user.services.network-manager-applet.Unit.After = [ "graphical-session.target" ]; systemd.user.services.network-manager-applet.Unit.After = [ "graphical-session.target" ];
}; };

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,11 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
programs = { programs = {
@@ -71,10 +72,10 @@ in
matugen.settings.templates = builtins.mapAttrs (name: _: { matugen.settings.templates = builtins.mapAttrs (name: _: {
input_path = ./theme.json; input_path = ./theme.json;
output_path = "${user.home}/${name}/.obsidian/plugins/obsidian-style-settings/data.json"; output_path = "${userConfig.home}/${name}/.obsidian/plugins/obsidian-style-settings/data.json";
}) hmConfig.programs.obsidian.vaults; }) hmConfig.programs.obsidian.vaults;
}; };
home.persistence."/cache${user.home}".directories = [ ".config/obsidian" ]; home.persistence."/cache${userConfig.home}".directories = [ ".config/obsidian" ];
}; };
} }

View File

@@ -1,9 +1,9 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home.packages = with pkgs; [ pavucontrol ]; home.packages = with pkgs; [ pavucontrol ];
wayland.windowManager.hyprland.settings = wayland.windowManager.hyprland.settings =

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
lib, lib,
@@ -8,16 +8,17 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: { qalculate-gtk = pkgs.qalculate-gtk.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ]; patches = oldAttrs.patches or [ ] ++ [ ./skip-save-prefs.patch ];
}); });
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home = { home = {
packages = [ qalculate-gtk ]; packages = [ qalculate-gtk ];
persistence."/cache${user.home}".files = [ persistence."/cache${userConfig.home}".files = [
"${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history" "${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history"
]; ];
}; };

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,10 +8,10 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
qt = { qt = {
enable = true; enable = true;
platformTheme.name = "qtct"; platformTheme.name = "qtct";

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,17 +8,20 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.rofi = { programs.rofi = {
enable = true; enable = true;
package = pkgs.rofi-wayland; package = pkgs.rofi-wayland;
font = builtins.head hmConfig.theme.font.monospace.names; font = builtins.head hmConfig.theme.font.monospace.names;
}; };
home.persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/rofi" ]; home.persistence."/cache${userConfig.home}".directories = [
"${hmConfig.xdg.relativeCacheHome}/rofi"
];
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [
"$mod, r, exec, ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -show drun" "$mod, r, exec, ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -show drun"

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -8,7 +8,8 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
themeSwww = lib.meta.getExe ( themeSwww = lib.meta.getExe (
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "theme-swww"; name = "theme-swww";
@@ -21,10 +22,10 @@ let
); );
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home = { home = {
packages = with pkgs; [ swww ]; packages = with pkgs; [ swww ];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ]; persistence."/cache${userConfig.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ];
}; };
systemd.user.services.swww = { systemd.user.services.swww = {

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -9,11 +9,12 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
themeBin = lib.meta.getExe hmConfig.theme.pkg; themeBin = lib.meta.getExe hmConfig.theme.pkg;
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
theme.enable = true; theme.enable = true;
@@ -27,7 +28,9 @@ in
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [
"writeBoundary" "writeBoundary"
] "run ${themeBin}"; ] "run ${themeBin}";
persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ]; persistence."/persist${userConfig.home}".directories = [
"${hmConfig.xdg.relativeConfigHome}/theme"
];
}; };
}; };
} }

View File

@@ -1,5 +1,5 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ {
config, config,
@@ -9,10 +9,11 @@
... ...
}: }:
let let
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
programs.vscode = { programs.vscode = {
enable = true; enable = true;
@@ -82,9 +83,9 @@ in
imports = [ ./langs/nix.nix ]; imports = [ ./langs/nix.nix ];
home.persistence = { home.persistence = {
"/persist${user.home}".directories = [ ".config/Code" ]; "/persist${userConfig.home}".directories = [ ".config/Code" ];
# Bastard: https://github.com/microsoft/vscode/issues/3884 # Bastard: https://github.com/microsoft/vscode/issues/3884
"/cache${user.home}".directories = [ "/cache${userConfig.home}".directories = [
".config/Code/Cache" ".config/Code/Cache"
".config/Code/CachedConfigurations" ".config/Code/CachedConfigurations"
".config/Code/CachedData" ".config/Code/CachedData"

View File

@@ -1,7 +1,7 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ pkgs, ... }: { pkgs, ... }:
{ {
home-manager.users.${user.name}.home.packages = with pkgs; [ wev ]; home-manager.users.${username}.home.packages = with pkgs; [ wev ];
} }

View File

@@ -1,12 +1,12 @@
{ {
user ? throw "user argument is required", username ? throw "username argument is required",
}: }:
{ config, ... }: { config, ... }:
let let
hmConfig = config.home-manager.users.${user.name}; hmConfig = config.home-manager.users.${username};
in in
{ {
home-manager.users.${user.name} = { home-manager.users.${username} = {
home.pointerCursor.x11.enable = true; home.pointerCursor.x11.enable = true;
xresources.path = "${hmConfig.xdg.configHome}/X11/xresources"; xresources.path = "${hmConfig.xdg.configHome}/X11/xresources";
}; };

View File

@@ -1,72 +1,73 @@
{ config, ... }: { config, ... }:
let let
user = config.users.users.nick; username = "nick";
hmConfig = config.home-manager.users.${user.name}; userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
in in
{ {
imports = [ imports = [
../common/user/configs/options.nix ../common/user/configs/options.nix
(import ../common/user/configs/console/bluetooth { inherit user; }) (import ../common/user/configs/console/bluetooth { inherit username; })
(import ../common/user/configs/console/brightnessctl { inherit user; }) (import ../common/user/configs/console/brightnessctl { inherit username; })
(import ../common/user/configs/console/btop { inherit user; }) (import ../common/user/configs/console/btop { inherit username; })
(import ../common/user/configs/console/git { inherit user; }) (import ../common/user/configs/console/git { inherit username; })
(import ../common/user/configs/console/gpg-agent { inherit user; }) (import ../common/user/configs/console/gpg-agent { inherit username; })
(import ../common/user/configs/console/home-manager { inherit user; }) (import ../common/user/configs/console/home-manager { inherit username; })
(import ../common/user/configs/console/neovim { inherit user; }) (import ../common/user/configs/console/neovim { inherit username; })
(import ../common/user/configs/console/persist { inherit user; }) (import ../common/user/configs/console/persist { inherit username; })
(import ../common/user/configs/console/pipewire { inherit user; }) (import ../common/user/configs/console/pipewire { inherit username; })
(import ../common/user/configs/console/sops { inherit user; }) (import ../common/user/configs/console/sops { inherit username; })
(import ../common/user/configs/console/syncthing { inherit user; }) (import ../common/user/configs/console/syncthing { inherit username; })
(import ../common/user/configs/console/xdg { inherit user; }) (import ../common/user/configs/console/xdg { inherit username; })
(import ../common/user/configs/console/zsh { inherit user; }) (import ../common/user/configs/console/zsh { inherit username; })
(import ../common/user/configs/gui/ags { inherit user; }) (import ../common/user/configs/gui/ags { inherit username; })
(import ../common/user/configs/gui/bluetooth { inherit user; }) (import ../common/user/configs/gui/bluetooth { inherit username; })
(import ../common/user/configs/gui/brightnessctl { inherit user; }) (import ../common/user/configs/gui/brightnessctl { inherit username; })
(import ../common/user/configs/gui/btop { inherit user; }) (import ../common/user/configs/gui/btop { inherit username; })
# (import ../common/user/configs/gui/cbatticon { inherit user; }) # (import ../common/user/configs/gui/cbatticon { inherit username; })
(import ../common/user/configs/gui/cliphist { inherit user; }) (import ../common/user/configs/gui/cliphist { inherit username; })
(import ../common/user/configs/gui/firefox { inherit user; }) (import ../common/user/configs/gui/firefox { inherit username; })
(import ../common/user/configs/gui/gtk { inherit user; }) (import ../common/user/configs/gui/gtk { inherit username; })
(import ../common/user/configs/gui/hyprland { inherit user; }) (import ../common/user/configs/gui/hyprland { inherit username; })
(import ../common/user/configs/gui/hyprshot { inherit user; }) (import ../common/user/configs/gui/hyprshot { inherit username; })
(import ../common/user/configs/gui/kitty { inherit user; }) (import ../common/user/configs/gui/kitty { inherit username; })
(import ../common/user/configs/gui/matugen { inherit user; }) (import ../common/user/configs/gui/matugen { inherit username; })
(import ../common/user/configs/gui/networking { inherit user; }) (import ../common/user/configs/gui/networking { inherit username; })
(import ../common/user/configs/gui/obsidian { inherit user; }) (import ../common/user/configs/gui/obsidian { inherit username; })
(import ../common/user/configs/gui/pipewire { inherit user; }) (import ../common/user/configs/gui/pipewire { inherit username; })
(import ../common/user/configs/gui/qalculate { inherit user; }) (import ../common/user/configs/gui/qalculate { inherit username; })
(import ../common/user/configs/gui/qt { inherit user; }) (import ../common/user/configs/gui/qt { inherit username; })
(import ../common/user/configs/gui/rofi { inherit user; }) (import ../common/user/configs/gui/rofi { inherit username; })
(import ../common/user/configs/gui/swww { inherit user; }) (import ../common/user/configs/gui/swww { inherit username; })
(import ../common/user/configs/gui/theme { inherit user; }) (import ../common/user/configs/gui/theme { inherit username; })
(import ../common/user/configs/gui/vscode { inherit user; }) (import ../common/user/configs/gui/vscode { inherit username; })
(import ../common/user/configs/gui/wev { inherit user; }) (import ../common/user/configs/gui/wev { inherit username; })
(import ../common/user/configs/gui/x11 { inherit user; }) (import ../common/user/configs/gui/x11 { inherit username; })
]; ];
sops.secrets.nick-password = { sops.secrets."${username}-password" = {
sopsFile = ../../users/nick/secrets/secrets.yaml; sopsFile = ../../users/${username}/secrets/secrets.yaml;
key = "password"; key = "password";
neededForUsers = true; neededForUsers = true;
}; };
users.users.nick = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
email = "nick@karaolidis.com"; email = "nick@karaolidis.com";
fullName = "Nikolaos Karaolidis"; fullName = "Nikolaos Karaolidis";
description = user.fullName; description = userConfig.fullName;
hashedPasswordFile = config.sops.secrets.nick-password.path; hashedPasswordFile = config.sops.secrets."${username}-password".path;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
linger = true; linger = true;
uid = 1000; uid = 1000;
}; };
services.getty.autologinUser = user.name; services.getty.autologinUser = userConfig.name;
home-manager.users.${user.name} = { home-manager.users.${username} = {
home.homeDirectory = user.home; home.homeDirectory = userConfig.home;
sops.defaultSopsFile = ../../users/nick/secrets/secrets.yaml; sops.defaultSopsFile = ../../users/${username}/secrets/secrets.yaml;
theme.wallpaper = ../../users/nick/secrets/wallpapers/clouds.png; theme.wallpaper = ../../users/${username}/secrets/wallpapers/clouds.png;
services.syncthing.settings.folders = { services.syncthing.settings.folders = {
obsidian = { obsidian = {