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

View file

@ -7,14 +7,14 @@
fsType = "btrfs";
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";
fsType = "btrfs";
options = [ "subvol=Steam" "nosuid" "nodev" "nofail" "x-gvfs-show" ];
};
# Network mounts
"/home/jimbo/JimboNFS" = {
"/home/${config.sysusers.main}/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
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" = { };
"/jimbo" = {
"/${config.sysusers.main}" = {
mountpoint = "/persist/home/jimbo";
mountOptions = [ "compress=zstd" "noatime" "ssd" ];
};
"/jimbo/.snapshots" = { };
"/${config.sysusers.main}/.snapshots" = { };
};
};
};
@ -92,6 +92,6 @@
# Needed for impermanence
fileSystems = {
"/persist".neededForBoot = true;
"/persist/home/jimbo".neededForBoot = true;
"/persist/home/${config.sysusers.main}".neededForBoot = true;
};
}

View file

@ -2,7 +2,7 @@
{
fileSystems = {
# Network mounts
"/home/jimbo/JimboNFS" = {
"/home/${config.sysusers.main}/JimboNFS" = {
device = "10.100.0.1:/export/JimboNFS";
fsType = "nfs4";
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 = {
desktop.enable = false;
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 = {
desktop.enable = false;
stateVersion = lib.mkForce "24.05";

View file

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

View file

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

View file

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

View file

@ -32,14 +32,14 @@
fsType = "btrfs";
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";
fsType = "btrfs";
options = [ "subvol=images" "nosuid" "nodev" "nofail" ];
};
# Network mounts
"/home/jimbo/JimboNFS" = {
"/home/${config.sysusers.main}/JimboNFS" = {
device = "${config.ips.server}:/export/JimboNFS";
fsType = "nfs4";
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
./ips
./look
./users
./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}';
--urlbar-font: '${config.look.fonts.main}';
'';
themeJim = ''
themeMain = ''
:root {
--tab-active-bg-color: #${config.look.colors.prime};
--tab-hover-bg-color: #${config.look.colors.accent};
@ -114,8 +114,8 @@ in {
};
commonBookmarks = [
{
name = "Jimbo";
url = "https://jimbosfiles.com";
name = "NixFox";
url = "https://nixfox.ca";
}
{
name = "Corn";
@ -252,7 +252,7 @@ in {
bookmarks = commonBookmarks;
settings = commonSettings;
userChrome = ''
${themeJim}
${themeMain}
${themeFont}
${builtins.readFile ./quteFox.css}
'';

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,7 @@
{ pkgs, config, ... }:
{
users.users.jimbo = {
description = "Jimbo";
hashedPassword = config.secrets.jimboAccPass;
users.users."${config.sysusers.main}" = {
hashedPassword = config.secrets.mainAccPass;
isNormalUser = true;
openssh.authorizedKeys.keys = [
(builtins.readFile ../../../../../../hosts/tower/id_ed25519.pub)
@ -34,5 +33,5 @@
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" ];
};

View file

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

View file

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

View file

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

View file

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

Binary file not shown.

View file

@ -52,6 +52,6 @@
"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 = {
acceptTerms = true;
defaults.email = "jimbo@${config.domains.p2}";
defaults.email = "contact@${config.domains.p2}";
};
}

View file

@ -1,9 +1,7 @@
{ ... }:
{
imports = [
#./nextcloud
./nfs
./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;
hostname = "radio.${config.domains.p2}";
admin = {
user = "jimbo";
user = "${config.sysusers.main}";
password = "${config.secrets.castAdminPass}";
};
extraConf = ''