Bunch of stuff to get this ready for a two user system

This commit is contained in:
Jimbo 2025-02-28 13:11:45 -05:00
parent 2144d9ef61
commit 7eb3b1a0fa
119 changed files with 214 additions and 214 deletions

View file

@ -28,7 +28,7 @@
}@inputs:
{
nixosConfigurations.rubble = nixpkgs.lib.nixosSystem {
modules = [ ./host ];
modules = [ ./system ];
specialArgs = inputs;
};
};

View file

@ -1,19 +0,0 @@
{ ... }:
{
imports = [
./disko
./hardware
../modules/system
];
networking = {
hostName = "rubble";
hostId = "e0b1fcef";
};
system = {
extlinux.enable = true;
wireless.enable = true;
stateVersion = "24.11";
};
}

View file

@ -1,48 +0,0 @@
{ config, lib, pkgs, ... }:
{
options.sysusers = lib.mkOption {
type = lib.types.attrs;
};
config = {
sysusers.main = "jimbo";
users.users."${config.sysusers.main}" = {
hashedPassword = config.secrets.mainAccPass;
isNormalUser = true;
openssh.authorizedKeys.keyFiles = [
../../../../../../hosts/tower/id_ed25519.pub
../../../../../../hosts/envy/id_ed25519.pub
../../../../../../hosts/redmond/id_ed25519.pub
../../../../../../hosts/kitty/id_ed25519.pub
../../../../../../hosts/midas/id_ed25519.pub
../../../../../../hosts/prophet/id_ed25519.pub
../../../../../../hosts/rubble/id_ed25519.pub
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
];
extraGroups = [
"wheel"
"audio"
"video"
"input"
"disk"
"dialout"
"rtkit"
"kvm"
"libvirtd"
"qemu-libvirtd"
"nginx"
"minecraft"
"nfsShare"
];
uid = 1000;
shell = pkgs.zsh;
};
home-manager.users."${config.sysusers.main}" = import ../../../../../home;
};
}

View file

@ -1,38 +0,0 @@
{ config, lib, pkgs, ... }:
{
options.sysusers = lib.mkOption {
type = lib.types.attrs;
};
config = {
sysusers.main = "jimbo";
users.users."${config.sysusers.main}" = {
hashedPassword = config.secrets.mainAccPass;
isNormalUser = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFGHaxdTeC1xnTx2BY5LLR5LxhdSkmYoWuOeEuRIz0k"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
];
extraGroups = [
"wheel"
"audio"
"video"
"input"
"disk"
"dialout"
"rtkit"
"kvm"
"libvirtd"
"qemu-libvirtd"
"nginx"
"nfsShare"
];
uid = 1000;
shell = pkgs.zsh;
};
home-manager.users."${config.sysusers.main}" = import ../../../../../home;
};
}

View file

@ -1,16 +0,0 @@
{ lib, ... }:
{
imports = [
./accounts
./devices
./programs
./secrets
./services
./settings
];
options.system = with lib; {
desktop.enable = lib.mkEnableOption "Enable desktop apps and services";
server.enable = lib.mkEnableOption "Enable server apps and services";
};
}

View file

@ -1,10 +0,0 @@
{ config, lib, ... }:
{
options.system.extlinux.enable = lib.mkEnableOption "Enable extlinux";
config.boot.loader = lib.mkIf config.system.extlinux.enable {
grub.enable = false;
systemd-boot.enable = lib.mkForce false;
generic-extlinux-compatible.enable = true;
};
}

View file

@ -1,46 +0,0 @@
{ config, ... }:
{
environment.persistence."/persist" = {
hideMounts = true;
users.${config.sysusers.main} = {
directories = [
"Keepers"
"Documents"
"Pictures"
"Videos"
"Games"
"VMs"
".snapshots"
".mozilla"
".thunderbird"
".config/blender"
".config/dconf"
".config/vesktop"
".config/sunshine"
".config/heroic"
".config/obs-studio"
".local/share/mpd"
".local/share/nvim/undo"
".local/share/PrismLauncher"
".local/share/Steam"
".local/share/TelegramDesktop"
".local/state/wireplumber"
".cache/nix-index"
{ directory = ".ssh"; mode = "0700"; }
{ directory = ".gnupg"; mode = "0700"; }
{ directory = ".local/share/keyrings"; mode = "0700"; }
];
files = [
".zsh_history"
".local/state/lazygit/state.yml"
".local/share/applications" # Create directory so nothing generates inside of it
];
};
};
}

View file

@ -1,13 +0,0 @@
{ config, lib, pkgs, ... }:
{
options.system.wireless.enable = lib.mkEnableOption "Enable wireless stack";
config = lib.mkIf config.system.wireless.enable {
networking.wireless.iwd.enable = true;
environment = {
systemPackages = with pkgs; [ impala ];
persistence."/persist".directories = [ "/var/lib/iwd/" ];
};
};
}

Binary file not shown.

View file

@ -1,7 +0,0 @@
{ config, lib, ... }:
{
security = lib.mkIf config.system.desktop.enable {
polkit.enable = true;
rtkit.enable = true;
};
}

View file

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

