refactor!(tmpfiles): expand power upon tmpfiles by deabstracting
This returns tmpfiles to its original form. Turns out that making something too simple gives it less power.
This commit is contained in:
parent
f4770f1908
commit
035fb24038
20 changed files with 74 additions and 72 deletions
|
@ -3,34 +3,34 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) types mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
createTmpfilesEntries = entries: builtins.attrValues (builtins.mapAttrs (dest: path: "L+ %h/${dest} - - - - ${path}") entries);
|
inherit (lib.types) attrsOf listOf submodule str package;
|
||||||
users = config.alqueva.users;
|
users = config.alqueva.users;
|
||||||
in {
|
in {
|
||||||
options.alqueva.users = mkOption {
|
options.alqueva.users = mkOption {
|
||||||
type = types.attrsOf (types.submodule {
|
type = attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
tmpfiles = mkOption {
|
tmpfiles = mkOption {
|
||||||
description = "tmpfiles";
|
description = "tmpfiles";
|
||||||
type = types.attrsOf types.path;
|
type = listOf str;
|
||||||
default = {};
|
default = [];
|
||||||
};
|
};
|
||||||
packages = mkOption {
|
packages = mkOption {
|
||||||
type = types.listOf types.package;
|
type = listOf package;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Packages installed to the the defined user.";
|
description = "Packages installed to the the defined user.";
|
||||||
};
|
};
|
||||||
groups = mkOption {
|
groups = mkOption {
|
||||||
type = types.listOf types.str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
description = "Groups to add the defined user to.";
|
description = "Groups to add the defined user to.";
|
||||||
};
|
};
|
||||||
shell = mkOption {
|
shell = mkOption {
|
||||||
type = types.package;
|
type = package;
|
||||||
default = config.programs.bash.package;
|
default = config.programs.bash.package;
|
||||||
description = "Shell the user wants to use.";
|
description = "Shell the user wants to use.";
|
||||||
};
|
};
|
||||||
enable = (lib.mkEnableOption "this user.") // {default = true;};
|
enable = (mkEnableOption "this user.") // {default = true;};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
description = "Users to have on the system.";
|
description = "Users to have on the system.";
|
||||||
|
@ -52,7 +52,7 @@ in {
|
||||||
|
|
||||||
systemd.user.tmpfiles.users =
|
systemd.user.tmpfiles.users =
|
||||||
builtins.mapAttrs (_: uc: {
|
builtins.mapAttrs (_: uc: {
|
||||||
rules = createTmpfilesEntries uc.tmpfiles;
|
rules = uc.tmpfiles;
|
||||||
})
|
})
|
||||||
enabledUsers;
|
enabledUsers;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./users/amadaluzia
|
./users/artur
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./disks.nix
|
./disks.nix
|
||||||
./theme.nix
|
./theme.nix
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
alqueva.users.artur = {
|
|
||||||
shell = config.alqueva.shells.nushell.package;
|
|
||||||
tmpfiles = {
|
|
||||||
".config/qutebrowser/config.py" = ./configs/qutebrowser/config.py;
|
|
||||||
".config/qutebrowser/theme" = ./configs/qutebrowser/theme;
|
|
||||||
".config/vesktop/themes/theme.user.css" = pkgs.fetchurl {
|
|
||||||
url = "https://raw.githubusercontent.com/deathbeam/base16-discord/refs/heads/main/themes/base16-nord.theme.css";
|
|
||||||
hash = "sha256-LofqgsVl+XKisk/dmb/PpwuLEWdEgchIfIw4xZs6LQw=";
|
|
||||||
};
|
|
||||||
".config/vesktop/settings/quickCss.css" = ./configs/vesktop/quickCss.css;
|
|
||||||
".config/kanshi/" = ./configs/kanshi;
|
|
||||||
".config/dunst/" = ./configs/dunst;
|
|
||||||
".config/niri/" = ./configs/niri;
|
|
||||||
".config/rofi/" = ./configs/rofi;
|
|
||||||
".config/foot" = ./configs/foot;
|
|
||||||
".config/waybar/config.jsonc" = ./configs/waybar/config.jsonc;
|
|
||||||
".config/waybar/style.css" = ./configs/waybar/style.css;
|
|
||||||
};
|
|
||||||
packages = builtins.attrValues {
|
|
||||||
inherit
|
|
||||||
(pkgs)
|
|
||||||
eww
|
|
||||||
wget
|
|
||||||
vesktop-electron32
|
|
||||||
mpv
|
|
||||||
imv
|
|
||||||
amberol
|
|
||||||
fractal
|
|
||||||
nicotine-plus-libadwaita
|
|
||||||
nautilus
|
|
||||||
librewolf
|
|
||||||
playerctl
|
|
||||||
geary
|
|
||||||
qutebrowser
|
|
||||||
dunst
|
|
||||||
gh
|
|
||||||
rofi-wayland
|
|
||||||
foot
|
|
||||||
signal-desktop
|
|
||||||
dino
|
|
||||||
polari
|
|
||||||
;
|
|
||||||
inherit (inputs.hetch.packages.${pkgs.system}) hetch;
|
|
||||||
inherit (inputs.gimp-nixpkgs.legacyPackages.${pkgs.system}) gimp;
|
|
||||||
};
|
|
||||||
groups = [
|
|
||||||
"wheel"
|
|
||||||
"video"
|
|
||||||
"audio"
|
|
||||||
"networkmanager"
|
|
||||||
"input"
|
|
||||||
"libvirtd"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
BIN
hosts/solterra/users/artur/.face.icon
Normal file
BIN
hosts/solterra/users/artur/.face.icon
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
63
hosts/solterra/users/artur/default.nix
Normal file
63
hosts/solterra/users/artur/default.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
alqueva.users.artur = {
|
||||||
|
shell = config.alqueva.shells.nushell.package;
|
||||||
|
tmpfiles = [
|
||||||
|
"L+ %h/.config/qutebrowser/config.py - - - - ${./configs/qutebrowser/config.py}"
|
||||||
|
"L+ %h/.config/qutebrowser/theme - - - - ${./configs/qutebrowser/theme}"
|
||||||
|
(let
|
||||||
|
theme = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/deathbeam/base16-discord/refs/heads/main/themes/base16-nord.theme.css";
|
||||||
|
hash = "sha256-LofqgsVl+XKisk/dmb/PpwuLEWdEgchIfIw4xZs6LQw=";
|
||||||
|
};
|
||||||
|
in "L+ %h/.config/vesktop/themes/theme.user.css - - - - ${theme}")
|
||||||
|
"L+ %h/.config/vesktop/settings/quickCss.css - - - - ${./configs/vesktop/quickCss.css}"
|
||||||
|
"L+ %h/.config/kanshi/ - - - - ${./configs/kanshi}"
|
||||||
|
"L+ %h/.config/dunst/ - - - - ${./configs/dunst}"
|
||||||
|
"L+ %h/.config/niri/ - - - - ${./configs/niri}"
|
||||||
|
"L+ %h/.config/rofi/ - - - - ${./configs/rofi}"
|
||||||
|
"L+ %h/.config/foot - - - - ${./configs/foot}"
|
||||||
|
"L+ %h/.config/waybar - - - - ${./configs/waybar}"
|
||||||
|
"L+ %h/.face.icon - - - - ${./.face.icon}"
|
||||||
|
];
|
||||||
|
packages = builtins.attrValues {
|
||||||
|
inherit
|
||||||
|
(pkgs)
|
||||||
|
eww
|
||||||
|
wget
|
||||||
|
vesktop-electron32
|
||||||
|
mpv
|
||||||
|
imv
|
||||||
|
amberol
|
||||||
|
fractal
|
||||||
|
nicotine-plus-libadwaita
|
||||||
|
nautilus
|
||||||
|
librewolf
|
||||||
|
playerctl
|
||||||
|
geary
|
||||||
|
qutebrowser
|
||||||
|
dunst
|
||||||
|
gh
|
||||||
|
rofi-wayland
|
||||||
|
foot
|
||||||
|
signal-desktop
|
||||||
|
dino
|
||||||
|
polari
|
||||||
|
;
|
||||||
|
inherit (inputs.hetch.packages.${pkgs.system}) hetch;
|
||||||
|
inherit (inputs.gimp-nixpkgs.legacyPackages.${pkgs.system}) gimp;
|
||||||
|
};
|
||||||
|
groups = [
|
||||||
|
"wheel"
|
||||||
|
"video"
|
||||||
|
"audio"
|
||||||
|
"networkmanager"
|
||||||
|
"input"
|
||||||
|
"libvirtd"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue