Variablize username more

This commit is contained in:
Jimbo 2025-01-03 17:52:33 -05:00
parent 33236aedc6
commit ea3a6db5af
39 changed files with 93 additions and 102 deletions

View file

@ -69,11 +69,11 @@
}; };
"/persist/.snapshots" = { }; "/persist/.snapshots" = { };
"/jimbo" = { "${config.sysusers.main}" = {
mountpoint = "/persist/home/jimbo"; mountpoint = "/persist/home/${config.sysusers.main}";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" ];
}; };
"/jimbo/.snapshots" = { }; "/${config.sysusers.main}/.snapshots" = { };
}; };
}; };
}; };
@ -92,6 +92,6 @@
# Needed for impermanence # Needed for impermanence
fileSystems = { fileSystems = {
"/persist".neededForBoot = true; "/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true; "/persist/home/${config.sysusers.main}".neededForBoot = true;
}; };
} }

View file

@ -7,14 +7,14 @@
fsType = "btrfs"; fsType = "btrfs";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ]; options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
}; };
"/persist/home/jimbo/.local/share/Steam" = { "/persist/home/${config.sysusers.main}/.local/share/Steam" = {
device = "/dev/disk/by-uuid/135281e2-72ec-4c00-91e8-9897a32c02ce"; device = "/dev/disk/by-uuid/135281e2-72ec-4c00-91e8-9897a32c02ce";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=Steam" "nosuid" "nodev" "nofail" "x-gvfs-show" ]; options = [ "subvol=Steam" "nosuid" "nodev" "nofail" "x-gvfs-show" ];
}; };
# Network mounts # Network mounts
"/home/jimbo/JimboNFS" = { "/home/${config.sysusers.main}/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS"; device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4"; fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -1,4 +1,4 @@
{ ... }: { config ... }:
{ {
imports = [ ./jimbo ]; imports = [ ./main ];
} }

View file

@ -1,6 +0,0 @@
{ lib, ... }:
{
home-manager.users.jimbo = {
home.stateVersion = lib.mkForce "24.11";
};
}

View file

@ -0,0 +1,6 @@
{ config, lib, ... }:
{
home-manager.users."${config.users.main}" = {
home.stateVersion = lib.mkForce "24.11";
};
}

View file

@ -69,11 +69,11 @@
}; };
"/persist/.snapshots" = { }; "/persist/.snapshots" = { };
"/jimbo" = { "/${config.sysusers.main}" = {
mountpoint = "/persist/home/jimbo"; mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" ];
}; };
"/jimbo/.snapshots" = { }; "/${config.sysusers.main}/.snapshots" = { };
}; };
}; };
}; };
@ -92,6 +92,6 @@
# Needed for impermanence # Needed for impermanence
fileSystems = { fileSystems = {
"/persist".neededForBoot = true; "/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true; "/persist/home/${config.sysusers.main}".neededForBoot = true;
}; };
} }

View file

@ -2,7 +2,7 @@
{ {
fileSystems = { fileSystems = {
# Network mounts # Network mounts
"/home/jimbo/JimboNFS" = { "/home/${config.sysusers.main}/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS"; device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4"; fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ ./jimbo ]; imports = [ ./main ];
} }

View file

@ -1,6 +0,0 @@
{ ... }:
{
home-manager.users.jimbo = {
home.stateVersion = "24.11";
};
}

6
hosts/extern/users/main/default.nix vendored Normal file
View file

@ -0,0 +1,6 @@
{ config, ... }:
{
home-manager.users.${config.sysusers.main} = {
home.stateVersion = "24.11";
};
}

View file

@ -1,6 +1,6 @@
{ lib, ... }: { config, lib, ... }:
{ {
home-manager.users.jimbo = { home-manager.users."${config.sysusers.main}" = {
home = { home = {
desktop.enable = false; desktop.enable = false;
stateVersion = lib.mkForce "24.05"; stateVersion = lib.mkForce "24.05";

View file

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ ./jimbo ]; imports = [ ./main ];
} }

View file

@ -1,6 +1,6 @@
{ lib, ... }: { config, lib, ... }:
{ {
home-manager.users.jimbo = { home-manager.users."${config.sysusers.main}" = {
home = { home = {
desktop.enable = false; desktop.enable = false;
stateVersion = lib.mkForce "24.05"; stateVersion = lib.mkForce "24.05";

View file

@ -68,11 +68,11 @@
}; };
"/persist/.snapshots" = { }; "/persist/.snapshots" = { };
"/jimbo" = { "/${config.sysusers.main}" = {
mountpoint = "/persist/home/jimbo"; mountpoint = "/persist/home/${config.sysusers.main}";
mountOptions = [ "compress=zstd" "noatime" ]; mountOptions = [ "compress=zstd" "noatime" ];
}; };
"/jimbo/.snapshots" = { }; "/${config.sysusers.main}/.snapshots" = { };
}; };
}; };
}; };

View file

@ -1,11 +1,11 @@
{ ... }: { config, ... }:
{ {
fileSystems = { fileSystems = {
"/mnt/Windrive" = { "/mnt/Windrive" = {
device = "/dev/disk/by-uuid/582C6B802C6B57D0"; device = "/dev/disk/by-uuid/582C6B802C6B57D0";
options = [ "nosuid" "nodev" ]; options = [ "nosuid" "nodev" ];
}; };
"/home/jimbo/JimboNFS" = { "/home/${config.sysusers.main}/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS"; device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4"; fsType = "nfs4";
options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ];

View file

@ -69,11 +69,11 @@
}; };
"/persist/.snapshots" = { }; "/persist/.snapshots" = { };
"/jimbo" = { "/${config.sysusers.main}" = {
mountpoint = "/persist/home/jimbo"; mountpoint = "/persist/home/${config.sysusers.main}";
mountOptions = [ "compress=zstd" "noatime" "ssd" ]; mountOptions = [ "compress=zstd" "noatime" "ssd" ];
}; };
"/jimbo/.snapshots" = { }; "/${config.sysusers.main}/.snapshots" = { };
}; };
}; };
}; };
@ -92,6 +92,6 @@
# Needed for impermanence # Needed for impermanence
fileSystems = { fileSystems = {
"/persist".neededForBoot = true; "/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true; "/persist/home/${config.sysusers.main}".neededForBoot = true;
}; };
} }

