mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Do some minor refactoring
This commit is contained in:
parent
ea509959ff
commit
472d0eea96
9 changed files with 29 additions and 21 deletions
|
|
@ -29,6 +29,8 @@
|
|||
|
||||
jsonConfig = { creation_rules = hostCreationRules ++ userCreationRules; } |> lib.strings.toJSON;
|
||||
in
|
||||
pkgs.runCommand "sops-config" { buildInputs = [ pkgs.yj ]; } "echo '${jsonConfig}' | yj -jy > $out";
|
||||
pkgs.runCommand "sops.yaml" { buildInputs = [ pkgs.yj ]; } ''
|
||||
echo '${jsonConfig}' | yj -jy > $out^
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
enable = true;
|
||||
agePublicKey = "age1qz04yg4h4g22wxqca2pd5k0z574223f6m5c9jy5ny37nlgcd6u4styf06t";
|
||||
};
|
||||
boot.loader.systemdBoot.enable = true;
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
users.seb.enable = true;
|
||||
|
||||
services = {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
agePublicKey = "age1sywwrwse76x8yskrsfpwk38fu2cmyx5s9qkf2pgc68cta0vj9psql7dp6e";
|
||||
};
|
||||
boot = {
|
||||
loader.systemdBoot.enable = true;
|
||||
loader.systemd-boot.enable = true;
|
||||
silent = true;
|
||||
};
|
||||
users.seb = {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
agePublicKey = "age18x6herevmcuhcmeh47ll6p9ck9zk4ga6gfxwlc8yl49rwjxm7qusylwfgc";
|
||||
};
|
||||
boot = {
|
||||
loader.systemdBoot.enable = true;
|
||||
loader.systemd-boot.enable = true;
|
||||
silent = true;
|
||||
};
|
||||
users.seb = {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
settings =
|
||||
let
|
||||
theme-name =
|
||||
themeName =
|
||||
{
|
||||
dark = "default";
|
||||
light = "GitHub_Light";
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
.${config.custom.theme};
|
||||
in
|
||||
{
|
||||
include = "${pkgs.kitty-themes}/share/kitty-themes/themes/${theme-name}.conf";
|
||||
include = "${pkgs.kitty-themes}/share/kitty-themes/themes/${themeName}.conf";
|
||||
font_family = "JetBrainsMono Nerd Font";
|
||||
background_opacity = "0.85";
|
||||
cursor_shape = "beam";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
cfgTheme = config.custom.theme;
|
||||
inherit (config.custom) theme;
|
||||
in
|
||||
{
|
||||
options.custom.theme = lib.mkOption {
|
||||
|
|
@ -22,8 +22,10 @@ in
|
|||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
theme.package = pkgs.gnome-themes-extra;
|
||||
iconTheme.package = pkgs.papirus-icon-theme;
|
||||
font.name = "Open Sans";
|
||||
font.package = pkgs.open-sans;
|
||||
font = {
|
||||
name = "Open Sans";
|
||||
package = pkgs.open-sans;
|
||||
};
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
|
|
@ -37,18 +39,22 @@ in
|
|||
};
|
||||
}
|
||||
|
||||
(lib.mkIf (cfgTheme == "dark") {
|
||||
(lib.mkIf (theme == "dark") {
|
||||
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
|
||||
gtk.theme.name = "Adwaita-dark";
|
||||
gtk.iconTheme.name = "Papirus-Dark";
|
||||
gtk = {
|
||||
theme.name = "Adwaita-dark";
|
||||
iconTheme.name = "Papirus-Dark";
|
||||
};
|
||||
qt.style.name = "adwaita-dark";
|
||||
home.pointerCursor.name = "Bibata-Original-Classic";
|
||||
})
|
||||
|
||||
(lib.mkIf (cfgTheme == "light") {
|
||||
(lib.mkIf (theme == "light") {
|
||||
dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-light";
|
||||
gtk.theme.name = "Adwaita";
|
||||
gtk.iconTheme.name = "Papirus";
|
||||
gtk = {
|
||||
theme.name = "Adwaita";
|
||||
iconTheme.name = "Papirus";
|
||||
};
|
||||
qt.style.name = "adwaita";
|
||||
home.pointerCursor.name = "Bibata-Original-Ice";
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.custom.boot.loader.systemdBoot.enable = lib.mkEnableOption "";
|
||||
options.custom.boot.loader.systemd-boot.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.custom.boot.loader.systemdBoot.enable {
|
||||
config = lib.mkIf config.custom.boot.loader.systemd-boot.enable {
|
||||
boot = {
|
||||
tmp.cleanOnBoot = true;
|
||||
loader = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ let
|
|||
user = config.users.users.hedgedoc.name;
|
||||
dataDir = "/var/lib/hedgedoc";
|
||||
|
||||
manage_users = "CMD_CONFIG_FILE=/run/hedgedoc/config.json NODE_ENV=production ${lib.getExe' pkgs.hedgedoc "manage_users"}";
|
||||
manageUsers = "CMD_CONFIG_FILE=/run/hedgedoc/config.json NODE_ENV=production ${lib.getExe' pkgs.hedgedoc "manage_users"}";
|
||||
in
|
||||
{
|
||||
options.custom.services.hedgedoc = {
|
||||
|
|
@ -76,14 +76,14 @@ in
|
|||
let
|
||||
manageUserSeb =
|
||||
mode:
|
||||
"${manage_users} --${mode} sebastian.stork@pm.me --pass \"$(cat ${
|
||||
"${manageUsers} --${mode} sebastian.stork@pm.me --pass \"$(cat ${
|
||||
config.sops.secrets."hedgedoc/seb-password".path
|
||||
})\"";
|
||||
in
|
||||
"${manageUserSeb "add"} || ${manageUserSeb "reset"}";
|
||||
};
|
||||
|
||||
environment.shellAliases.hedgedoc-manage-users = "sudo --user=${user} ${manage_users}";
|
||||
environment.shellAliases.hedgedoc-manage-users = "sudo --user=${user} ${manageUsers}";
|
||||
|
||||
custom.services.resticBackups.hedgedoc = lib.mkIf cfg.doBackups {
|
||||
conflictingService = "hedgedoc.service";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
resticBackups = lib.filterAttrs (_: value: value.enable) config.custom.services.resticBackups;
|
||||
resticBackups = config.custom.services.resticBackups |> lib.filterAttrs (_: value: value.enable);
|
||||
in
|
||||
{
|
||||
options.custom.services.resticBackups = lib.mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue