summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-02-03 19:27:26 -0500
committerseth <[email protected]>2024-02-03 20:47:55 -0500
commitfcc60b84e5e3cc44986d40af63f5de488caae909 (patch)
tree45f4455c7dcbc63e59e62a9af79783e2e5509a2e
parentde003fa28e56b81a33e831099987cd94d2f53b39 (diff)
make everything a module
-rw-r--r--configs.nix24
-rw-r--r--dev/ci.nix20
-rw-r--r--modules/darwin/default.nix1
-rw-r--r--modules/darwin/suites/default.nix5
-rw-r--r--modules/darwin/suites/personal.nix11
-rw-r--r--modules/default.nix1
-rw-r--r--modules/flake/configurations.nix10
-rw-r--r--modules/flake/default.nix1
-rw-r--r--modules/nixos/default.nix1
-rw-r--r--modules/nixos/server/default.nix2
-rw-r--r--modules/nixos/suites/default.nix6
-rw-r--r--modules/nixos/suites/personal.nix18
-rw-r--r--modules/nixos/suites/server.nix23
-rw-r--r--modules/shared/default.nix12
-rw-r--r--modules/shared/nix.nix3
-rw-r--r--modules/shared/suites/default.nix5
-rw-r--r--modules/shared/suites/personal.nix15
-rw-r--r--modules/shared/users/default.nix11
-rw-r--r--modules/shared/users/seth.nix35
-rw-r--r--systems/atlas/default.nix2
-rw-r--r--systems/caroline/default.nix2
-rw-r--r--systems/common.nix73
-rw-r--r--systems/glados-wsl/default.nix2
-rw-r--r--systems/glados/default.nix4
-rw-r--r--users/seth/default.nix13
-rw-r--r--users/seth/home.nix16
-rw-r--r--users/seth/module/default.nix10
-rw-r--r--users/seth/module/desktop/budgie/default.nix (renamed from users/seth/desktop/budgie/default.nix)0
-rw-r--r--users/seth/module/desktop/default.nix (renamed from users/seth/desktop/default.nix)10
-rw-r--r--users/seth/module/desktop/gnome/default.nix (renamed from users/seth/desktop/gnome/default.nix)0
-rw-r--r--users/seth/module/desktop/plasma/default.nix (renamed from users/seth/desktop/plasma/default.nix)0
-rw-r--r--users/seth/module/programs/bat.nix18
-rw-r--r--users/seth/module/programs/chromium.nix35
-rw-r--r--users/seth/module/programs/default.nix62
-rw-r--r--users/seth/module/programs/eza.nix19
-rw-r--r--users/seth/module/programs/firefox/arkenfox.nix73
-rw-r--r--users/seth/module/programs/firefox/default.nix54
-rw-r--r--users/seth/module/programs/git.nix54
-rw-r--r--users/seth/module/programs/gpg.nix26
-rw-r--r--users/seth/module/programs/mangohud.nix31
-rw-r--r--users/seth/module/programs/neovim.nix30
-rw-r--r--users/seth/module/programs/ssh.nix51
-rw-r--r--users/seth/module/programs/starship/default.nix28
-rw-r--r--users/seth/module/programs/starship/starship.toml (renamed from users/seth/programs/starship/starship.toml)0
-rw-r--r--users/seth/module/programs/vim.nix43
-rw-r--r--users/seth/module/programs/vscode.nix23
-rw-r--r--users/seth/module/shell/bash.nix34
-rw-r--r--users/seth/module/shell/default.nix40
-rw-r--r--users/seth/module/shell/fish.nix52
-rw-r--r--users/seth/module/shell/nu.nix43
-rw-r--r--users/seth/module/shell/zsh.nix128
-rw-r--r--users/seth/module/standalone.nix25
-rw-r--r--users/seth/programs/bat.nix6
-rw-r--r--users/seth/programs/chromium.nix22
-rw-r--r--users/seth/programs/default.nix57
-rw-r--r--users/seth/programs/eza.nix7
-rw-r--r--users/seth/programs/firefox/arkenfox.nix54
-rw-r--r--users/seth/programs/firefox/default.nix38
-rw-r--r--users/seth/programs/git.nix41
-rw-r--r--users/seth/programs/gpg.nix17
-rw-r--r--users/seth/programs/mangohud.nix16
-rw-r--r--users/seth/programs/ssh.nix42
-rw-r--r--users/seth/programs/starship/default.nix16
-rw-r--r--users/seth/programs/vim.nix32
-rw-r--r--users/seth/programs/vscode.nix10
-rw-r--r--users/seth/shell/bash.nix22
-rw-r--r--users/seth/shell/default.nix21
-rw-r--r--users/seth/shell/fish.nix40
-rw-r--r--users/seth/shell/nu.nix36
-rw-r--r--users/seth/shell/zsh.nix115
-rw-r--r--users/seth/system.nix36
71 files changed, 1078 insertions, 755 deletions
diff --git a/configs.nix b/configs.nix
index cdb9216..a75c7e0 100644
--- a/configs.nix
+++ b/configs.nix
@@ -1,10 +1,24 @@
{
+ lib,
withSystem,
inputs,
self,
...
}: let
- common = import ./systems/common.nix {inherit inputs self;};
+ mkModulesFor = type: extra:
+ lib.concatLists [
+ (lib.attrValues self."${type}Modules")
+ extra
+ ];
+
+ nixosModules = mkModulesFor "nixos" [
+ inputs.agenix.nixosModules.default
+ inputs.hm.nixosModules.home-manager
+ ];
+
+ darwinModules = mkModulesFor "darwin" [
+ inputs.hm.darwinModules.home-manager
+ ];
in {
imports = [
./systems/deploy.nix
@@ -26,17 +40,17 @@ in {
systems = {
glados = {
- modules = common.personal;
+ modules = nixosModules;
};
glados-wsl = {
- modules = common.personal;
+ modules = nixosModules;
};
atlas = {
builder = inputs.nixpkgs-stable.lib.nixosSystem;
system = "aarch64-linux";
- modules = common.server;
+ modules = nixosModules;
};
};
};
@@ -46,7 +60,7 @@ in {
systems = {
caroline = {
- modules = common.darwin;
+ modules = darwinModules;
};
};
};
diff --git a/dev/ci.nix b/dev/ci.nix
index 2d5f583..e33c088 100644
--- a/dev/ci.nix
+++ b/dev/ci.nix
@@ -10,11 +10,19 @@
mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel);
getCompatibleCfgs = lib.filterAttrs (_: cfg: lib.elem cfg.pkgs.system ciSystems);
- getConfigurations = type: mapCfgsToDerivs (getCompatibleCfgs self."${type}Configurations");
in
- {
- checks = getOutputs self.checks;
- devShells = getOutputs self.devShells;
- }
- // lib.genAttrs ["nixos" "home"] getConfigurations;
+ builtins.foldl' lib.recursiveUpdate {} [
+ (
+ lib.genAttrs
+ ["nixosConfigurations" "homeConfigurations"]
+ (
+ type: mapCfgsToDerivs (getCompatibleCfgs self."${type}")
+ )
+ )
+ (
+ lib.genAttrs
+ ["checks" "devShells"]
+ (type: getOutputs self.${type})
+ )
+ ];
}
diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix
index a685fab..4dfa561 100644
--- a/modules/darwin/default.nix
+++ b/modules/darwin/default.nix
@@ -2,5 +2,6 @@
flake.darwinModules = {
default = ./base.nix;
desktop = ./desktop.nix;
+ suites = ./suites;
};
}
diff --git a/modules/darwin/suites/default.nix b/modules/darwin/suites/default.nix
new file mode 100644
index 0000000..b4bd1b5
--- /dev/null
+++ b/modules/darwin/suites/default.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./personal.nix
+ ];
+}
diff --git a/modules/darwin/suites/personal.nix b/modules/darwin/suites/personal.nix
new file mode 100644
index 0000000..6f37936
--- /dev/null
+++ b/modules/darwin/suites/personal.nix
@@ -0,0 +1,11 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.suites.personal;
+in {
+ config = lib.mkIf cfg.enable {
+ desktop.enable = true;
+ };
+}
diff --git a/modules/default.nix b/modules/default.nix
index c5f7ce9..9268452 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -2,5 +2,6 @@
imports = [
./nixos
./darwin
+ ./flake
];
}
diff --git a/modules/flake/configurations.nix b/modules/flake/configurations.nix
index ef1ae4e..314e85f 100644
--- a/modules/flake/configurations.nix
+++ b/modules/flake/configurations.nix
@@ -1,9 +1,7 @@
{
config,
lib,
- withSystem,
inputs,
- self,
...
}: let
namespace = "configurations";
@@ -46,8 +44,7 @@
// {
modules = args.modules ++ [../../systems/${name} {networking.hostName = name;}];
specialArgs = {
- inherit inputs self;
- inputs' = withSystem args.system ({inputs', ...}: inputs');
+ inherit inputs;
secretsDir = ../../secrets/${name};
};
}
@@ -70,10 +67,7 @@
]
++ args.modules;
- extraSpecialArgs = {
- inherit inputs self;
- inputs' = withSystem args.pkgs.system ({inputs', ...}: inputs');
- };
+ extraSpecialArgs = {inherit inputs;};
});
mapSystems = type: mapAttrs (name: _: mkSystem type name) cfg.${type}.systems;
diff --git a/modules/flake/default.nix b/modules/flake/default.nix
index e86bee4..8730f01 100644
--- a/modules/flake/default.nix
+++ b/modules/flake/default.nix
@@ -1,5 +1,6 @@
{
flake.flakeModules = {
configurations = import ./configurations.nix;
+ terranix = import ./terranix.nix;
};
}
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix
index 8d838bf..a7ba7f9 100644
--- a/modules/nixos/default.nix
+++ b/modules/nixos/default.nix
@@ -5,5 +5,6 @@
features = ./features;
server = ./server;
services = ./services;
+ suites = ./suites;
};
}
diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix
index d412067..baf05f9 100644
--- a/modules/nixos/server/default.nix
+++ b/modules/nixos/server/default.nix
@@ -21,6 +21,7 @@ in {
tmp.cleanOnBoot = lib.mkDefault true;
kernelPackages = lib.mkDefault pkgs.linuxPackages_hardened;
};
+ environment.etc."nix/inputs/nixpkgs".source = inputs.nixpkgs-stable.outPath;
documentation = {
enable = false;
@@ -35,6 +36,7 @@ in {
options = "-d --delete-older-than 2d";
};
+ registry.n.flake = inputs.nixpkgs-stable;
settings.allowed-users = [config.networking.hostName];
};
};
diff --git a/modules/nixos/suites/default.nix b/modules/nixos/suites/default.nix
new file mode 100644
index 0000000..0d11285
--- /dev/null
+++ b/modules/nixos/suites/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./personal.nix
+ ./server.nix
+ ];
+}
diff --git a/modules/nixos/suites/personal.nix b/modules/nixos/suites/personal.nix
new file mode 100644
index 0000000..830062b
--- /dev/null
+++ b/modules/nixos/suites/personal.nix
@@ -0,0 +1,18 @@
+{
+ config,
+ lib,
+ secretsDir,
+ ...
+}: let
+ cfg = config.suites.personal;
+in {
+ config = lib.mkIf cfg.enable {
+ age = {
+ identityPaths = ["/etc/age/key"];
+ secrets = {
+ rootPassword.file = secretsDir + "/rootPassword.age";
+ sethPassword.file = secretsDir + "/sethPassword.age";
+ };
+ };
+ };
+}
diff --git a/modules/nixos/suites/server.nix b/modules/nixos/suites/server.nix
new file mode 100644
index 0000000..ac0c001
--- /dev/null
+++ b/modules/nixos/suites/server.nix
@@ -0,0 +1,23 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.suites.server;
+in {
+ options.suites.server = {
+ enable = lib.mkEnableOption "Server configuration set";
+ };
+
+ config = lib.mkIf cfg.enable {
+ features.tailscale = {
+ enable = true;
+ ssh.enable = true;
+ };
+
+ server = {
+ enable = true;
+ secrets.enable = true;
+ };
+ };
+}
diff --git a/modules/shared/default.nix b/modules/shared/default.nix
index d6ec316..edd1f34 100644
--- a/modules/shared/default.nix
+++ b/modules/shared/default.nix
@@ -1,9 +1,15 @@
{
lib,
- self,
+ inputs,
...
-}: {
- imports = [./nix.nix];
+}: let
+ inherit (inputs) self;
+in {
+ imports = [
+ ./nix.nix
+ ./suites
+ ./users
+ ];
system.configurationRevision = self.rev or self.dirtyRev or "dirty-unknown";
diff --git a/modules/shared/nix.nix b/modules/shared/nix.nix
index 60959f9..770e7e4 100644
--- a/modules/shared/nix.nix
+++ b/modules/shared/nix.nix
@@ -3,7 +3,6 @@
lib,
pkgs,
inputs,
- self,
...
}: {
nix = {
@@ -29,7 +28,7 @@
};
nixpkgs = {
- overlays = [self.overlays.default];
+ overlays = [inputs.self.overlays.default];
config.allowUnfree = lib.mkDefault true;
};
}
diff --git a/modules/shared/suites/default.nix b/modules/shared/suites/default.nix
new file mode 100644
index 0000000..b4bd1b5
--- /dev/null
+++ b/modules/shared/suites/default.nix
@@ -0,0 +1,5 @@
+{
+ imports = [
+ ./personal.nix
+ ];
+}
diff --git a/modules/shared/suites/personal.nix b/modules/shared/suites/personal.nix
new file mode 100644
index 0000000..3c5146a
--- /dev/null
+++ b/modules/shared/suites/personal.nix
@@ -0,0 +1,15 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.suites.personal;
+in {
+ options.suites.personal = {
+ enable = lib.mkEnableOption "Personal configuration set";
+ };
+
+ config = lib.mkIf cfg.enable {
+ users.seth.enable = true;
+ };
+}
diff --git a/modules/shared/users/default.nix b/modules/shared/users/default.nix
new file mode 100644
index 0000000..6e1a3f6
--- /dev/null
+++ b/modules/shared/users/default.nix
@@ -0,0 +1,11 @@
+{inputs, ...}: {
+ imports = [
+ ./seth.nix
+ ];
+
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ extraSpecialArgs = {inherit inputs;};
+ };
+}
diff --git a/modules/shared/users/seth.nix b/modules/shared/users/seth.nix
new file mode 100644
index 0000000..0c98fc9
--- /dev/null
+++ b/modules/shared/users/seth.nix
@@ -0,0 +1,35 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.users.seth;
+in {
+ options.users.seth = {
+ enable = lib.mkEnableOption "Seth's configuration & home";
+ };
+
+ config = lib.mkIf cfg.enable {
+ users.users.seth =
+ {
+ shell = pkgs.fish;
+ home = lib.mkDefault (
+ if pkgs.stdenv.isDarwin
+ then "/Users/seth"
+ else "/home/seth"
+ );
+ }
+ // lib.optionalAttrs pkgs.stdenv.isLinux {
+ extraGroups = ["wheel"];
+ isNormalUser = true;
+ hashedPasswordFile = lib.mkDefault config.age.secrets.sethPassword.path;
+ };
+
+ programs.fish.enable = lib.mkDefault true;
+
+ home-manager.users.seth = {
+ imports = [../../../users/seth];
+ };
+ };
+}
diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix
index 55d46b3..5b27856 100644
--- a/systems/atlas/default.nix
+++ b/systems/atlas/default.nix
@@ -10,6 +10,8 @@
./teawiebot.nix
];
+ suites.server.enable = true;
+
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
diff --git a/systems/caroline/default.nix b/systems/caroline/default.nix
index 160a4fc..8e14515 100644
--- a/systems/caroline/default.nix
+++ b/systems/caroline/default.nix
@@ -1,4 +1,6 @@
{
+ suites.personal.enable = true;
+
homebrew.casks = [
"altserver"
"discord"
diff --git a/systems/common.nix b/systems/common.nix
deleted file mode 100644
index 7483474..0000000
--- a/systems/common.nix
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- inputs,
- self,
-}: let
- hmSetup = {inputs', ...}: {
- imports = [
- ../users/seth/system.nix
- ];
-
- home-manager = {
- useGlobalPkgs = true;
- useUserPackages = true;
- extraSpecialArgs = {inherit inputs inputs' self;};
- };
- };
-
- nixosModules = builtins.attrValues self.nixosModules;
- darwinModules = builtins.attrValues self.darwinModules;
-in {
- personal =
- nixosModules
- ++ [
- inputs.agenix.nixosModules.default
- inputs.catppuccin.nixosModules.catppuccin
- inputs.hm.nixosModules.home-manager
-
- hmSetup
-
- ({secretsDir, ...}: {
- age = {
- identityPaths = ["/etc/age/key"];
- secrets = {
- rootPassword.file = secretsDir + "/rootPassword.age";
- sethPassword.file = secretsDir + "/sethPassword.age";
- };
- };
-
- services.nixseparatedebuginfod.enable = true;
- })
- ];
-
- darwin =
- darwinModules
- ++ [
- inputs.hm.darwinModules.home-manager
- hmSetup
-
- {
- desktop.enable = true;
- }
- ];
-
- server =
- nixosModules
- ++ [
- inputs.agenix.nixosModules.default
-
- {
- features.tailscale = {
- enable = true;
- ssh.enable = true;
- };
-
- server = {
- enable = true;
- secrets.enable = true;
- };
-
- nix.registry.n.flake = inputs.nixpkgs-stable;
- environment.etc."nix/inputs/nixpkgs".source = inputs.nixpkgs-stable.outPath;
- }
- ];
-}
diff --git a/systems/glados-wsl/default.nix b/systems/glados-wsl/default.nix
index 4c61156..d42e69f 100644
--- a/systems/glados-wsl/default.nix
+++ b/systems/glados-wsl/default.nix
@@ -10,6 +10,8 @@
inputs.nixos-wsl.nixosModules.wsl
];
+ suites.personal.enable = true;
+
documentation = {
enable = lib.mkForce true;
man.enable = lib.mkForce true;
diff --git a/systems/glados/default.nix b/systems/glados/default.nix
index 4b43bcc..c516b07 100644
--- a/systems/glados/default.nix
+++ b/systems/glados/default.nix
@@ -11,6 +11,8 @@
inputs.nixos-hardware.nixosModules.common-pc-ssd
];
+ suites.personal.enable = true;
+
desktop = {
enable = true;
gnome.enable = true;
@@ -22,7 +24,7 @@
};
home-manager.users.seth = {
- desktop.enable = true;
+ seth.desktop.enable = true;
};
networking.hostName = "glados";
diff --git a/users/seth/default.nix b/users/seth/default.nix
index f5a1be2..c54e5ff 100644
--- a/users/seth/default.nix
+++ b/users/seth/default.nix
@@ -1,12 +1,3 @@
-{inputs, ...}: {
- imports = with inputs; [
- ./programs
- ./shell
-
- arkenfox.hmModules.arkenfox
- catppuccin.homeManagerModules.catppuccin
- nix-index-database.hmModules.nix-index
- ];
-
- home.stateVersion = "23.11";
+{
+ imports = [./module];
}
diff --git a/users/seth/home.nix b/users/seth/home.nix
index a3529b0..218ef95 100644
--- a/users/seth/home.nix
+++ b/users/seth/home.nix
@@ -1,18 +1,4 @@
{
- config,
- pkgs,
- self,
- ...
-}: {
imports = [./.];
-
- home = {
- username = "seth";
- homeDirectory =
- if pkgs.stdenv.isDarwin
- then "/Users/${config.home.username}"
- else "/home/${config.home.username}";
- };
-
- nixpkgs.overlays = [self.overlays.default];
+ seth.standalone.enable = true;
}
diff --git a/users/seth/module/default.nix b/users/seth/module/default.nix
new file mode 100644
index 0000000..29163db
--- /dev/null
+++ b/users/seth/module/default.nix
@@ -0,0 +1,10 @@
+{
+ imports = [
+ ./desktop
+ ./programs
+ ./shell
+ ./standalone.nix
+ ];
+
+ home.stateVersion = "23.11";
+}
diff --git a/users/seth/desktop/budgie/default.nix b/users/seth/module/desktop/budgie/default.nix
index bf72ee5..bf72ee5 100644
--- a/users/seth/desktop/budgie/default.nix
+++ b/users/seth/module/desktop/budgie/default.nix
diff --git a/users/seth/desktop/default.nix b/users/seth/module/desktop/default.nix
index fb4b894..66a821d 100644
--- a/users/seth/desktop/default.nix
+++ b/users/seth/module/desktop/default.nix
@@ -3,8 +3,12 @@
lib,
pkgs,
...
-}: {
- options.desktop.enable = lib.mkEnableOption "desktop";
+}: let
+ cfg = config.seth.desktop;
+in {
+ options.seth.desktop = {
+ enable = lib.mkEnableOption "desktop";
+ };
imports = [
./budgie
@@ -12,7 +16,7 @@
./plasma
];
- config = lib.mkIf config.desktop.enable {
+ config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
discord
element-desktop
diff --git a/users/seth/desktop/gnome/default.nix b/users/seth/module/desktop/gnome/default.nix
index 2ed45b2..2ed45b2 100644
--- a/users/seth/desktop/gnome/default.nix
+++ b/users/seth/module/desktop/gnome/default.nix
diff --git a/users/seth/desktop/plasma/default.nix b/users/seth/module/desktop/plasma/default.nix
index e3735f1..e3735f1 100644
--- a/users/seth/desktop/plasma/default.nix
+++ b/users/seth/module/desktop/plasma/default.nix
diff --git a/users/seth/module/programs/bat.nix b/users/seth/module/programs/bat.nix
new file mode 100644
index 0000000..267eb57
--- /dev/null
+++ b/users/seth/module/programs/bat.nix
@@ -0,0 +1,18 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.bat;
+in {
+ options.seth.programs.bat = {
+ enable = lib.mkEnableOption "bat configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.bat = {
+ enable = true;
+ catppuccin.enable = true;
+ };
+ };
+}
diff --git a/users/seth/module/programs/chromium.nix b/users/seth/module/programs/chromium.nix
new file mode 100644
index 0000000..5c44dec
--- /dev/null
+++ b/users/seth/module/programs/chromium.nix
@@ -0,0 +1,35 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.programs.chromium;
+in {
+ options.seth.programs.chromium = {
+ enable =
+ lib.mkEnableOption "Chromium configuration"
+ // {
+ default = config.seth.desktop.enable;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.chromium = {
+ enable = true;
+
+ dictionaries = [pkgs.hunspellDictsChromium.en_US];
+
+ extensions = [
+ # ublock origin
+ {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";}
+ # bitwarden
+ {id = "nngceckbapebfimnlniiiahkandclblb";}
+ # floccus bookmark sync
+ {id = "fnaicdffflnofjppbagibeoednhnbjhg";}
+ # tabby cat
+ {id = "mefhakmgclhhfbdadeojlkbllmecialg";}
+ ];
+ };
+ };
+}
diff --git a/users/seth/module/programs/default.nix b/users/seth/module/programs/default.nix
new file mode 100644
index 0000000..38556cf
--- /dev/null
+++ b/users/seth/module/programs/default.nix
@@ -0,0 +1,62 @@
+{
+ config,
+ lib,
+ pkgs,
+ inputs,
+ ...
+}: let
+ cfg = config.seth.programs;
+in {
+ options.seth.programs = {
+ basePrograms.enable = lib.mkEnableOption "Base programs and configurations" // {default = true;};
+ };
+
+ imports = [
+ inputs.catppuccin.homeManagerModules.catppuccin
+ inputs.nix-index-database.hmModules.nix-index
+ ./bat.nix
+ ./chromium.nix
+ ./eza.nix
+ ./firefox
+ ./git.nix
+ ./gpg.nix
+ ./mangohud.nix
+ ./neovim.nix
+ ./ssh.nix
+ ./starship
+ ./vim.nix
+ ./vscode.nix
+ ];
+
+ config = lib.mkIf cfg.basePrograms.enable {
+ home.packages = with pkgs; [
+ fd
+ nix-output-monitor
+ nurl
+ rclone
+ restic
+ ];
+
+ catppuccin.flavour = "mocha";
+
+ programs = {
+ btop = {
+ enable = true;
+ catppuccin.enable = true;
+ };
+
+ direnv = {
+ enable = true;
+ nix-direnv.enable = true;
+ };
+
+ glamour.catppuccin.enable = true;
+
+ ripgrep.enable = true;
+
+ nix-index-database.comma.enable = true;
+ };
+
+ xdg.enable = true;
+ };
+}
diff --git a/users/seth/module/programs/eza.nix b/users/seth/module/programs/eza.nix
new file mode 100644
index 0000000..32fd664
--- /dev/null
+++ b/users/seth/module/programs/eza.nix
@@ -0,0 +1,19 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.eza;
+in {
+ options.seth.programs.eza = {
+ enable = lib.mkEnableOption "eza configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.eza = {
+ enable = true;
+ enableAliases = true;
+ icons = true;
+ };
+ };
+}
diff --git a/users/seth/module/programs/firefox/arkenfox.nix b/users/seth/module/programs/firefox/arkenfox.nix
new file mode 100644
index 0000000..eb17666
--- /dev/null
+++ b/users/seth/module/programs/firefox/arkenfox.nix
@@ -0,0 +1,73 @@
+{
+ config,
+ lib,
+ inputs,
+ ...
+}: let
+ cfg = config.seth.programs.firefox.arkenfox;
+in {
+ imports = [inputs.arkenfox.hmModules.arkenfox];
+
+ options.seth.programs.firefox.arkenfox = {
+ enable =
+ lib.mkEnableOption "Arkenfox settings for Firefox"
+ // {
+ default = config.seth.programs.firefox.enable;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.firefox = {
+ arkenfox = {
+ enable = true;
+ version = "119.0";
+ };
+
+ profiles.arkenfox.arkenfox = let
+ enableSections = sections: lib.genAttrs sections (_: {enable = true;});
+ in
+ lib.recursiveUpdate {
+ enable = true;
+
+ # enable safe browsing
+ "0400"."0403"."browser.safebrowsing.downloads.remote.enabled".value = true;
+
+ # fix hulu
+ "1200"."1201"."security.ssl.require_safe_negotiation".value = false;
+
+ "2600"."2651"."browser.download.useDownloadDir" = {
+ enable = true;
+ value = true;
+ };
+
+ # disable rfp letterboxing
+ "4500"."4504"."privacy.resistFingerprinting.letterboxing".value = false;
+
+ "5000" = {
+ "5003"."signon.rememberSignons".enable = true;
+ # enable search autocomplete
+ "5021"."keyword.enabled".value = true;
+ };
+ } (enableSections [
+ "0100"
+ "0200"
+ "0300"
+ "0400"
+ "0600"
+ "0700"
+ "0800"
+ "0900"
+ "1000"
+ "1200"
+ "1600"
+ "1700"
+ "2000"
+ "2400"
+ "2600"
+ "2700"
+ "2800"
+ "4500"
+ ]);
+ };
+ };
+}
diff --git a/users/seth/module/programs/firefox/default.nix b/users/seth/module/programs/firefox/default.nix
new file mode 100644
index 0000000..fed31c5
--- /dev/null
+++ b/users/seth/module/programs/firefox/default.nix
@@ -0,0 +1,54 @@
+{
+ config,
+ lib,
+ inputs,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.programs.firefox;
+
+ inherit (pkgs.stdenv.hostPlatform) system;
+in {
+ options.seth.programs.firefox = {
+ enable =
+ lib.mkEnableOption "Firefox configuration"
+ // {
+ default = config.seth.desktop.enable;
+ };
+ };
+
+ imports = [
+ ./arkenfox.nix
+ ];
+
+ config = lib.mkIf cfg.enable {
+ home.sessionVariables = {
+ MOZ_ENABLE_WAYLAND = "1";
+ };
+
+ programs.firefox = {
+ enable = true;
+ profiles.arkenfox = {
+ extensions = with inputs.firefox-addons.packages.${system}; [
+ bitwarden
+ floccus
+ ublock-origin
+ ];
+
+ isDefault = true;
+
+ settings = {
+ # disable firefox accounts & pocket
+ "extensions.pocket.enabled" = false;
+ "identity.fxaccounts.enabled" = false;
+
+ # hw accel
+ "media.ffmpeg.vaapi.enabled" = true;
+
+ # widevine drm
+ "media.gmp-widevinecdm.enabled" = true;
+ };
+ };
+ };
+ };
+}
diff --git a/users/seth/module/programs/git.nix b/users/seth/module/programs/git.nix
new file mode 100644
index 0000000..8ba6587
--- /dev/null
+++ b/users/seth/module/programs/git.nix
@@ -0,0 +1,54 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.git;
+in {
+ options.seth.programs.git = {
+ enable = lib.mkEnableOption "Git configuration settings" // {default = true;};
+ gh.enable = lib.mkEnableOption "GitHub CLI support" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs = {
+ gh = lib.mkIf cfg.gh.enable {
+ enable = true;
+ settings = {
+ git_protocol = "https";
+ editor = "nvim";
+ prompt = "enabled";
+ # workaround for https://github.com/nix-community/home-manager/issues/474
+ version = 1;
+ };
+
+ gitCredentialHelper = {
+ enable = true;
+ hosts = ["https://github.com" "https://github.example.com"];
+ };
+ };
+
+ git = {
+ enable = true;
+
+ difftastic = {
+ enable = true;
+ background = "dark";
+ display = "inline";
+ };
+
+ extraConfig = {
+ init = {defaultBranch = "main";};
+ };
+
+ signing = {
+ key = "D31BD0D494BBEE86";
+ signByDefault = true;
+ };
+
+ userEmail = "[email protected]";
+ userName = "seth";
+ };
+ };
+ };
+}
diff --git a/users/seth/module/programs/gpg.nix b/users/seth/module/programs/gpg.nix
new file mode 100644
index 0000000..b259525
--- /dev/null
+++ b/users/seth/module/programs/gpg.nix
@@ -0,0 +1,26 @@
+{
+ config,
+ lib,
+ pkgs,
+ osConfig,
+ ...
+}: let
+ cfg = config.seth.programs.gpg;
+in {
+ options.seth.programs.gpg = {
+ enable = lib.mkEnableOption "GnuPG configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.gpg.enable = true;
+
+ services.gpg-agent = lib.mkIf pkgs.stdenv.isLinux {
+ enable = true;
+
+ pinentryFlavor =
+ if osConfig ? programs
+ then osConfig.programs.gnupg.agent.pinentryFlavor or "curses"
+ else "curses";
+ };
+ };
+}
diff --git a/users/seth/module/programs/mangohud.nix b/users/seth/module/programs/mangohud.nix
new file mode 100644
index 0000000..f104823
--- /dev/null
+++ b/users/seth/module/programs/mangohud.nix
@@ -0,0 +1,31 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.mangohud;
+in {
+ options.seth.programs.mangohud = {
+ enable =
+ lib.mkEnableOption "MangoHud configuration"
+ // {
+ default = config.seth.desktop.enable;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.mangohud = {
+ enable = true;
+ settings = {
+ cpu_stats = true;
+ cpu_temp = true;
+ gpu_stats = true;
+ gpu_temp = true;
+ fps = true;
+ frametime = true;
+ media_player = true;
+ media_player_name = "spotify";
+ };
+ };
+ };
+}
diff --git a/users/seth/module/programs/neovim.nix b/users/seth/module/programs/neovim.nix
new file mode 100644
index 0000000..6220853
--- /dev/null
+++ b/users/seth/module/programs/neovim.nix
@@ -0,0 +1,30 @@
+{
+ config,
+ lib,
+ pkgs,
+ inputs,
+ ...
+}: let
+ cfg = config.seth.programs.neovim;
+ inherit (pkgs.stdenv.hostPlatform) system;
+in {
+ options.seth.programs.neovim = {
+ enable = lib.mkEnableOption "Neovim configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ home.packages = [
+ (let
+ getchvim = inputs.getchvim.packages.${system}.default;
+ in
+ # remove desktop file
+ pkgs.symlinkJoin {
+ name = "${getchvim.name}-nodesktop";
+ paths = [getchvim];
+ postBuild = ''
+ rm -rf $out/share/{applications,icons}
+ '';
+ })
+ ];
+ };
+}
diff --git a/users/seth/module/programs/ssh.nix b/users/seth/module/programs/ssh.nix
new file mode 100644
index 0000000..48f167c
--- /dev/null
+++ b/users/seth/module/programs/ssh.nix
@@ -0,0 +1,51 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.programs.ssh;
+in {
+ options.seth.programs.ssh = {
+ enable = lib.mkEnableOption "SSH configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.ssh = {
+ enable = true;
+ package = pkgs.openssh;
+
+ matchBlocks = let
+ sshDir = "${config.home.homeDirectory}/.ssh";
+ in {
+ # git forges
+ "codeberg.org" = {
+ identityFile = "${sshDir}/codeberg";
+ user = "git";
+ };
+
+ # linux packaging
+ "aur.archlinux.org" = {
+ identityFile = "${sshDir}/aur";
+ user = "aur";
+ };
+
+ "pagure.io" = {
+ identityFile = "${sshDir}/copr";
+ user = "git";
+ };
+
+ # router
+ "192.168.1.1" = {
+ identityFile = "${sshDir}/openwrt";
+ user = "root";
+ };
+
+ # servers
+ "atlas".user = "atlas";
+ };
+ };
+
+ services.ssh-agent.enable = pkgs.stdenv.isLinux;
+ };
+}
diff --git a/users/seth/module/programs/starship/default.nix b/users/seth/module/programs/starship/default.nix
new file mode 100644
index 0000000..8f6e78c
--- /dev/null
+++ b/users/seth/module/programs/starship/default.nix
@@ -0,0 +1,28 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.starship;
+in {
+ options.seth.programs.starship = {
+ enable = lib.mkEnableOption "Starship configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.starship = {
+ enable = true;
+
+ enableBashIntegration = false;
+ enableZshIntegration = false;
+
+ settings =
+ {
+ format = "$all";
+ palette = "catppuccin_mocha";
+ command_timeout = 250;
+ }
+ // fromTOML (builtins.readFile ./starship.toml);
+ };
+ };
+}
diff --git a/users/seth/programs/starship/starship.toml b/users/seth/module/programs/starship/starship.toml
index db66325..db66325 100644
--- a/users/seth/programs/starship/starship.toml
+++ b/users/seth/module/programs/starship/starship.toml
diff --git a/users/seth/module/programs/vim.nix b/users/seth/module/programs/vim.nix
new file mode 100644
index 0000000..b8a198e
--- /dev/null
+++ b/users/seth/module/programs/vim.nix
@@ -0,0 +1,43 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.programs.vim;
+ inherit (config.xdg) configHome dataHome stateHome;
+in {
+ options.seth.programs.vim = {
+ enable = lib.mkEnableOption "Vim configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.vim = {
+ enable = true;
+ settings = {
+ expandtab = false;
+ shiftwidth = 2;
+ tabstop = 2;
+ };
+ extraConfig = ''
+ " https://wiki.archlinux.org/title/XDG_Base_Directory
+ set runtimepath^=${configHome}/vim
+ set runtimepath+=${dataHome}/vim
+ set runtimepath+=${configHome}/vim/after
+
+ set packpath^=${dataHome}/vim,${configHome}/vim
+ set packpath+=${configHome}/vim/after,${dataHome}/vim/after
+ set packpath^=${dataHome}/vim,${configHome}/vim
+ set packpath+=${configHome}/vim/after,${dataHome}/vim/after
+
+ let g:netrw_home = "${dataHome}/vim"
+ call mkdir("${dataHome}/vim/spell", 'p')
+
+ set backupdir=${stateHome}/vim/backup | call mkdir(&backupdir, 'p')
+ set directory=${stateHome}/vim/swap | call mkdir(&directory, 'p')
+ set undodir=${stateHome}/vim/undo | call mkdir(&undodir, 'p')
+ set viewdir=${stateHome}/vim/view | call mkdir(&viewdir, 'p')
+ set viminfofile=${stateHome}/vim/viminfo
+ '';
+ };
+ };
+}
diff --git a/users/seth/module/programs/vscode.nix b/users/seth/module/programs/vscode.nix
new file mode 100644
index 0000000..a2be13c
--- /dev/null
+++ b/users/seth/module/programs/vscode.nix
@@ -0,0 +1,23 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.programs.vscode;
+in {
+ options.seth.programs.vscode = {
+ enable =
+ lib.mkEnableOption "VSCode configuration"
+ // {
+ default = config.seth.desktop.enable;
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.vscode = {
+ enable = true;
+ package = pkgs.vscode.fhs;
+ };
+ };
+}
diff --git a/users/seth/module/shell/bash.nix b/users/seth/module/shell/bash.nix
new file mode 100644
index 0000000..09a78a3
--- /dev/null
+++ b/users/seth/module/shell/bash.nix
@@ -0,0 +1,34 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.shell.bash;
+in {
+ options.seth.shell.bash = {
+ enable = lib.mkEnableOption "Bash configuration" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.bash = {
+ enable = true;
+ # TODO: find out if i need this anymore with standalone HM
+ bashrcExtra = ''
+ nixfile=${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
+ [ -e "$nixfile" ] && source "$nixfile"
+ '';
+ historyFile = "${config.xdg.stateHome}/bash/history";
+ historyFileSize = 1000;
+ historySize = 100;
+ shellOptions = [
+ "cdspell"
+ "checkjobs"
+ "checkwinsize"
+ "dirspell"
+ "globstar"
+ "histappend"
+ "no_empty_cmd_completion"
+ ];
+ };
+ };
+}
diff --git a/users/seth/module/shell/default.nix b/users/seth/module/shell/default.nix
new file mode 100644
index 0000000..050cb0c
--- /dev/null
+++ b/users/seth/module/shell/default.nix
@@ -0,0 +1,40 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.seth.shell;
+in {
+ options.seth.shell = {
+ aliases.enable = lib.mkEnableOption "Shell aliases" // {default = true;};
+ variables.enable = lib.mkEnableOption "Shell variables" // {default = true;};
+ };
+
+ imports = [
+ ./bash.nix
+ ./fish.nix
+ ./nu.nix
+ ./zsh.nix
+ ];
+
+ config = {
+ home = lib.mkMerge [
+ (lib.mkIf cfg.variables.enable {
+ sessionVariables = rec {
+ EDITOR = "nvim";
+ VISUAL = EDITOR;
+ CARGO_HOME = "${config.xdg.dataHome}/cargo";
+ LESSHISTFILE = "${config.xdg.stateHome}/less/history";
+ };
+ })
+
+ (lib.mkIf cfg.aliases.enable {
+ shellAliases = {
+ diff = "diff --color=auto";
+ g = "git";
+ gs = "g status";
+ };
+ })
+ ];
+ };
+}
diff --git a/users/seth/module/shell/fish.nix b/users/seth/module/shell/fish.nix
new file mode 100644
index 0000000..6dfebb9
--- /dev/null
+++ b/users/seth/module/shell/fish.nix
@@ -0,0 +1,52 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.shell.fish;
+in {
+ options.seth.shell.fish = {
+ enable = lib.mkEnableOption "Fish configuration" // {default = true;};
+ withPlugins = lib.mkEnableOption "Fish plugins" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.fish = lib.mkMerge [
+ {
+ enable = true;
+ catppuccin.enable = true;
+
+ interactiveShellInit = ''
+ set -l nixfile ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish
+ if test -e $nixfile
+ source $nixfile
+ end
+
+ ${lib.getExe pkgs.nix-your-shell} fish | source
+
+ abbr -a !! --position anywhere --function last_history_item
+ '';
+
+ functions = {
+ last_history_item.body = "echo $history[1]";
+ };
+
+ shellAbbrs = {
+ nixgc = "sudo nix-collect-garbage -d && nix-collect-garbage -d";
+ };
+ }
+ (lib.mkIf cfg.withPlugins {
+ plugins = let
+ mkFishPlugins = builtins.map (plugin: {
+ name = plugin;
+ inherit (pkgs.fishPlugins.${plugin}) src;
+ });
+ in
+ mkFishPlugins [
+ "autopair"
+ ];
+ })
+ ];
+ };
+}
diff --git a/users/seth/module/shell/nu.nix b/users/seth/module/shell/nu.nix
new file mode 100644
index 0000000..b5b1529
--- /dev/null
+++ b/users/seth/module/shell/nu.nix
@@ -0,0 +1,43 @@
+{
+ config,
+ lib,
+ inputs,
+ ...
+}: let
+ cfg = config.seth.shell.nushell;
+ theme = "catppuccin-${config.catppuccin.flavour}";
+in {
+ options.seth.shell.nushell = {
+ enable = lib.mkEnableOption "Nushell configuration";
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs = {
+ nushell = {
+ enable = true;
+
+ configFile.text = ''
+ def "nixgc" [] {
+ sudo nix-collect-garbage -d; nix-collect-garbage -d
+ }
+ '';
+
+ envFile.text = ''
+ use ${inputs.nu-scripts}/themes/nu-themes/${theme}.nu
+ $env.config.color_config = (${theme})
+ '';
+
+ inherit (config.home) shellAliases;
+ };
+
+ bash.initExtra = lib.mkAfter ''
+ if [[ $(ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then
+ exec ${lib.getExe config.programs.nushell.package}
+ fi
+ '';
+
+ # builtin `ls` is good here!
+ eza.enable = lib.mkForce false;
+ };
+ };
+}
diff --git a/users/seth/module/shell/zsh.nix b/users/seth/module/shell/zsh.nix
new file mode 100644
index 0000000..b3f31b9
--- /dev/null
+++ b/users/seth/module/shell/zsh.nix
@@ -0,0 +1,128 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.seth.shell.zsh;
+in {
+ options.seth.shell.zsh = {
+ enable = lib.mkEnableOption "Zsh configuration";
+ withPlugins = lib.mkEnableOption "Zsh plugins" // {default = true;};
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.zsh = lib.mkMerge [
+ {
+ enable = true;
+ enableAutosuggestions = true;
+
+ completionInit = ''
+ autoload -Uz bashcompinit compinit
+ local zdump="${config.xdg.cacheHome}/zsh/zdump"
+ bashcompinit
+ compinit -d "$zdump"
+ if [[ ! "$zdump.zwc" -nt "$zdump" ]]
+ then
+ zcompile "$zdump"
+ fi
+ unset zdump
+ '';
+
+ defaultKeymap = "emacs";
+ dotDir = ".config/zsh";
+
+ initExtra = ''
+ if [[ -r "$XDG_CACHE_HOME/p10k-instant-prompt-*.zsh" ]]; then
+ source "$XDG_CACHE_HOME/p10k-instant-prompt-*.zsh"
+ fi
+ autoload -Uz promptinit colors
+ promptinit
+ colors
+
+ ${lib.getExe pkgs.nix-your-shell} zsh | source /dev/stdin
+
+ zmodload zsh/zutil
+ zmodload zsh/complist
+ zstyle ":completion::*" group-name ""
+ zstyle ":completion:*" menu "select"
+ zstyle ":completion:*" squeeze-slashes "true"
+ zstyle ":completion::*" use-cache "true"
+ zstyle ":completion::*" cache-path "$zdump"
+
+ unsetopt beep
+ unsetopt hist_beep
+ unsetopt ignore_braces
+ unsetopt list_beep
+ setopt always_to_end
+ setopt prompt_subst
+ setopt share_history
+
+ # clear backbuffer with ctrl-l
+ function clear-screen-and-scrollback() {
+ echoti civis >"$TTY"
+ printf '%b' '\e[H\e[2J' >"$TTY"
+ zle .reset-prompt
+ zle -R
+ printf '%b' '\e[3J' >"$TTY"
+ echoti cnorm >"$TTY"
+ }
+
+ zle -N clear-screen-and-scrollback
+ bindkey '^L' clear-screen-and-scrollback
+
+ [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
+ '';
+
+ history = {
+ expireDuplicatesFirst = true;
+ path = "${config.xdg.stateHome}/zsh/zsh_history";
+ save = 1000;
+ size = 100;
+ };
+ }
+
+ (lib.mkIf cfg.withPlugins {
+ plugins = [
+ {
+ name = "cattppuccin-zsh-syntax-highlighting";
+ src = pkgs.fetchFromGitHub {
+ owner = "catppuccin";
+ repo = "zsh-syntax-highlighting";
+ rev = "06d519c20798f0ebe275fc3a8101841faaeee8ea";
+ sha256 = "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo=";
+ };
+
+ file = "themes/catppuccin_mocha-zsh-syntax-highlighting.zsh";
+ }
+
+ {
+ name = "nix-zsh-completions";
+ src = pkgs.nix-zsh-completions;
+ file = "share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh";
+ }
+
+ {
+ name = "powerlevel10k";
+ src = pkgs.zsh-powerlevel10k;
+ file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
+ }
+
+ {
+ name = "zsh-autopair";
+ src = pkgs.zsh-autopair;
+ file = "share/zsh/zsh-autopair/autopair.zsh";
+ }
+
+ {
+ name = "zsh-completions";
+ src = pkgs.zsh-completions;
+ file = "share/zsh-completions/zsh-completions.plugin.zsh";
+ }
+ ];
+
+ enableSyntaxHighlighting = true;
+ })
+ ];
+ };
+}
diff --git a/users/seth/module/standalone.nix b/users/seth/module/standalone.nix
new file mode 100644
index 0000000..c08d2ae
--- /dev/null
+++ b/users/seth/module/standalone.nix
@@ -0,0 +1,25 @@
+{
+ config,
+ lib,
+ pkgs,
+ inputs,
+ ...
+}: let
+ cfg = config.seth.standalone;
+in {
+ options.seth.standalone = {
+ enable = lib.mkEnableOption "Standalone options";
+ };
+
+ config = lib.mkIf cfg.enable {
+ home = {
+ username = "seth";
+ homeDirectory =
+ if pkgs.stdenv.isDarwin
+ then "/Users/${config.home.username}"
+ else "/home/${config.home.username}";
+ };
+
+ nixpkgs.overlays = [inputs.self.overlays.default];
+ };
+}
diff --git a/users/seth/programs/bat.nix b/users/seth/programs/bat.nix
deleted file mode 100644
index e772849..0000000
--- a/users/seth/programs/bat.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- programs.bat = {
- enable = true;
- catppuccin.enable = true;
- };
-}
diff --git a/users/seth/programs/chromium.nix b/users/seth/programs/chromium.nix
deleted file mode 100644
index 8386040..0000000
--- a/users/seth/programs/chromium.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- config,
- pkgs,
- ...
-}: {
- programs.chromium = {
- inherit (config.desktop) enable;
-
- dictionaries = [pkgs.hunspellDictsChromium.en_US];
-
- extensions = [
- # ublock origin
- {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";}
- # bitwarden
- {id = "nngceckbapebfimnlniiiahkandclblb";}
- # floccus bookmark sync
- {id = "fnaicdffflnofjppbagibeoednhnbjhg";}
- # tabby cat
- {id = "mefhakmgclhhfbdadeojlkbllmecialg";}
- ];
- };
-}
diff --git a/users/seth/programs/default.nix b/users/seth/programs/default.nix
deleted file mode 100644
index 24f508d..0000000
--- a/users/seth/programs/default.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- pkgs,
- inputs',
- ...
-}: {
- imports = [
- ./bat.nix
- ./eza.nix
- ./git.nix
- ./gpg.nix
- ./ssh.nix
- ./starship
- ./vim.nix
- ];
-
- home.packages = with pkgs; [
- fd
- nix-output-monitor
- nurl
- rclone
- restic
-
- (let
- getchvim = inputs'.getchvim.packages.default;
- in
- # remove desktop file
- symlinkJoin {
- name = "${getchvim.name}-nodesktop";
- paths = [getchvim];
- postBuild = ''
- rm -rf $out/share/{applications,icons}
- '';
- })
- ];
-
- catppuccin.flavour = "mocha";
-
- programs = {
- btop = {
- enable = true;
- catppuccin.enable = true;
- };
-
- direnv = {
- enable = true;
- nix-direnv.enable = true;
- };
-
- glamour.catppuccin.enable = true;
-
- ripgrep.enable = true;
-
- nix-index-database.comma.enable = true;
- };
-
- xdg.enable = true;
-}
diff --git a/users/seth/programs/eza.nix b/users/seth/programs/eza.nix
deleted file mode 100644
index 0b63d54..0000000
--- a/users/seth/programs/eza.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- programs.eza = {
- enable = true;
- enableAliases = true;
- icons = true;
- };
-}
diff --git a/users/seth/programs/firefox/arkenfox.nix b/users/seth/programs/firefox/arkenfox.nix
deleted file mode 100644
index a6f6d46..0000000
--- a/users/seth/programs/firefox/arkenfox.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{lib, ...}: {
- programs.firefox = {
- arkenfox = {
- enable = true;
- version = "119.0";
- };
-
- profiles.arkenfox.arkenfox = let
- enableSections = sections: lib.genAttrs sections (_: {enable = true;});
- in
- lib.recursiveUpdate {
- enable = true;
-
- # enable safe browsing
- "0400"."0403"."browser.safebrowsing.downloads.remote.enabled".value = true;
-
- # fix hulu
- "1200"."1201"."security.ssl.require_safe_negotiation".value = false;
-
- "2600"."2651"."browser.download.useDownloadDir" = {
- enable = true;
- value = true;
- };
-
- # disable rfp letterboxing
- "4500"."4504"."privacy.resistFingerprinting.letterboxing".value = false;
-
- "5000" = {
- "5003"."signon.rememberSignons".enable = true;
- # enable search autocomplete
- "5021"."keyword.enabled".value = true;
- };
- } (enableSections [
- "0100"
- "0200"
- "0300"
- "0400"
- "0600"
- "0700"
- "0800"
- "0900"
- "1000"
- "1200"
- "1600"
- "1700"
- "2000"
- "2400"
- "2600"
- "2700"
- "2800"
- "4500"
- ]);
- };
-}
diff --git a/users/seth/programs/firefox/default.nix b/users/seth/programs/firefox/default.nix
deleted file mode 100644
index 702193c..0000000
--- a/users/seth/programs/firefox/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- config,
- inputs',
- ...
-}: {
- imports = [
- ./arkenfox.nix
- ];
-
- home.sessionVariables = {
- MOZ_ENABLE_WAYLAND = "1";
- };
-
- programs.firefox = {
- inherit (config.desktop) enable;
- profiles.arkenfox = {
- extensions = with inputs'.firefox-addons.packages; [
- bitwarden
- floccus
- ublock-origin
- ];
-
- isDefault = true;
-
- settings = {
- # disable firefox accounts & pocket
- "extensions.pocket.enabled" = false;
- "identity.fxaccounts.enabled" = false;
-
- # hw accel
- "media.ffmpeg.vaapi.enabled" = true;
-
- # widevine drm
- "media.gmp-widevinecdm.enabled" = true;
- };
- };
- };
-}
diff --git a/users/seth/programs/git.nix b/users/seth/programs/git.nix
deleted file mode 100644
index 2cc3bfa..0000000
--- a/users/seth/programs/git.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- programs = {
- gh = {
- enable = true;
- settings = {
- git_protocol = "https";
- editor = "nvim";
- prompt = "enabled";
- # workaround for https://github.com/nix-community/home-manager/issues/474
- version = 1;
- };
-
- gitCredentialHelper = {
- enable = true;
- hosts = ["https://github.com" "https://github.example.com"];
- };
- };
-
- git = {
- enable = true;
-
- difftastic = {
- enable = true;
- background = "dark";
- display = "inline";
- };
-
- extraConfig = {
- init = {defaultBranch = "main";};
- };
-
- signing = {
- key = "D31BD0D494BBEE86";
- signByDefault = true;
- };
-
- userEmail = "[email protected]";
- userName = "seth";
- };
- };
-}
diff --git a/users/seth/programs/gpg.nix b/users/seth/programs/gpg.nix
deleted file mode 100644
index ff94e36..0000000
--- a/users/seth/programs/gpg.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- lib,
- pkgs,
- osConfig,
- ...
-}: {
- programs.gpg.enable = true;
-
- services.gpg-agent = lib.mkIf pkgs.stdenv.isLinux {
- enable = true;
-
- pinentryFlavor =
- if osConfig ? programs
- then osConfig.programs.gnupg.agent.pinentryFlavor or "curses"
- else "curses";
- };
-}
diff --git a/users/seth/programs/mangohud.nix b/users/seth/programs/mangohud.nix
deleted file mode 100644
index fcdad87..0000000
--- a/users/seth/programs/mangohud.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{config, ...}: {
- programs.mangohud = {
- inherit (config.desktop) enable;
- settings = {
- legacy_layout = false;
- cpu_stats = true;
- cpu_temp = true;
- gpu_stats = true;
- gpu_temp = true;
- fps = true;
- frametime = true;
- media_player = true;
- media_player_name = "spotify";
- };
- };
-}
diff --git a/users/seth/programs/ssh.nix b/users/seth/programs/ssh.nix
deleted file mode 100644
index 627453e..0000000
--- a/users/seth/programs/ssh.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- config,
- pkgs,
- ...
-}: {
- programs.ssh = {
- enable = true;
- package = pkgs.openssh;
-
- matchBlocks = let
- sshDir = "${config.home.homeDirectory}/.ssh";
- in {
- # git forges
- "codeberg.org" = {
- identityFile = "${sshDir}/codeberg";
- user = "git";
- };
-
- # linux packaging
- "aur.archlinux.org" = {
- identityFile = "${sshDir}/aur";
- user = "aur";
- };
-
- "pagure.io" = {
- identityFile = "${sshDir}/copr";
- user = "git";
- };
-
- # router
- "192.168.1.1" = {
- identityFile = "${sshDir}/openwrt";
- user = "root";
- };
-
- # servers
- "atlas".user = "atlas";
- };
- };
-
- services.ssh-agent.enable = pkgs.stdenv.isLinux;
-}
diff --git a/users/seth/programs/starship/default.nix b/users/seth/programs/starship/default.nix
deleted file mode 100644
index a1b9104..0000000
--- a/users/seth/programs/starship/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- programs.starship = {
- enable = true;
-
- enableBashIntegration = false;
- enableZshIntegration = false;
-
- settings =
- {
- format = "$all";
- palette = "catppuccin_mocha";
- command_timeout = 250;
- }
- // fromTOML (builtins.readFile ./starship.toml);
- };
-}
diff --git a/users/seth/programs/vim.nix b/users/seth/programs/vim.nix
deleted file mode 100644
index d73c131..0000000
--- a/users/seth/programs/vim.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{config, ...}: let
- inherit (config.xdg) configHome dataHome stateHome;
-in {
- programs.vim = {
- enable = true;
- settings = {
- expandtab = false;
- shiftwidth = 2;
- tabstop = 2;
- };
- extraConfig = ''
- " https://wiki.archlinux.org/title/XDG_Base_Directory
- set runtimepath^=${configHome}/vim
- set runtimepath+=${dataHome}/vim
- set runtimepath+=${configHome}/vim/after
-
- set packpath^=${dataHome}/vim,${configHome}/vim
- set packpath+=${configHome}/vim/after,${dataHome}/vim/after
- set packpath^=${dataHome}/vim,${configHome}/vim
- set packpath+=${configHome}/vim/after,${dataHome}/vim/after
-
- let g:netrw_home = "${dataHome}/vim"
- call mkdir("${dataHome}/vim/spell", 'p')
-
- set backupdir=${stateHome}/vim/backup | call mkdir(&backupdir, 'p')
- set directory=${stateHome}/vim/swap | call mkdir(&directory, 'p')
- set undodir=${stateHome}/vim/undo | call mkdir(&undodir, 'p')
- set viewdir=${stateHome}/vim/view | call mkdir(&viewdir, 'p')
- set viminfofile=${stateHome}/vim/viminfo
- '';
- };
-}
diff --git a/users/seth/programs/vscode.nix b/users/seth/programs/vscode.nix
deleted file mode 100644
index 8aec6aa..0000000
--- a/users/seth/programs/vscode.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- config,
- pkgs,
- ...
-}: {
- programs.vscode = {
- inherit (config.desktop) enable;
- package = pkgs.vscode.fhs;
- };
-}
diff --git a/users/seth/shell/bash.nix b/users/seth/shell/bash.nix
deleted file mode 100644
index 46c03d4..0000000
--- a/users/seth/shell/bash.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{config, ...}: {
- programs.bash = {
- enable = true;
- # TODO: find out if i need this anymore with standalone HM
- bashrcExtra = ''
- nixfile=${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
- [ -e "$nixfile" ] && source "$nixfile"
- '';
- historyFile = "${config.xdg.stateHome}/bash/history";
- historyFileSize = 1000;
- historySize = 100;
- shellOptions = [
- "cdspell"
- "checkjobs"
- "checkwinsize"
- "dirspell"
- "globstar"
- "histappend"
- "no_empty_cmd_completion"
- ];
- };
-}
diff --git a/users/seth/shell/default.nix b/users/seth/shell/default.nix
deleted file mode 100644
index 49192ce..0000000
--- a/users/seth/shell/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{config, ...}: {
- imports = [
- ./bash.nix
- ./fish.nix
- ];
-
- home = {
- sessionVariables = rec {
- EDITOR = "nvim";
- VISUAL = EDITOR;
- CARGO_HOME = "${config.xdg.dataHome}/cargo";
- LESSHISTFILE = "${config.xdg.stateHome}/less/history";
- };
-
- shellAliases = {
- diff = "diff --color=auto";
- g = "git";
- gs = "g status";
- };
- };
-}
diff --git a/users/seth/shell/fish.nix b/users/seth/shell/fish.nix
deleted file mode 100644
index 279b021..0000000
--- a/users/seth/shell/fish.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}: {
- programs.fish = {
- enable = true;
- catppuccin.enable = true;
-
- interactiveShellInit = ''
- set -l nixfile ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish
- if test -e $nixfile
- source $nixfile
- end
-
- ${lib.getExe pkgs.nix-your-shell} fish | source
-
- abbr -a !! --position anywhere --function last_history_item
- '';
-
- functions = {
- last_history_item.body = "echo $history[1]";
- };
-
- shellAbbrs = {
- nixgc = "sudo nix-collect-garbage -d && nix-collect-garbage -d";
- };
-
- plugins = let
- mkFishPlugins = builtins.map (plugin: {
- name = plugin;
- inherit (pkgs.fishPlugins.${plugin}) src;
- });
- in
- mkFishPlugins [
- "autopair"
- ];
- };
-}
diff --git a/users/seth/shell/nu.nix b/users/seth/shell/nu.nix
deleted file mode 100644
index 1437a97..0000000
--- a/users/seth/shell/nu.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- config,
- lib,
- inputs,
- ...
-}: let
- theme = "catppuccin-${config.catppuccin.flavour}";
-in {
- programs = {
- nushell = {
- enable = true;
-
- configFile.text = ''
- def "nixgc" [] {
- sudo nix-collect-garbage -d; nix-collect-garbage -d
- }
- '';
-
- envFile.text = ''
- use ${inputs.nu-scripts}/themes/nu-themes/${theme}.nu
- $env.config.color_config = (${theme})
- '';
-
- inherit (config.home) shellAliases;
- };
-
- bash.initExtra = lib.mkAfter ''
- if [[ $(ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then
- exec ${lib.getExe config.programs.nushell.package}
- fi
- '';
-
- # builtin `ls` is good here!
- eza.enable = lib.mkForce false;
- };
-}
diff --git a/users/seth/shell/zsh.nix b/users/seth/shell/zsh.nix
deleted file mode 100644
index 2842a1f..0000000
--- a/users/seth/shell/zsh.nix
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}: {
- programs.zsh = {
- enable = true;
- enableAutosuggestions = true;
-
- completionInit = ''
- autoload -Uz bashcompinit compinit
- local zdump="${config.xdg.cacheHome}/zsh/zdump"
- bashcompinit
- compinit -d "$zdump"
- if [[ ! "$zdump.zwc" -nt "$zdump" ]]
- then
- zcompile "$zdump"
- fi
- unset zdump
- '';
-
- defaultKeymap = "emacs";
- dotDir = ".config/zsh";
-
- initExtra = ''
- if [[ -r "$XDG_CACHE_HOME/p10k-instant-prompt-*.zsh" ]]; then
- source "$XDG_CACHE_HOME/p10k-instant-prompt-*.zsh"
- fi
- autoload -Uz promptinit colors
- promptinit
- colors
-
- ${lib.getExe pkgs.nix-your-shell} zsh | source /dev/stdin
-
- zmodload zsh/zutil
- zmodload zsh/complist
- zstyle ":completion::*" group-name ""
- zstyle ":completion:*" menu "select"
- zstyle ":completion:*" squeeze-slashes "true"
- zstyle ":completion::*" use-cache "true"
- zstyle ":completion::*" cache-path "$zdump"
-
- unsetopt beep
- unsetopt hist_beep
- unsetopt ignore_braces
- unsetopt list_beep
- setopt always_to_end
- setopt prompt_subst
- setopt share_history
-
- # clear backbuffer with ctrl-l
- function clear-screen-and-scrollback() {
- echoti civis >"$TTY"
- printf '%b' '\e[H\e[2J' >"$TTY"
- zle .reset-prompt
- zle -R
- printf '%b' '\e[3J' >"$TTY"
- echoti cnorm >"$TTY"
- }
-
- zle -N clear-screen-and-scrollback
- bindkey '^L' clear-screen-and-scrollback
-
- [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
- '';
-
- history = {
- expireDuplicatesFirst = true;
- path = "${config.xdg.stateHome}/zsh/zsh_history";
- save = 1000;
- size = 100;
- };
-
- plugins = [
- {
- name = "cattppuccin-zsh-syntax-highlighting";
- src = pkgs.fetchFromGitHub {
- owner = "catppuccin";
- repo = "zsh-syntax-highlighting";
- rev = "06d519c20798f0ebe275fc3a8101841faaeee8ea";
- sha256 = "sha256-Q7KmwUd9fblprL55W0Sf4g7lRcemnhjh4/v+TacJSfo=";
- };
-
- file = "themes/catppuccin_mocha-zsh-syntax-highlighting.zsh";
- }
-
- {
- name = "nix-zsh-completions";
- src = pkgs.nix-zsh-completions;
- file = "share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh";
- }
-
- {
- name = "powerlevel10k";
- src = pkgs.zsh-powerlevel10k;
- file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
- }
-
- {
- name = "zsh-autopair";
- src = pkgs.zsh-autopair;
- file = "share/zsh/zsh-autopair/autopair.zsh";
- }
-
- {
- name = "zsh-completions";
- src = pkgs.zsh-completions;
- file = "share/zsh-completions/zsh-completions.plugin.zsh";
- }
- ];
-
- enableSyntaxHighlighting = true;
- };
-}
diff --git a/users/seth/system.nix b/users/seth/system.nix
deleted file mode 100644
index 3d1c2ba..0000000
--- a/users/seth/system.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}: {
- users.users.seth =
- {
- shell = pkgs.fish;
- home =
- if pkgs.stdenv.isDarwin
- then "/Users/seth"
- else "/home/seth";
- }
- // lib.optionalAttrs pkgs.stdenv.isLinux {
- extraGroups = ["wheel"];
- isNormalUser = true;
- hashedPasswordFile = config.age.secrets.sethPassword.path;
- };
-
- programs.fish.enable = true;
-
- home-manager.users.seth = {
- imports =
- [
- ./.
- ]
- ++ lib.optionals pkgs.stdenv.isLinux [
- ./desktop
- ./programs/chromium.nix
- ./programs/firefox
- ./programs/mangohud.nix
- ./programs/vscode.nix
- ];
- };
-}