Compare commits
10 Commits
f6d9ba27f0
...
dac3b84ffb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dac3b84ffb | ||
|
|
a26814ea6a | ||
|
|
69b0388dbd | ||
|
|
ed8b9cf439 | ||
|
|
95b35a509a | ||
|
|
7f8a8e0f49 | ||
|
|
9bd2bb1a0f | ||
|
|
ed5cecd24d | ||
|
|
ce55bbc194 | ||
|
|
0af3e51ebf |
@@ -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
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
bash
|
bash
|
||||||
zsh
|
# zsh
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
eza
|
eza
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
let
|
||||||
|
username = "john";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
flake.modules.homeManager.zsh = { pkgs, config, ... }:
|
flake.modules = {
|
||||||
{
|
nixos.zsh = { pkgs, ... }: {
|
||||||
|
users.users."${username}".shell = pkgs.zsh;
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
inputs.self.modules.homeManager.zsh
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
homeManager.zsh = { pkgs, config, ... }: {
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.zsh;
|
package = pkgs.zsh;
|
||||||
@@ -36,4 +48,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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}"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
|
let
|
||||||
|
hostname = "john-pc-ubuntu";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.modules.homeManager."${hostname}" = { pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
flake.modules.homeManager."john-pc-ubuntu" = { pkgs, config, ... }: {
|
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
|
rebuild
|
||||||
|
zsh
|
||||||
john
|
john
|
||||||
desktop
|
desktop
|
||||||
docker
|
docker
|
||||||
@@ -13,29 +22,19 @@
|
|||||||
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 {
|
|
||||||
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
|
|
||||||
modules = [
|
|
||||||
inputs.self.modules.homeManager."john-pc-ubuntu"
|
|
||||||
|
|
||||||
# Include another inline module to set the options created through the jsl-home modules
|
|
||||||
({ config, ... }: {
|
|
||||||
|
|
||||||
# TODO: make this more restrictive, rather than allowing all unfree packages
|
# TODO: make this more restrictive, rather than allowing all unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||||
|
|
||||||
homeManagerFlakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
homeManagerFlakeDir = flakeDir;
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
ssh.matchSets = {
|
ssh.matchSets = {
|
||||||
certs = true;
|
certs = true;
|
||||||
@@ -65,7 +64,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
};
|
||||||
|
|
||||||
|
flake.homeConfigurations."${hostname}" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
|
||||||
|
modules = with inputs.self.modules; [
|
||||||
|
homeManager."${hostname}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}
|
||||||
@@ -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
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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, ... }:
|
||||||
|
|||||||
@@ -22,47 +22,23 @@ 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;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user