commit 297473a7c2604c1fe715724b73fb18a0cf346bdb
parent 315175a98da25fb1736969988b2e374e1ce0a5dd
Author: breadcat <breadcat@users.noreply.github.com>
Date: Sat, 20 Dec 2025 15:02:52 +0000
Shuffle around variables and home-manager to common
Diffstat:
10 files changed, 149 insertions(+), 161 deletions(-)
diff --git a/common/dhcp.nix b/common/dhcp.nix
@@ -1,10 +0,0 @@
-{ lib, ... }:
-
-{
- networking = {
- networkmanager.enable = true;
- useDHCP = lib.mkDefault true;
- };
-}
-
-
diff --git a/common/home-manager.nix b/common/home-manager.nix
@@ -0,0 +1,17 @@
+{ machine, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver }:
+
+let
+ home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz";
+ all-variables = { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; };
+in
+
+{
+ imports = [ (import "${home-manager}/nixos") ];
+
+ home-manager = {
+ backupFileExtension = "hm-bak";
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ extraSpecialArgs = all-variables;
+ };
+}
diff --git a/common/networking.nix b/common/networking.nix
@@ -0,0 +1,11 @@
+{ lib, machine, ... }:
+
+{
+ networking = {
+ hostName = machine;
+ networkmanager.enable = true;
+ useDHCP = lib.mkDefault true;
+ };
+}
+
+
diff --git a/entrypoint.nix b/entrypoint.nix
@@ -5,7 +5,7 @@
...
}: let
vars = import ./variables.nix { inherit lib; };
- inherit (vars) fullname username domain email sshkey sshport timezone htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver;
+ inherit (vars) fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver;
hostname =
if builtins.pathExists "/etc/hostname"
@@ -16,6 +16,6 @@
osConfigPath = ./machines + "/${machine}.nix";
in {
imports = [
- (import osConfigPath { inherit config pkgs lib fullname username domain email sshkey sshport timezone htpasswd vpnusername vpnpassword todosecret privatekey machine matrixuser matrixserver ; })
+ (import osConfigPath { inherit config pkgs lib fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver ; })
];
}
\ No newline at end of file
diff --git a/machines/arcadia.nix b/machines/arcadia.nix
@@ -1,49 +1,40 @@
# HTPC
-{ config, pkgs, lib, domain, machine, username, fullname, sshkey, sshport, timezone, privatekey, ... }:
+{ config, pkgs, lib, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver, ... }:
-let
- home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz;
-in
+let machine = "arcadia"; in {
-{
-
- networking.hostName = "arcadia";
-
- imports =
- [
- (import "${home-manager}/nixos") # Home-Manager
- ../common/audio.nix
- (import ../common/autologin.nix {inherit username;})
- ../common/dhcp.nix
- ../common/flakes.nix
- ../common/fonts.nix
- ../common/garbage.nix
- (import ../common/emulators.nix {inherit pkgs;})
- (import ../common/hyprland.nix {inherit pkgs username;})
- (import ../common/kodi.nix {inherit pkgs username;})
- (import ../common/locale.nix {inherit config pkgs timezone;})
- ../common/mount-drives.nix
- ../common/nfs.nix
- ../common/packages.nix
- (import ../common/ssh.nix {inherit username sshkey sshport privatekey;})
- (import ../common/syncthing.nix {inherit config pkgs username;})
- (import ../common/user.nix {inherit config pkgs username fullname;})
- ../scripts/htpc-launcher.nix
+ imports = [
+ (import ../common/variables.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ (import ../common/home-manager.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ ../common/audio.nix
+ ../common/autologin.nix
+ ../common/dhcp.nix
+ ../common/emulators.nix
+ ../common/flakes.nix
+ ../common/fonts.nix
+ ../common/garbage.nix
+ ../common/hyprland.nix
+ ../common/kodi.nix
+ ../common/locale.nix
+ ../common/mount-drives.nix
+ ../common/nfs.nix
+ ../common/packages.nix
+ ../common/ssh.nix
+ ../common/syncthing.nix
+ ../common/user.nix
+ ../scripts/htpc-launcher.nix
];
- home-manager = {
- backupFileExtension = "hm-bak";
- users.${username} = { pkgs, ... }: {
- imports = [
+ home-manager.users.${username} = {pkgs, ...}: { imports = [
../home/alacritty.nix
- (import ../home/fish.nix {inherit pkgs domain;})
+ ../home/fish.nix
../home/hyprland.nix
- (import ../home/kodi.nix {inherit username;})
- (import ../home/rclone.nix {inherit domain username sshport privatekey;})
- (import ../home/ssh.nix {inherit domain username sshport privatekey;})
+ ../home/kodi.nix
+ ../home/rclone.nix
+ ../home/ssh.nix
+ ../home/yt-dlp.nix
];
home.stateVersion = "24.11";
- };
};
# Hardware and system
diff --git a/machines/artemis.nix b/machines/artemis.nix
@@ -1,20 +1,12 @@
# Server
-{ config, pkgs, lib, machine, username, email, fullname, domain, sshkey, sshport, timezone, htpasswd, todosecret, vpnusername, vpnpassword, privatekey, ... }:
+{ config, pkgs, lib, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver, ... }:
-let
- home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz;
-in
-
-{
-
- networking.hostName = "artemis";
+let machine = "artemis"; in {
imports = [
- (import "${home-manager}/nixos")
- (import ../scripts/blog-duolingo.nix {inherit pkgs domain username;})
- (import ../scripts/blog-status.nix {inherit pkgs domain;})
- (import ../common/docker.nix {inherit config pkgs username domain timezone htpasswd todosecret vpnusername vpnpassword;})
+ (import ../common/variables.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ (import ../common/home-manager.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
../common/dhcp.nix
../common/flakes.nix
../common/garbage.nix
diff --git a/machines/atlas.nix b/machines/atlas.nix
@@ -1,67 +1,64 @@
# Desktop
-{ config, pkgs, lib, machine, username, fullname, domain, email, sshkey, timezone, sshport, privatekey, matrixuser, matrixserver, ... }:
+{ config, pkgs, lib, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver, ... }:
-let
- home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz";
-in
-
-{
-
- networking.hostName = "atlas";
+let machine = "atlas"; in {
imports = [
- (import "${home-manager}/nixos")
+ (import ../common/variables.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ (import ../common/home-manager.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
../common/audio.nix
- (import ../common/autologin.nix {inherit username;})
- (import ../common/devel.nix {inherit pkgs;})
- ../common/dhcp.nix
+ ../common/autologin.nix
+ ../common/devel.nix
../common/flakes.nix
../common/fonts.nix
../common/garbage.nix
- (import ../common/hyprland.nix {inherit pkgs username;})
- (import ../common/locale.nix {inherit timezone;})
+ ../common/hyprland.nix
+ ../common/locale.nix
../common/mount-drives.nix
+ ../common/networking.nix
../common/nfs.nix
+ ../common/nur.nix
../common/packages-unfree.nix
../common/packages.nix
+ ../common/ssh.nix
../common/steam.nix
- (import ../common/ssh.nix {inherit username sshkey sshport;})
- (import ../common/syncthing.nix {inherit config pkgs username;})
- (import ../common/user.nix {inherit config pkgs username fullname;})
- (import ../common/ydotool.nix {inherit pkgs username;})
+ ../common/syncthing.nix
+ ../common/user.nix
+ ../common/ydotool.nix
+ ../common/zram.nix
../scripts/ctimerename.nix
../scripts/duupmove.nix
+ ../scripts/restic.nix
+ ../scripts/seedy.nix
+ ../scripts/vidyascape.nix
../scripts/xdb.nix
- (import ../scripts/vidyascape.nix {inherit pkgs;})
- (import ../scripts/restic.nix {inherit pkgs;})
];
- home-manager = {
- backupFileExtension = "hm-bak";
- users.${username} = {pkgs, ...}: {
- imports = [
+ home-manager.users.${username} = {pkgs, ...}: { imports = [
../home/alacritty.nix
+ ../home/clipse.nix
../home/cursor.nix
../home/espanso.nix
../home/firefox.nix
- (import ../home/fish.nix {inherit pkgs domain;})
- (import ../home/git.nix {inherit fullname email;})
+ ../home/fish.nix
+ ../home/git.nix
../home/htop.nix
- ../home/hyprland-numlock.nix
- ../home/hyprland.nix
../home/hypridle.nix
- (import ../home/iamb.nix {inherit matrixuser matrixserver;})
+ ../home/hyprland.nix
+ ../home/hyprland-numlock.nix
+ ../home/iamb.nix
../home/lf.nix
../home/mpv.nix
../home/neovim.nix
- (import ../home/newsboat.nix {inherit pkgs domain username;})
- (import ../home/rbw.nix {inherit pkgs domain email;})
- (import ../home/ssh.nix {inherit domain username sshport privatekey;})
+ ../home/newsboat.nix
+ ../home/rbw.nix
+ ../home/rclone.nix
+ ../home/ssh.nix
../home/tofi.nix
+ ../home/yt-dlp.nix
];
home.stateVersion = "24.11";
};
- };
# Hardware and system
boot = {
diff --git a/machines/ilias.nix b/machines/ilias.nix
@@ -1,63 +1,57 @@
# NAS
-{ config, pkgs, lib, machine, username, email, fullname, domain, sshkey, sshport, timezone, privatekey, ... }:
+{ config, pkgs, lib, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver, ... }:
-let
- home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz;
-in
-
-{
-
- networking.hostName = "ilias";
+let machine = "ilias"; in {
imports = [
- (import "${home-manager}/nixos")
- ../common/dhcp.nix
+ (import ../common/variables.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ (import ../common/home-manager.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ ../common/devel.nix
../common/flakes.nix
../common/garbage.nix
- (import ../common/devel.nix {inherit pkgs;})
- (import ../common/locale.nix {inherit pkgs timezone;})
+ ../common/locale.nix
../common/mount-drives.nix
+ ../common/networking.nix
../common/nfs-server.nix
../common/packages.nix
- (import ../scripts/restic.nix {inherit pkgs;})
- (import ../common/ssh-tunnel.nix {inherit config pkgs username domain sshport privatekey;})
- (import ../common/ssh.nix {inherit username sshkey sshport;})
- (import ../common/syncthing.nix {inherit config pkgs username;})
- (import ../scripts/tank-log.nix {inherit pkgs username;})
- (import ../scripts/tank-sort.nix {inherit pkgs username;})
- (import ../common/user.nix {inherit config pkgs username fullname;})
- (import ../scripts/audiobook-cleaner.nix {inherit pkgs domain;})
+ ../common/ssh.nix
+ ../common/ssh-tunnel.nix
+ ../common/syncthing.nix
+ ../common/user.nix
+ ../common/zram.nix
+ ../scripts/audiobook-cleaner.nix
../scripts/backup-local.nix
- (import ../scripts/blog-music.nix {inherit pkgs domain;})
- (import ../scripts/blog-sort-archives.nix {inherit pkgs domain;})
- (import ../scripts/blog-sort-languages.nix {inherit pkgs domain;})
- (import ../scripts/blog-sort-quotes.nix {inherit pkgs domain;})
- (import ../scripts/blog-weight.nix {inherit pkgs domain;})
+ ../scripts/blog-music.nix
+ ../scripts/blog-sort-archives.nix
+ ../scripts/blog-sort-languages.nix
+ ../scripts/blog-sort-quotes.nix
+ ../scripts/blog-weight.nix
../scripts/ctimerename.nix
../scripts/duupmove.nix
- (import ../scripts/overtid.nix {inherit pkgs;})
+ ../scripts/overtid.nix
../scripts/payslips.nix
../scripts/phone-dump.nix
+ ../scripts/restic.nix
../scripts/seedy.nix
../scripts/startpage-sort.nix
+ ../scripts/tank-log.nix
+ ../scripts/tank-sort.nix
../scripts/watchedlist.nix
+ ../scripts/xdb.nix
../scripts/youtube-id-rss.nix
];
- home-manager = {
- backupFileExtension = "hm-bak";
- users.${username} = {pkgs, ...}: {
- imports = [
- (import ../home/fish.nix {inherit pkgs domain;})
- (import ../home/git.nix {inherit fullname email;})
+ home-manager.users.${username} = {pkgs, ...}: { imports = [
+ ../home/fish.nix
+ ../home/git.nix
../home/htop.nix
../home/neovim.nix
- (import ../home/rbw.nix {inherit pkgs domain email;})
- (import ../home/rclone.nix {inherit domain username sshport privatekey;})
- (import ../home/ssh.nix {inherit domain username sshport privatekey;})
+ ../home/rbw.nix
+ ../home/rclone.nix
+ ../home/ssh.nix
+ ../home/yt-dlp.nix
];
home.stateVersion = "24.11";
- };
};
# Hardware and system
diff --git a/machines/minerva.nix b/machines/minerva.nix
@@ -1,63 +1,57 @@
# Laptop
-{ config, pkgs, lib, machine, username, fullname, domain, email, sshkey, timezone, sshport, privatekey, ... }:
+{ config, pkgs, lib, fullname, username, domain, email, sshkey, sshport, timezone, postcode, address, htpasswd, vpnusername, vpnpassword, todosecret, privatekey, matrixuser, matrixserver, ... }:
-let
- home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz;
-in
-
-{
-
- networking.hostName = "minerva";
+let machine = "minerva"; in {
imports = [
- (import "${home-manager}/nixos")
+ (import ../common/variables.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
+ (import ../common/home-manager.nix { inherit machine fullname username domain email sshkey sshport timezone postcode address htpasswd vpnusername vpnpassword todosecret privatekey matrixuser matrixserver; })
../common/audio.nix
- (import ../common/autologin.nix {inherit username;})
- (import ../common/devel.nix {inherit pkgs;})
+ ../common/autologin.nix
+ ../common/devel.nix
../common/dhcp.nix
../common/flakes.nix
../common/fonts.nix
- ../common/fonts.nix
../common/garbage.nix
- (import ../common/hyprland.nix {inherit pkgs username;})
- (import ../common/locale.nix {inherit timezone;})
+ ../common/hyprland.nix
+ ../common/locale.nix
../common/mount-drives.nix
../common/nfs.nix
+ ../common/nur.nix
../common/packages.nix
- (import ../common/ssh.nix {inherit username sshkey sshport;})
- (import ../common/syncthing.nix {inherit config pkgs username;})
- (import ../common/user.nix {inherit config pkgs username fullname;})
- (import ../common/ydotool.nix {inherit pkgs username;})
../common/packages-unfree.nix
+ ../common/ssh.nix
+ ../common/syncthing.nix
+ ../common/user.nix
+ ../common/ydotool.nix
../scripts/ctimerename.nix
../scripts/duupmove.nix
- (import ../scripts/vidyascape.nix {inherit pkgs;})
- (import ../scripts/restic.nix {inherit pkgs;})
+ ../scripts/restic.nix
+ ../scripts/vidyascape.nix
+ ../scripts/xdb.nix
];
- home-manager = {
- backupFileExtension = "hm-bak";
- users.${username} = {pkgs, ...}: {
- imports = [
+ home-manager.users.${username} = {pkgs, ...}: { imports = [
../home/alacritty.nix
+ ../home/clipse.nix
../home/cursor.nix
../home/espanso.nix
../home/firefox.nix
- (import ../home/fish.nix {inherit pkgs domain;})
- (import ../home/git.nix {inherit fullname email;})
+ ../home/fish.nix
+ ../home/git.nix
../home/htop.nix
../home/hyprland.nix
- (import ../home/iamb.nix {inherit matrixuser matrixserver;})
+ ../home/iamb.nix
../home/lf.nix
../home/mpv.nix
../home/neovim.nix
- (import ../home/newsboat.nix {inherit pkgs domain username;})
- (import ../home/rbw.nix {inherit pkgs domain email;})
- (import ../home/ssh.nix {inherit domain username sshport privatekey;})
+ ../home/newsboat.nix
+ ../home/rbw.nix
+ ../home/ssh.nix
../home/tofi.nix
+ ../home/yt-dlp.nix
];
home.stateVersion = "24.11";
- };
};
# Hardware and system
diff --git a/variables.sample.nix b/variables.sample.nix
@@ -8,6 +8,8 @@ let
sshkey = "ssh-rsa yourpubkeyhere";
sshport = 2222;
timezone = "Europe/London";
+ postcode = "AA1 1AA"
+ address = "123 Fake Street\n${postcode}";
htpasswd = ""; # caddy hash-password --plaintext "yourpassword" | base64 -w0
vpnusername = "";
vpnpassword = "";