View file

@ -32,14 +32,14 @@
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=libvirt" "nosuid" "nodev" "nofail" ]; options = [ "subvol=libvirt" "nosuid" "nodev" "nofail" ];
}; };
"/persist/home/jimbo/VMs" = { "/persist/home/${config.sysusers.main}/VMs" = {
device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355"; device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=images" "nosuid" "nodev" "nofail" ]; options = [ "subvol=images" "nosuid" "nodev" "nofail" ];
}; };
# Network mounts # Network mounts
"/home/jimbo/JimboNFS" = { "/home/${config.sysusers.main}/JimboNFS" = {
device = "${config.ips.server}:/export/JimboNFS"; device = "${config.ips.server}:/export/JimboNFS";
fsType = "nfs4"; fsType = "nfs4";
options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ]; options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ];

View file

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ ./jimbo ]; imports = [ ./main ];
} }

View file

@ -1,6 +0,0 @@
{ lib, ... }:
{
home-manager.users.jimbo = {
home.stateVersion = lib.mkForce "24.05";
};
}

View file

@ -0,0 +1,6 @@
{ config, lib, ... }:
{
home-manager.users."${config.sysusers.main}" = {
home.stateVersion = lib.mkForce "24.05";
};
}

View file

@ -5,6 +5,7 @@
./domains ./domains
./ips ./ips
./look ./look
./users
./workspaces ./workspaces
]; ];
} }

View file

@ -0,0 +1,11 @@
{ lib, config, ... }:
{
options.sysusers = lib.mkOption {
type = lib.types.attrs;
default = {};
};
config.sysusers = {
main = "jimbo";
};
}

View file

