working home manager switch without --impure

This commit is contained in:
John Lancaster
2026-03-08 12:31:03 -05:00
parent c45a48039e
commit e25f7420ff
9 changed files with 109 additions and 92 deletions

View File

@@ -1,5 +1,5 @@
{
flake.homeModules.bash = { pkgs, lib, ... }:
flake.homeModules.bash = { pkgs, ... }:
{
programs.bash = {
enable = true;

View File

@@ -0,0 +1,14 @@
{ inputs, pkgs, lib, ... }:
{
flake.homeModules.eza = { pkgs, lib, ... }: {
programs.eza = {
enable = true;
package = pkgs.eza;
enableBashIntegration = true;
enableZshIntegration = true;
};
home.shellAliases = {
ls = "${lib.getExe pkgs.eza} -lgos type --no-time --follow-symlinks";
};
};
}

View File

@@ -8,6 +8,7 @@
home.packages = with pkgs; [
gdu
# TODO: find a CLI file editor that's not insane
];
};
}

View File

@@ -1,25 +1,11 @@
# This module is for programs with GUIs that run in a desktop environment
{ inputs, ... }:
{
flake.homeModules.desktop =
{ pkgs, ... } :
{
xdg.enable = true;
imports = with inputs.self.homeModules; [
rebuild
john
ssh
git
shell
onepassword
ghostty
sops
];
};
flake.homeConfigurations.desktop = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = with inputs.self.homeModules; [
desktop
];
};
}

View File

@@ -0,0 +1,23 @@
{ inputs, ... }:
{
flake.homeModules.shell-tools = { pkgs, ... }: {
imports = with inputs.self.homeModules; [
shell # Includes option to select between zsh and bash
# Tools
eza
files
];
home.packages = with pkgs; [
wget
curl
cacert
busybox
gnugrep
dig
btop
uv
xclip
];
};
}

View File

@@ -1,42 +1,19 @@
{ inputs, ... }:
{ inputs, lib, ... }:
{
flake.homeModules.shell = {pkgs, lib, ...}:
flake.homeModules.shell = { config, ... }:
{
imports = with inputs.self.homeModules; [
# Shells
# bash
zsh
# Tools
shell-tools
files
docker
];
programs.eza = {
enable = true;
package = pkgs.eza;
enableBashIntegration = true;
enableZshIntegration = true;
options.shell.program = lib.mkOption {
type = lib.types.enum [ "bash" "zsh" ];
default = "zsh";
description = "Which interactive shell configuration to enable.";
};
imports = with inputs.self.homeModules; [ bash zsh ];
config = {
programs.bash.enable = lib.mkForce (config.shell.program == "bash");
programs.zsh.enable = lib.mkForce (config.shell.program == "zsh");
home.shell.enableShellIntegration = true;
home.shellAliases = {
ls = "${lib.getExe pkgs.eza} -lgos type --no-time --follow-symlinks";
};
};
flake.homeModules.shell-tools = {pkgs, ...}: {
home.packages = with pkgs; [
wget
curl
cacert
busybox
gnugrep
dig
btop
uv
xclip
];
};
}

View File

@@ -1,10 +1,43 @@
{ inputs, ... }:
{
flake.homeModules.users.john = {
flake.homeModules.john = {
home.username = "john";
home.homeDirectory = "/home/john";
home.stateVersion = "25.11";
xdg.enable = true;
programs.git.settings.user.name = "John Lancaster";
programs.git.settings.user.email = "32917998+jsl12@users.noreply.github.com";
imports = with inputs.self.homeModules; [
rebuild
sops
git
ssh
shell-tools
home # placeholder
docker
sublime
desktop
# resticprofile
];
};
flake.homeConfigurations.john = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = [
inputs.self.homeModules.john
# Include another inline module to set the options created through the jsl-home modules
{
homeManagerFlakeDir = "~/.config/home-manager";
docker.enable = true;
ssh.matchSets = {
certs = true;
appdaemon = true;
homelab = true;
};
}
];
};
}

View File

@@ -0,0 +1,22 @@
{ inputs, ... }:
let
userName = "john";
in
{
flake.modules.nixos.user =
{ pkgs, ... }:
{
users.users."${userName}" = {
name = "${userName}";
shell = pkgs.zsh;
};
programs.zsh.enable = true;
home-manager.users."${userName}" = {
imports = [
inputs.self.homeModules."${userName}"
];
};
};
}

View File

@@ -1,39 +0,0 @@
{ inputs, ... }:
let
userName = "john";
in
{
flake.modules.nixos.user =
{ pkgs, ... }:
{
users.users."${userName}" = {
name = "${userName}";
shell = pkgs.zsh;
};
programs.zsh.enable = true;
home-manager.users."${userName}" = {
imports = [
inputs.self.homeModules."${userName}"
];
};
};
flake.homeConfigurations.${userName} = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
modules = [
inputs.self.homeModules.users."${userName}"
# Include another inline module to set the options created through the jsl-home modules
{
homeManagerFlakeDir = "~/.config/home-manager";
docker.enable = true;
ssh.matchSets = {
certs = true;
appdaemon = true;
homelab = true;
};
}
];
};
}