View file

@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
{
users.users.jimbo = {
hashedPassword = config.secrets.jimboAccPass;
isNormalUser = true;
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIFGHaxdTeC1xnTx2BY5LLR5LxhdSkmYoWuOeEuRIz0k"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9"
];
extraGroups = [
"wheel"
"input"
"disk"
"dialout"
"rtkit"
"kvm"
"libvirtd"
"qemu-libvirtd"
"nginx"
"nfsShare"
];
uid = 1000;
shell = pkgs.zsh;
};
home-manager.users.jimbo = import ../../../../../home/jimbo;
}

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
{
users.users.jules = {
hashedPassword = config.secrets.jimboAccPass;
isNormalUser = true;
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHwxJcAWuHkKy/Ar37aIoqg34CDcZu7/bh978nYkOgzj jules@jules-pc"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOszCNP+6rkIS75GyFVhn9o6QpUuGdx/J4rjzROrpSl jules@xeta"
];
extraGroups = [
"wheel"
"input"
"disk"
"dialout"
"kvm"
"libvirtd"
"qemu-libvirtd"
"nginx"
"nfsShare"
];
uid = 1001;
shell = pkgs.fish;
};
#home-manager.users.jules = import ../../../../../jules/home;
}

24
system/default.nix Normal file
View file

@ -0,0 +1,24 @@
{ lib, ... }:
{
imports = [
./accounts
./devices
./programs
./secrets
./services
./settings
];
options.system = with lib; {
server.enable = mkEnableOption "Enable server apps and services";
};
config = {
networking = {
hostName = "rubble";
hostId = "e0b1fcef";
};
system.stateVersion = "24.11";
};
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
boot.loader = {
grub.enable = false;
systemd-boot.enable = false;
generic-extlinux-compatible.enable = true;
};
}

View file

@ -3,6 +3,7 @@
imports = [
./boot
./disks
./hardware
./networking
];
}

View file

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./disko
./filesystems
./immutable
./impermanence

View file

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

View file

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

View file

@ -0,0 +1,26 @@
{ config, ... }:
{
environment.persistence."/persist" = {
hideMounts = true;
users.jimbo = {
directories = [
"Keepers"
"Documents"
"Pictures"
"Videos"
"VMs"
".snapshots"
".cache/nix-index"
{ directory = ".ssh"; mode = "0700"; }
{ directory = ".gnupg"; mode = "0700"; }
];
files = [
".zsh_history"
".local/state/lazygit/state.yml"
];
};
};
}

View file

@ -0,0 +1,26 @@
{ config, ... }:
{
environment.persistence."/persist" = {
hideMounts = true;
users.jules = {
directories = [
"Keepers"
"Documents"
"Pictures"
"Videos"
"VMs"
".snapshots"
".cache/nix-index"
{ directory = ".ssh"; mode = "0700"; }
{ directory = ".gnupg"; mode = "0700"; }
];
files = [
".zsh_history"
".local/state/lazygit/state.yml"
];
};
};
}

View file

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

View file

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

View file

@ -0,0 +1,12 @@
{ config, lib, ... }:
{
services.snapper.configs.jules = lib.mkIf config.environment.persistence."/persist".enable {
SUBVOLUME = "/persist/home/jules";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1;
TIMELINE_LIMIT_WEEKLY = 1;
TIMELINE_LIMIT_MONTHLY = 0;
TIMELINE_LIMIT_YEARLY = 0;
};
}

View file

@ -1,9 +1,10 @@
{ config, ... }:
{ config, pkgs, ... }:
{
imports = [ ./wireless ];
networking = {
wireless.enable = false;
wireless = {
enable = false;
iwd.enable = true;
};
dhcpcd.enable = true;
nftables.enable = true;
firewall.allowPing = false;
@ -21,4 +22,9 @@
fallbackDns = config.networking.nameservers;
dnsovertls = "true";
};
environment = {
systemPackages = with pkgs; [ impala ];
persistence."/persist".directories = [ "/var/lib/iwd/" ];
};
}

View file

@ -0,0 +1,29 @@
{ config, lib, ... }:
{
options.secrets = lib.mkOption {
type = lib.types.attrs;
};
config.secrets = {
# User passwords, generated with 'mkpasswd -m sha-512'
jimboAccPass = "$6$gYpE.pG/zPXgin06$2kydjDfd0K62Dhf9P0PFvJhRNz6xIC/bHYaf/XYqyKcLyZNzPQpy8uy9tCRcSYlj1wwBhzVtTRyItwajOHCEj0";
# Initial password for apps that ask for it
initialPass = "changeme";
# Cloudflare API key
flareApiKey = "CLOUDFLARE_API_TOKEN=changeme";
# Matrix secrets
matrixSecret = "changeme";
coturnSecret = "changeme";
# Transmission credentials, plaintext
transmissionCredFile = ''
{
"rpc-username": "jimbo",
"rpc-password": "changeme"
}
'';
};
}

View file

@ -33,7 +33,5 @@
"virbr0"
"virbr1"
];
systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 - libvirtd -" ];
};
}

Some files were not shown because too many files have changed in this diff Show more