various reorgs
This commit is contained in:
@@ -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.packages = with pkgs; [
|
||||||
home.shell.enableShellIntegration = true;
|
btop
|
||||||
programs.zsh.enable = lib.mkForce (config.shell.program == "zsh");
|
uv
|
||||||
home.packages = with pkgs; [
|
xclip
|
||||||
btop
|
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
||||||
uv
|
];
|
||||||
xclip
|
|
||||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.shell-tools
|
home.shell.enableShellIntegration = true;
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = { system, pkgs, self', ... }: {
|
perSystem = { system, pkgs, self', ... }: {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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";
|
||||||
|
docker.enable = true;
|
||||||
|
|
||||||
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager";
|
# This will provide the edit-secrets script targeting this file
|
||||||
shell.program = "zsh";
|
mysops.hostSecretFile = "${config.homeManagerFlakeDir}/modules/hosts/soteria/secrets.yaml";
|
||||||
docker.enable = true;
|
})
|
||||||
|
|
||||||
# This will provide the edit-secrets script targeting this file
|
|
||||||
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
|
||||||
|
];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -140,8 +140,9 @@
|
|||||||
args = [
|
args = [
|
||||||
"home" "switch"
|
"home" "switch"
|
||||||
"--configuration" "${config.configuration}"
|
"--configuration" "${config.configuration}"
|
||||||
|
"$@"
|
||||||
"${config.flakeDir}"
|
"${config.flakeDir}"
|
||||||
] ++ config.extraOptions ++ [ "$@" ];
|
] ++ config.extraOptions;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,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;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
+25
-24
@@ -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,41 +12,38 @@ 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;
|
imports = [
|
||||||
isAdmin = true;
|
baseUserModules.nixos."${username}"
|
||||||
})
|
];
|
||||||
{
|
users.users."${username}" = {
|
||||||
nixos."${username}" = {
|
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
users.users."${username}" = {
|
|
||||||
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# 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
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user