@ -5,7 +5,7 @@ let
--tab-font: '${config.look.fonts.main}'; --tab-font: '${config.look.fonts.main}';
--urlbar-font: '${config.look.fonts.main}'; --urlbar-font: '${config.look.fonts.main}';
''; '';
themeJim = '' themeMain = ''
:root { :root {
--tab-active-bg-color: #${config.look.colors.prime}; --tab-active-bg-color: #${config.look.colors.prime};
--tab-hover-bg-color: #${config.look.colors.accent}; --tab-hover-bg-color: #${config.look.colors.accent};
@ -114,8 +114,8 @@ in {
}; };
commonBookmarks = [ commonBookmarks = [
{ {
name = "Jimbo"; name = "NixFox";
url = "https://jimbosfiles.com"; url = "https://nixfox.ca";
} }
{ {
name = "Corn"; name = "Corn";
@ -252,7 +252,7 @@ in {
bookmarks = commonBookmarks; bookmarks = commonBookmarks;
settings = commonSettings; settings = commonSettings;
userChrome = '' userChrome = ''
${themeJim} ${themeMain}
${themeFont} ${themeFont}
${builtins.readFile ./quteFox.css} ${builtins.readFile ./quteFox.css}
''; '';

View file

@ -98,20 +98,20 @@
file = { file = {
".local/share/ranger/bookmarks".text = '' ".local/share/ranger/bookmarks".text = ''
# Local files # Local files
h:/home/${config.home.username}/ h:/home/${config.sysusers.main}/
k:/home/${config.home.username}/Keepers k:/home/${config.sysusers.main}/Keepers
j:/home/${config.home.username}/Downloads j:/home/${config.sysusers.main}/Downloads
v:/home/${config.home.username}/Videos v:/home/${config.sysusers.main}/Videos
c:/home/${config.home.username}/.config c:/home/${config.sysusers.main}/.config
l:/home/${config.home.username}/.local l:/home/${config.sysusers.main}/.local
d:/mnt d:/mnt
n:/etc/nixos n:/etc/nixos
# Remote files # Remote files
J:/home/${config.home.username}/JimboNFS J:/home/${config.sysusers.main}/JimboNFS
K:/home/${config.home.username}/JimboNFS/Files K:/home/${config.sysusers.main}/JimboNFS/Files
V:/home/${config.home.username}/JimboNFS/Media V:/home/${config.sysusers.main}/JimboNFS/Media
M:/home/${config.home.username}/JimboNFS/Music M:/home/${config.sysusers.main}/JimboNFS/Music
''; '';
}; };
packages = with pkgs; [ packages = with pkgs; [

View file

@ -3,8 +3,8 @@
services.mpd = { services.mpd = {
enable = config.home.desktop.enable; enable = config.home.desktop.enable;
network.startWhenNeeded = true; network.startWhenNeeded = true;
musicDirectory = "/home/jimbo/JimboNFS/Music/JimBops"; musicDirectory = "/home/${config.sysusers.main}/JimboNFS/Music/JimBops";
playlistDirectory = "/home/jimbo/JimboNFS/Music/JimBops/Playlists"; playlistDirectory = "/home/${config.sysusers.main}/JimboNFS/Music/JimBops/Playlists";
extraConfig = '' extraConfig = ''
audio_output { audio_output {
type "pipewire" type "pipewire"

View file

@ -1,8 +1,8 @@
{ ... }: { config, ... }:
{ {
home = { home = {
username = "jimbo"; username = "${config.sysusers.main}";
homeDirectory = "/home/jimbo"; homeDirectory = "/home/${config.sysusers.main}";
sessionVariables = { sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
MANPAGER = "nvim +Man!"; MANPAGER = "nvim +Man!";

View file

@ -1,7 +1,7 @@
{ home-manager, ... }: { home-manager, ... }:
{ {
imports = [ imports = [
./jimbo ./main
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
]; ];
} }

View file

@ -1,8 +1,7 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
users.users.jimbo = { users.users."${config.sysusers.main}" = {
description = "Jimbo"; hashedPassword = config.secrets.mainAccPass;
hashedPassword = config.secrets.jimboAccPass;
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
(builtins.readFile ../../../../../../hosts/tower/id_ed25519.pub) (builtins.readFile ../../../../../../hosts/tower/id_ed25519.pub)
@ -34,5 +33,5 @@
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
home-manager.users.jimbo = import ../../../../../home; home-manager.users."${config.sysusers.main}" = import ../../../../../home;
} }

View file

@ -9,7 +9,7 @@
}; };
}; };
systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/jimbo" ]; systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/${config.sysusers.main}" ];
environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ]; environment.persistence."/persist".directories = [ "/var/lib/bluetooth" ];
}; };

View file

@ -1,8 +1,8 @@
{ impermanence, ... }: { impermanence, ... }:
{ {
imports = [ imports = [
./main
./root ./root
./jimbo
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
]; ];
} }

View file

@ -1,8 +1,8 @@
{ ... }: { config, ... }:
{ {
environment.persistence."/persist" = { environment.persistence."/persist" = {
hideMounts = true; hideMounts = true;
users.jimbo = { users.${config.sysusers.main} = {
directories = [ directories = [
"Keepers" "Keepers"
"Documents" "Documents"

View file

@ -1,8 +1,8 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./main
./root ./root
./jimbo
]; ];
services.snapper = { services.snapper = {

View file

@ -1,7 +1,7 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
services.snapper.configs.jimbo = lib.mkIf config.environment.persistence."/persist".enable { services.snapper.configs.${config.sysusers.main} = lib.mkIf config.environment.persistence."/persist".enable {
SUBVOLUME = "/persist/home/jimbo"; SUBVOLUME = "/persist/home/${config.sysusers.main}";
TIMELINE_CREATE = true; TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true; TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1; TIMELINE_LIMIT_DAILY = 1;

Binary file not shown.

View file

@ -52,6 +52,6 @@
"virbr1" "virbr1"
]; ];
systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 jimbo libvirtd -" ]; systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 ${config.sysusers.main} libvirtd -" ];
}; };
} }

View file

@ -2,6 +2,6 @@
{ {
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "jimbo@${config.domains.p2}"; defaults.email = "contact@${config.domains.p2}";
}; };
} }

View file

@ -1,9 +1,7 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
#./nextcloud
./nfs ./nfs
./samba ./samba
./seafile
]; ];
} }

View file

@ -1,18 +0,0 @@
{ lib, config, ... }:
{
services.nginx.virtualHosts."cloud.${config.domains.p2}" = lib.mkIf config.services.nextcloud.enable {
enableACME = true;
addSSL = true;
locations."/" = {
proxyWebsockets = true;
extraConfig = ''
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
'';
};
};
}

View file

@ -10,7 +10,7 @@
listen.port = 265; listen.port = 265;
hostname = "radio.${config.domains.p2}"; hostname = "radio.${config.domains.p2}";
admin = { admin = {
user = "jimbo"; user = "${config.sysusers.main}";
password = "${config.secrets.castAdminPass}"; password = "${config.secrets.castAdminPass}";
}; };
extraConf = '' extraConf = ''