Compare commits

...

10 Commits

Author SHA1 Message Date
John Lancaster
dac3b84ffb space optimization 2026-03-11 01:11:11 -05:00
John Lancaster
a26814ea6a flakeDir 2026-03-11 01:09:29 -05:00
John Lancaster
69b0388dbd added nix-ld 2026-03-11 00:56:26 -05:00
John Lancaster
ed8b9cf439 formatting 2026-03-11 00:56:16 -05:00
John Lancaster
95b35a509a added hostname to script 2026-03-11 00:44:23 -05:00
John Lancaster
7f8a8e0f49 started break out of zsh 2026-03-11 00:43:41 -05:00
John Lancaster
9bd2bb1a0f streamlined janus config 2026-03-11 00:27:46 -05:00
John Lancaster
ed5cecd24d import fixes 2026-03-11 00:22:14 -05:00
John Lancaster
ce55bbc194 moved rebuild 2026-03-10 23:39:23 -05:00
John Lancaster
0af3e51ebf import fixes 2026-03-10 23:28:05 -05:00
11 changed files with 131 additions and 134 deletions

View File

@@ -3,7 +3,6 @@
flake.modules.homeManager.base = { pkgs, ... }: flake.modules.homeManager.base = { pkgs, ... }:
{ {
imports = with inputs.self.modules.homeManager; [ imports = with inputs.self.modules.homeManager; [
rebuild
git git
shell-tools shell-tools
]; ];

View File

@@ -10,7 +10,7 @@
imports = with inputs.self.modules.homeManager; [ imports = with inputs.self.modules.homeManager; [
bash bash
zsh # zsh
# Tools # Tools
eza eza

View File

@@ -1,39 +1,53 @@
{ inputs, ... }:
let
username = "john";
in
{ {
flake.modules.homeManager.zsh = { pkgs, config, ... }: flake.modules = {
{ nixos.zsh = { pkgs, ... }: {
programs.zsh = { users.users."${username}".shell = pkgs.zsh;
enable = true; programs.zsh.enable = true;
package = pkgs.zsh; home-manager.sharedModules = [
enableCompletion = true; inputs.self.modules.homeManager.zsh
autosuggestion.enable = true; ];
# syntaxHighlighting.enable = true; };
initContent = "HOST=$(hostname -s)";
dotDir = "${config.xdg.configHome}/zsh"; homeManager.zsh = { pkgs, config, ... }: {
history = { programs.zsh = {
append = true;
ignoreAllDups = true;
ignorePatterns = [
"history"
"ls"
"eza"
"clear"
];
save = 1000;
size = 1000;
share = true;
};
oh-my-zsh = {
enable = true; enable = true;
# theme = "risto"; package = pkgs.zsh;
theme = "agnoster"; enableCompletion = true;
plugins = [ autosuggestion.enable = true;
"sudo" # syntaxHighlighting.enable = true;
"dotenv" initContent = "HOST=$(hostname -s)";
"git" dotDir = "${config.xdg.configHome}/zsh";
"ssh" history = {
"ssh-agent" append = true;
]; ignoreAllDups = true;
ignorePatterns = [
"history"
"ls"
"eza"
"clear"
];
save = 1000;
size = 1000;
share = true;
};
oh-my-zsh = {
enable = true;
# theme = "risto";
theme = "agnoster";
plugins = [
"sudo"
"dotenv"
"git"
"ssh"
"ssh-agent"
];
};
}; };
}; };
}; };
} }

View File

@@ -4,28 +4,24 @@ let
username ="john"; username ="john";
in in
{ {
flake.modules.nixos."${hostname}" = { pkgs, ... }: { flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
imports = [ modules = [
inputs.self.modules.nixos.lxc inputs.self.modules.nixos.lxc
inputs.self.modules.nixos.zsh
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.self.modules.nixos."${username}" inputs.self.modules.nixos."${username}"
# inputs.self.modules.nixos.step-ca # inputs.self.modules.nixos.step-ca
inputs.self.modules.nixos.docker inputs.self.modules.nixos.docker
]; {
home-manager.users."${username}" = { home-manager.users."${username}" = {
imports = with inputs.self.modules.homeManager; [ shell.program = "zsh";
]; docker.enable = true;
docker.enable = true; ssh.matchSets = {
ssh.matchSets = { certs = true;
certs = true; homelab = true;
homelab = true; };
}; };
}; }
};
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.self.modules.nixos."${hostname}"
]; ];
}; };
} }

View File

@@ -1,7 +1,16 @@
{ inputs, ... }: { inputs, ... }:
let
hostname = "john-pc-ubuntu";
in
{ {
flake.modules.homeManager."john-pc-ubuntu" = { pkgs, config, ... }: { flake.modules.homeManager."${hostname}" = { pkgs, config, ... }:
let
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
in
{
imports = with inputs.self.modules.homeManager; [ imports = with inputs.self.modules.homeManager; [
rebuild
zsh
john john
desktop desktop
docker docker
@@ -13,59 +22,54 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
nixos-rebuild nixos-rebuild
(writeShellScriptBin "test-push" '' (writeShellScriptBin "test-push" ''
FLAKE_DIR="${config.xdg.configHome}/home-manager/jsl-dendritic" nixos-rebuild switch --flake ${flakeDir}#janus --target-host root@fded:fb16:653e:25da:be24:11ff:fea0:753f
nixos-rebuild switch --flake $FLAKE_DIR#janus --target-host root@fded:fb16:653e:25da:be24:11ff:fea0:753f
'') '')
]; ];
# TODO: Add host-specific settings here: # TODO: Add host-specific settings here:
# - sops secret for `restic_password/john_ubuntu` # - sops secret for `restic_password/john_ubuntu`
# - resticprofile profile definition # - resticprofile profile definition
# - zsh RESTIC* session variables # - zsh RESTIC* session variables
};
flake.homeConfigurations."john-pc-ubuntu" = inputs.home-manager.lib.homeManagerConfiguration { # TODO: make this more restrictive, rather than allowing all unfree packages
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; nixpkgs.config.allowUnfree = true;
modules = [ nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
inputs.self.modules.homeManager."john-pc-ubuntu"
# Include another inline module to set the options created through the jsl-home modules homeManagerFlakeDir = flakeDir;
({ config, ... }: { docker.enable = true;
ssh.matchSets = {
# TODO: make this more restrictive, rather than allowing all unfree packages certs = true;
nixpkgs.config.allowUnfree = true; appdaemon = true;
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ]; homelab = true;
dev = true;
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic"; };
docker.enable = true; shell.program = "zsh";
ssh.matchSets = { sops.secrets."restic_password/john_ubuntu" = {
certs = true; path = "${config.xdg.configHome}/resticprofile/password.txt";
appdaemon = true; };
homelab = true; programs.resticprofile = {
dev = true; enable= true;
}; profiles = {
shell.program = "zsh"; default = {
sops.secrets."restic_password/john_ubuntu" = { "inherit" = "base";
path = "${config.xdg.configHome}/resticprofile/password.txt"; repository = "rest:https://soteria.john-stream.com/john-ubuntu";
}; cacert = "${config.home.homeDirectory}/.step/certs/root_ca.crt";
programs.resticprofile = { tls-client-cert = "${config.home.homeDirectory}/.step/certs/mtls.pem";
enable= true; backup = {
profiles = { source = [
default = { "${config.xdg.userDirs.documents}"
"inherit" = "base"; "/conf"
repository = "rest:https://soteria.john-stream.com/john-ubuntu"; ];
cacert = "${config.home.homeDirectory}/.step/certs/root_ca.crt"; schedule = "*-*-* *:15,30,45:00";
tls-client-cert = "${config.home.homeDirectory}/.step/certs/mtls.pem";
backup = {
source = [
"${config.xdg.userDirs.documents}"
"/conf"
];
schedule = "*-*-* *:15,30,45:00";
};
};
}; };
}; };
}) };
};
};
flake.homeConfigurations."${hostname}" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = with inputs.self.modules; [
homeManager."${hostname}"
]; ];
}; };
} }

View File

@@ -31,7 +31,8 @@
${nixBin} flake check ${nixBin} flake check
'') '')
(writeShellScriptBin "nhms" '' (writeShellScriptBin "nhms" ''
${lib.getExe home-manager} switch --impure --flake ${flakeDir} HOSTNAME=$(hostname -s)
${lib.getExe home-manager} switch --impure --flake ${flakeDir}#$HOSTNAME
'') '')
(writeShellScriptBin "nhmu" '' (writeShellScriptBin "nhmu" ''
${nixBin} flake update --flake ${flakeDir} ${nixBin} flake update --flake ${flakeDir}

View File

@@ -3,7 +3,6 @@
{ self, ... }: { self, ... }:
{ {
config.flake.factory.user = username: isAdmin: { config.flake.factory.user = username: isAdmin: {
nixos."${username}" = { lib, pkgs, ... }: { nixos."${username}" = { lib, pkgs, ... }: {
users.users."${username}" = { users.users."${username}" = {
isNormalUser = true; isNormalUser = true;
@@ -25,6 +24,10 @@
homeManager."${username}" = { homeManager."${username}" = {
home.username = "${username}"; home.username = "${username}";
home.homeDirectory = "/home/${username}";
imports = with self.modules.homeManager; [
base
];
}; };
}; };
} }

View File

@@ -11,6 +11,13 @@
environment.systemPackages = with pkgs; [ git zsh ]; environment.systemPackages = with pkgs; [ git zsh ];
security.sudo-rs.enable = true; security.sudo-rs.enable = true;
programs.nix-ld.enable = true;
nix.optimise.automatic = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
}; };
# Generic bootstrapping lxc, use a specific host file for more # Generic bootstrapping lxc, use a specific host file for more

View File

@@ -4,12 +4,9 @@
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
}; };
home-manager.sharedModules = [ home-manager.sharedModules = with inputs.self.modules.homeManager; [
inputs.self.modules.homeManager.docker docker
]; ];
# users.users.john = {
# extraGroups = [ "docker" ];
# };
}; };
flake.modules.homeManager.docker = { config, lib, pkgs, ... }: flake.modules.homeManager.docker = { config, lib, pkgs, ... }:

View File

@@ -22,49 +22,25 @@ in
{ {
# https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect # https://github.com/Doc-Steve/dendritic-design-with-flake-parts/wiki/Dendritic_Aspects#multi-context-aspect
nixos."${username}" = { pkgs, ... }: { nixos."${username}" = { pkgs, ... }: {
home-manager.users."${username}" = {
imports = [
inputs.self.modules.homeManager."${username}"
];
};
users.users."${username}" = { users.users."${username}" = {
isNormalUser = true;
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys; openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
extraGroups = [ "docker" ]; extraGroups = [ "docker" ];
}; };
}; };
homeManager."${username}" = { # This gets imported by the user factory:
homeManager."${username}" = with inputs.self.meta.users."${username}"; {
home.stateVersion = "25.11"; home.stateVersion = "25.11";
xdg.enable = true; xdg.enable = true;
programs.git.settings.user.name = "John Lancaster"; programs.git.settings.user.name = name;
programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com"; programs.git.settings.user.email = email;
imports = with inputs.self.modules.homeManager; [ # imports = with inputs.self.modules.homeManager; [
# base # # base
# docker # ];
# resticprofile
];
}; };
} }
]; ];
}; };
# This is the base homeConfiguration for the john user that will be used if no other
flake.homeConfigurations."${username}" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = [
inputs.self.modules.homeManager."${username}"
# Include another inline module to set the options created through the jsl-home modules
{
docker.enable = false;
ssh.matchSets = {
certs = true;
homelab = true;
};
}
];
};
} }