restructure

This commit is contained in:
2026-04-22 13:27:21 -05:00
parent 06385f94f6
commit e950b4c162
34 changed files with 112 additions and 253 deletions

View File

@@ -13,7 +13,7 @@
channel.enable = false;
settings = {
experimental-features = [ "nix-command" "flakes" ];
builders-use-substitutes = lib.mkIf true;
builders-use-substitutes = (config.sops.secrets ? "remoteBuildKey");
substituters = lib.mkIf config.programs.hyprland.enable ["https://hyprland.cachix.org"];
trusted-substituters = lib.mkIf config.programs.hyprland.enable ["https://hyprland.cachix.org"];

View File

@@ -113,29 +113,6 @@
};
};*/
programs.fuse.userAllowOther = true;
home-manager = {
backupFileExtension = "backup";
extraSpecialArgs = {inherit inputs;};
users = {
"nathan" = lib.mkMerge [
inputs.nathan-home-manager
{
config.homeconfig = {
minimal = false;
hyprland.enable = false;
wal.enable = false;
mpd.enable = true;
calcurse.enable = true;
rofi.enable = true;
firefox.enable = true;
};
}
];
};
};
fonts.packages = with pkgs; [ nerd-fonts.fira-code ];
};

View File

@@ -32,6 +32,9 @@
nixpkgs.config.allowUnfree = true;
networking = {
hostName = "homebox";
nameservers = lib.mkDefault [ "1.1.1.1" "1.0.0.1" ];
networkmanager = {
enable = true;

View File

@@ -2,9 +2,10 @@
flake.nixosConfigurations."homebox" = inputs.nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.homebox
self.nixosModules.homebox-hardware
modules = with self.nixosModules; [
(user-nathan "laptop")
homebox
homebox-hardware
self.diskoConfigurations.homebox
];
};

View File

@@ -7,6 +7,7 @@
imports = with self.nixosModules; [
inputs.home-manager.nixosModules.default
self.nixosModules.default
self.nixosModules.default
aurora-greeter
hyprland
@@ -71,6 +72,9 @@
programs.zsh.enable = true;
networking = {
hostName = "laptop";
nameservers = [
"1.1.1.1"
"1.0.0.1"

View File

@@ -2,9 +2,10 @@
flake.nixosConfigurations."laptop" = inputs.nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.laptop
self.nixosModules.laptop-hardware
modules = with self.nixosModules; [
user-nathan
laptop
laptop-hardware
];
};

View File

@@ -6,71 +6,29 @@
inputs.sops-nix.homeManagerModules.sops
];
options.homeconfig = with lib; {
name = mkOption {
type = with types; nullOr str;
default = null;
};
graphical = mkOption {
type = with types; bool;
default = true;
};
standalone = mkOption {
type = with types; bool;
default = false;
};
virtual-machines = mkOption {
type = with types; bool;
default = false;
};
};
config = {
homeconfig = {
name = "nathan";
mpd.enable = lib.mkDefault true;
calcurse.enable = lib.mkDefault true;
git.enable = lib.mkDefault true;
nh.enable = lib.mkDefault true;
minimal = lib.mkDefault false;
hyprland.enable = lib.mkDefault config.homeconfig.graphical;
hypridle.enable = lib.mkDefault config.homeconfig.hyprland.enable;
wal.enable = lib.mkDefault config.homeconfig.graphical;
rofi.enable = lib.mkDefault config.homeconfig.hyprland.enable;
firefox.enable = lib.mkDefault config.homeconfig.graphical;
aurora.enable = lib.mkDefault config.homeconfig.hyprland.enable;
};
home.username = lib.mkDefault config.homeconfig.name;
home.username = "nathan";
home.homeDirectory = lib.mkDefault "/home/${config.home.username}";
home.stateVersion = "23.11";
home.pointerCursor = lib.mkIf config.homeconfig.graphical {
home.pointerCursor = {
gtk.enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 16;
};
dconf.settings = lib.mkIf config.homeconfig.virtual-machines {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
gtk = lib.mkIf (config.homeconfig.graphical && config.homeconfig.hyprland.enable) {
gtk = {
enable = true;
theme.name = "Tokyonight-Dark";
theme.package = pkgs.tokyonight-gtk-theme;
@@ -108,7 +66,7 @@
};
};
home.packages = lib.mkIf (!config.homeconfig.wal.enable) [
home.packages = lib.mkIf (!(builtins.any (x: x == pkgs.pywal16) config.home.packages)) [
inputs.nixvim.packages.${pkgs.stdenv.hostPlatform.system}.default
];

View File

@@ -1,12 +1,12 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
home.file = {
".config/hypr" = lib.mkIf config.homeconfig.hyprland.enable { source = ./hypr; recursive = true; };
".config/wal/templates" = lib.mkIf config.homeconfig.wal.enable { source = ./wal/templates; recursive = true; };
".config/hypr" = lib.mkIf config.wayland.windowManager.hyprland.enable { source = ./hypr; recursive = true; };
".config/wal/templates" = lib.mkIf (builtins.any (x: x == pkgs.pywal16) config.home.packages) { source = ./wal/templates; recursive = true; };
".config/ohmyposh" = { source = ./ohmyposh; recursive = true; };
"Pictures/Wallpaper" = lib.mkIf config.homeconfig.graphical { source = ./Wallpaper; recursive = true; };
"Pictures/Wallpaper" = lib.mkIf config.wayland.windowManager.hyprland.enable { source = ./Wallpaper; recursive = true; };
};
};

View File

@@ -1,17 +1,12 @@
{ inputs, ... }: {
flake.homeModules.nathan = { config, lib, ... }: {
flake.homeModules.nathan-aurora = { config, lib, ... }: {
imports = [
inputs.aurora.homeModules.default
];
options.homeconfig.aurora.enable = with lib; mkOption {
type = with types; bool;
default = false;
};
config = lib.mkIf config.homeconfig.aurora.enable {
config = {
programs.aurora = {
enable = true;

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-bash = { config, lib, pkgs, ... }: {
home.packages = with pkgs; [ oh-my-posh ];
@@ -24,12 +24,16 @@
source ${pkgs.blesh}/share/blesh/ble.sh
'';
initExtra = if config.homeconfig.wal.enable then (lib.mkBefore ''
initExtra = lib.mkMerge [
(lib.mkIf (builtins.any (x: x == pkgs.pywal16) config.home.packages) (lib.mkBefore ''
cat ${config.home.homeDirectory}/.cache/wal/sequences
eval "$(oh-my-posh init bash --config ${config.home.homeDirectory}/.cache/wal/ohmyposh.toml)"
'') else (lib.mkBefore ''
''))
(lib.mkIf (!(builtins.any (x: x == pkgs.pywal16) config.home.packages)) (lib.mkBefore ''
eval "$(oh-my-posh init bash --config ${config.home.homeDirectory}/.config/ohmyposh/ohmyposh.toml)"
'');
''))
];
};
};
}

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-bat = { config, lib, pkgs, ... }: {
programs.bat = {

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-calcurse = { config, lib, pkgs, ... }: {
options.homeconfig.calcurse.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.calcurse.enable {
config = {
home.packages = with pkgs; [
calcurse
libnotify

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-eza = { config, lib, pkgs, ... }: {
programs.eza = {

View File

@@ -1,17 +1,12 @@
{ inputs, ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-firefox = { config, lib, pkgs, ... }: {
options.homeconfig.firefox.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.firefox.enable {
config = {
home.sessionVariables.BROWSER = "${config.programs.firefox.package}/bin/firefox";
home.packages = lib.mkIf config.homeconfig.wal.enable [
home.packages = lib.mkIf (builtins.any (x: x == pkgs.pywal16) config.home.packages) [
pkgs.pywalfox-native
];

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-fzf = { config, lib, pkgs, ... }: {
programs.fzf = {

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, ... }: {
flake.homeModules.nathan-git = { config, lib, ... }: {
options.homeconfig.git.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.git.enable {
config = {
sops = {
secrets = {

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-hypridle = { config, lib, pkgs, ... }: {
options.homeconfig.hypridle.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.hypridle.enable {
config = {
services.hypridle = {
enable = true;

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-hyprland = { config, lib, pkgs, ... }: {
options.homeconfig.hyprland.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.hyprland.enable {
config = {
home.sessionVariables.NIX_OZONE_WL = "1";

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, ... }: {
flake.homeModules.nathan-kitty = { config, ... }: {
programs.kitty = {

View File

@@ -1,15 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-mpd = { config, lib, pkgs, ... }: {
options = {
homeconfig.mpd.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.homeconfig.mpd.enable {
config = {
services.mpd = {
enable = true;
network.startWhenNeeded = true;

View File

@@ -1,13 +1,8 @@
{ inputs, ... }: {
flake.homeModules.nathan = { config, lib, ... }: {
flake.homeModules.nathan-nh = { config, lib, ... }: {
options.homeconfig.nh.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.nh.enable {
config = {
programs.nh = {
enable = true;

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-ohmyposh = { config, lib, pkgs, ... }: {
home.packages = with pkgs; [
oh-my-posh
@@ -9,7 +9,7 @@
programs.zsh = {
initContent = with lib; mkMerge [
(mkIf config.homeconfig.wal.enable (mkBefore ''
(mkIf (builtins.any (x: x == pkgs.pywal16) config.home.packages) (mkBefore ''
cat ${config.home.homeDirectory}/.cache/wal/sequences
eval "$(oh-my-posh init zsh --config ${config.home.homeDirectory}/.cache/wal/ohmyposh.toml)"
@@ -21,7 +21,7 @@
bindkey '\r' _colorRefresh
''))
(mkIf (!config.homeconfig.wal.enable) (mkBefore ''
(mkIf (!(builtins.any (x: x == pkgs.pywal16) config.home.packages)) (mkBefore ''
eval "$(oh-my-posh init zsh --config ${config.home.homeDirectory}/.config/ohmyposh/ohmyposh.toml)"
''))
];

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, ... }: {
flake.homeModules.nathan-opencode = { config, lib, ... }: {
options.homeconfig.opencode.enable = with lib; mkOption {
type = with types; bool;
default = true;
};
config = lib.mkIf config.homeconfig.opencode.enable {
config = {
programs.opencode = {
enable = true;

View File

@@ -1,19 +1,6 @@
{ inputs, ... }: {
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: let
system = pkgs.stdenv.hostPlatform;
pkgs-us = import inputs.nixpkgs-us {
inherit system;
config.allowUnfree = true;
};
in {
options.homeconfig.minimal = with lib; options.mkOption {
type = with types; bool;
default = false;
};
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
config = with lib; mkMerge [
{
@@ -41,23 +28,7 @@
pyusb
requests
]))
];
}
(mkIf config.homeconfig.graphical {
home.packages = with pkgs; [
grim
slurp
wl-clipboard
xfce.thunar
blueberry
];
})
(mkIf (!config.homeconfig.minimal) {
home.packages = with pkgs; [
cava
android-tools
neovim-remote
@@ -68,16 +39,24 @@
mpc
ffmpeg
];
})
(mkIf (!config.homeconfig.minimal && config.homeconfig.graphical) {
}
(mkIf config.wayland.windowManager.hyprland.enable {
nixpkgs.config = {
allowUnfree = true;
};
home.packages = with pkgs; [
grim
slurp
wl-clipboard
xfce.thunar
blueberry
handbrake
quickemu
bottles

View File

@@ -1,17 +1,11 @@
{ inputs, ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-pywal = { config, lib, pkgs, ... }: {
options.homeconfig.wal.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.wal.enable {
config = {
home.packages = with pkgs; [
inputs.nixvim.packages.${pkgs.stdenv.hostPlatform.system}.pywal
pywal16
imagemagick
];

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { ... }: {
flake.homeModules.nathan-ripgrep = { ... }: {
programs.ripgrep = {
enable = true;

View File

@@ -1,13 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-rofi = { config, lib, pkgs, ... }: {
options.homeconfig.rofi.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.homeconfig.rofi.enable {
config = {
programs.rofi = {
enable = true;

View File

@@ -1,17 +1,8 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-scripts = { config, lib, pkgs, ... }: {
options = {
homeconfig.scripts.enable = lib.options.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkMerge [
(lib.mkIf config.homeconfig.scripts.enable {
config = {
home.packages = [
#scripts
@@ -64,8 +55,7 @@
'')
];
})
];
};
};
}

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { ... }: {
flake.homeModules.nathan-ssh = { ... }: {
programs.ssh = {

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { config, lib, pkgs, ... }: {
flake.homeModules.nathan-tmux = { config, lib, pkgs, ... }: {
programs.tmux = {

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { ... }: {
flake.homeModules.nathan-yazi = { ... }: {
config = {
programs.yazi = {
enable = true;

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { ... }: {
flake.homeModules.nathan-zoxide = { ... }: {
programs.zoxide = {

View File

@@ -1,6 +1,6 @@
{ ... }: {
flake.homeModules.nathan = { lib, ... }: {
flake.homeModules.nathan-zsh = { lib, ... }: {
programs.zsh = {

View File

@@ -1,13 +1,13 @@
{ self, inputs, ... }: {
flake.nixosModules.user-nathan = host: { config, lib, pkgs, ... }: {
flake.nixosModules.user-nathan = { config, lib, pkgs, ... }: {
config = {
sops.secrets."nathan/pass".neededForUsers = true;
users.users.nathan = {
shell = lib.mkDefault pkgs.zsh;
shell = pkgs.zsh;
name = lib.mkDefault "nathan";
isNormalUser = lib.mkDefault true;
#hashedPasswordFile = lib.mkIf (cfg.hashedPasswordFile != null) cfg.hashedPasswordFile;
@@ -20,11 +20,18 @@
packages = lib.mkIf (false) [ pkgs.home-manager ];
};
wayland.windowManager.hyprland.extraConfig = if host == "laptop" then ''
home-manager.users.nathan = lib.mkMerge [
self.homeModules.nathan
(lib.mkIf (config.networking.hostName == "laptop") {
wayland.windowManager.hyprland.extraConfig = ''
monitor=eDP-1,1920x1080@60,0x0,1
bind = CTRL SHIFT, XF86Launch2, exec, bash -c 'if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then pkexec --user root /nix/var/nix/profiles/system/bin/switch-to-configuration switch; else pkexec --user root /nix/var/nix/profiles/system/specialisation/docked/bin/switch-to-configuration switch; fi'
bind = ALT, Escape, exec, if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1; else hyprctl keyword monitor eDP-1,1920x1080@300,0x0,1; fi
'' else '''';
'';
})
];
};
};
@@ -33,13 +40,6 @@
{
config = {
homeconfig = {
graphical = lib.mkDefault false;
minimal = lib.mkDefault false;
hyprland.enable = lib.mkDefault false;
};
nix = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];