various reorgs

This commit is contained in:
John Lancaster
2026-04-20 23:52:03 -05:00
parent 443020df4d
commit cf90d3e876
9 changed files with 74 additions and 79 deletions
+4 -13
View File
@@ -1,29 +1,20 @@
# This module provides all the shell options # This module provides all the shell options
{ inputs, lib, ... }: { self, inputs, ... }: {
{
flake.modules.homeManager.shell-tools = { config, pkgs, ... }: { flake.modules.homeManager.shell-tools = { config, pkgs, ... }: {
options.shell.program = lib.mkOption {
type = lib.types.enum [ "bash" "zsh" ];
default = "zsh";
description = "Which interactive shell configuration to enable.";
};
imports = with inputs.self.modules.homeManager; [ imports = with inputs.self.modules.homeManager; [
bash # bash
zsh zsh
files files
]; ];
config = {
home.shell.enableShellIntegration = true;
programs.zsh.enable = lib.mkForce (config.shell.program == "zsh");
home.packages = with pkgs; [ home.packages = with pkgs; [
btop btop
uv uv
xclip xclip
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
]; ];
};
home.shell.enableShellIntegration = true;
}; };
perSystem = { system, pkgs, self', ... }: { perSystem = { system, pkgs, self', ... }: {
+5 -7
View File
@@ -44,15 +44,13 @@ in
# selfPkgs.step-bootstrap # selfPkgs.step-bootstrap
# selfPkgs.wg-platform # selfPkgs.wg-platform
# self'.packages.myWrappedPackage # self'.packages.myWrappedPackage
# (inputs.self.wrappers.test-push.apply { (inputs.self.wrappers.test-push.apply {
# inherit pkgs flakeDir; inherit pkgs flakeDir;
# host = testHost; host = testHost;
# target = testTarget; target = testTarget;
# }).wrapper }).wrapper
]; ];
shell.program = "zsh";
homeManagerFlakeDir = flakeDir; homeManagerFlakeDir = flakeDir;
docker.enable = true; docker.enable = true;
+18 -21
View File
@@ -1,4 +1,4 @@
{ self, inputs, lib, ... }: { withSystem, self, inputs, lib, ... }:
let let
username = "john"; username = "john";
hostname = "soteria"; hostname = "soteria";
@@ -84,14 +84,10 @@ in
sops.defaultSopsFile = ./secrets.yaml; sops.defaultSopsFile = ./secrets.yaml;
programs.zsh.enable = true; programs.zsh.enable = true;
home-manager.users."${username}" = {
imports = with inputs.self.modules; [ home-manager.users."${username}".imports = [ inputs.self.modules.homeManager.soteria ];
homeManager."${hostname}"
];
};
environment.systemPackages = [ environment.systemPackages = [
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.janus-ca
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh
]; ];
@@ -99,25 +95,26 @@ in
]; ];
}; };
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }: { flake.modules.homeManager.soteria = { config, pkgs, lib, ... }: {
imports = with inputs.self.modules; [ imports = [
homeManager.rebuild inputs.self.modules.homeManager.rebuild
homeManager.mysops inputs.self.modules.homeManager.mysops
]; ({ config, pkgs, lib, ... }: {
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager"; homeManagerFlakeDir = "${config.xdg.configHome}/home-manager";
shell.program = "zsh";
docker.enable = true; docker.enable = true;
# This will provide the edit-secrets script targeting this file # This will provide the edit-secrets script targeting this file
mysops.hostSecretFile = "${config.homeManagerFlakeDir}/modules/hosts/soteria/secrets.yaml"; mysops.hostSecretFile = "${config.homeManagerFlakeDir}/modules/hosts/soteria/secrets.yaml";
}; })
flake.homeConfigurations."${hostname}" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = with inputs.self.modules; [
homeManager."${username}"
homeManager."${hostname}"
]; ];
}; };
flake.homeConfigurations.soteria = withSystem "x86_64-linux" (ctx@{ config, inputs', ...}:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs'.nixpkgs.legacyPackages;
modules = [
inputs.self.modules.homeManager."${username}"
inputs.self.modules.homeManager.soteria
];
});
} }
+2 -1
View File
@@ -140,8 +140,9 @@
args = [ args = [
"home" "switch" "home" "switch"
"--configuration" "${config.configuration}" "--configuration" "${config.configuration}"
"$@"
"${config.flakeDir}" "${config.flakeDir}"
] ++ config.extraOptions ++ [ "$@" ]; ] ++ config.extraOptions;
}; };
}); });
} }
+3
View File
@@ -14,8 +14,11 @@
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
]; ];
users.groups."${username}" = {};
users.users."${username}" = { users.users."${username}" = {
isNormalUser = true; isNormalUser = true;
group = username;
home = "/home/${username}"; home = "/home/${username}";
shell = lib.mkIf config.programs.zsh.enable pkgs.zsh; shell = lib.mkIf config.programs.zsh.enable pkgs.zsh;
extraGroups = [ "input" "networkmanager" ] extraGroups = [ "input" "networkmanager" ]
+1 -2
View File
@@ -1,10 +1,9 @@
{ {
flake.modules.homeManager.bash = { pkgs, lib, config, ... }: flake.modules.homeManager.bash = { pkgs, lib, config, ... }:
{ {
programs.bash = lib.mkIf (config.shell.program == "bash") { programs.bash = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
package = pkgs.bash;
}; };
}; };
} }
+2 -1
View File
@@ -35,7 +35,7 @@ in
homeManager.zsh = { pkgs, config, ... }: { homeManager.zsh = { pkgs, config, ... }: {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
package = pkgs.zsh; package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh;
enableCompletion = true; enableCompletion = true;
autosuggestion.enable = true; autosuggestion.enable = true;
# syntaxHighlighting.enable = true; # syntaxHighlighting.enable = true;
@@ -157,6 +157,7 @@ in
format = "[$ssh_symbol$hostname]($style)"; format = "[$ssh_symbol$hostname]($style)";
style = "bg:red fg:crust"; style = "bg:red fg:crust";
}; };
os.symbols.NixOS = " ";
format = lib.replaceStrings ["\n"] [""] '' format = lib.replaceStrings ["\n"] [""] ''
[](red) [](red)
$os $os
+4
View File
@@ -197,6 +197,10 @@ in
"test-nix" = { "test-nix" = {
hostname = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; hostname = "fded:fb16:653e:25da:be24:11ff:fea0:753f";
user = "john"; user = "john";
extraOptions = {
RequestTTY = "force";
RemoteCommand = "/run/current-system/sw/bin/jsl-zsh";
};
}; };
}) })
]; ];
+19 -18
View File
@@ -1,6 +1,10 @@
{ self, inputs, lib, ... }: { self, inputs, lib, ... }:
let let
username = "john"; username = "john";
baseUserModules = self.factory.user {
username = username;
isAdmin = true;
};
in in
{ {
flake.meta.users."${username}" = { flake.meta.users."${username}" = {
@@ -8,23 +12,17 @@ in
name = "John Lancaster"; name = "John Lancaster";
inherit username; inherit username;
key = ""; key = "";
keygrip = [ keygrip = [ ];
];
authorizedKeys = [ authorizedKeys = [
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu" # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus"
]; ];
}; };
flake.modules = lib.mkMerge [ flake.modules = {
(self.factory.user { nixos."${username}" = { ... }: {
username = username;
isAdmin = true;
})
{
nixos."${username}" = {
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager baseUserModules.nixos."${username}"
]; ];
users.users."${username}" = { users.users."${username}" = {
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys; openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
@@ -32,17 +30,20 @@ in
}; };
# This module will be imported by the user factory # This module will be imported by the user factory
homeManager."${username}" = with inputs.self.meta.users."${username}"; { homeManager."${username}" = { pkgs, ... }:
with inputs.self.meta.users."${username}"; {
home.stateVersion = "25.11"; home.stateVersion = "25.11";
imports = [
inputs.self.modules.homeManager.shell-tools
inputs.self.modules.homeManager.ssh
inputs.self.modules.homeManager.git
];
# home.packages = [
# inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
# ];
xdg.enable = true; xdg.enable = true;
programs.git.settings.user.name = name; programs.git.settings.user.name = name;
programs.git.settings.user.email = email; programs.git.settings.user.email = email;
imports = with inputs.self.modules.homeManager; [
ssh
shell-tools
git
];
}; };
} };
];
} }