-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(modules/home): brain damage, pt 1
- Loading branch information
Showing
6 changed files
with
167 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
{ | ||
inputs, | ||
lib, | ||
config, | ||
pkgs, | ||
... | ||
}: let | ||
inherit (inputs.nix-index-database.hmModules) nix-index; | ||
inherit (lib) mkIf mkOption types; | ||
|
||
cfg = config.sysc.comma; | ||
in { | ||
imports = [nix-index]; | ||
|
||
home.packages = with pkgs; [comma]; | ||
options.sysc.comma = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable Comma."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
home.packages = with pkgs; [comma]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
{pkgs, ...}: { | ||
home.packages = with pkgs; [nodejs] ++ (with nodePackages; [yarn pnpm]); | ||
{ | ||
pkgs, | ||
lib, | ||
config, | ||
... | ||
}: let | ||
inherit (lib) mkIf mkOption types; | ||
|
||
cfg = config.sysc.dev; | ||
in { | ||
options.sysc.dev = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to set-up dev tools."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
home.packages = with pkgs; [nodejs] ++ (with nodePackages; [yarn pnpm]); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,32 @@ | ||
{ | ||
programs.direnv = { | ||
enable = true; | ||
nix-direnv.enable = true; | ||
lib, | ||
config, | ||
... | ||
}: let | ||
inherit (lib) mkIf mkOption types; | ||
|
||
cfg = config.sysc.direnv; | ||
in { | ||
options.sysc.direnv = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable direnv."; | ||
}; | ||
|
||
enableNixDirenv = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable nix-direnv integration."; | ||
}; | ||
}; | ||
|
||
home.persistence."/persist/home/bddvlpr".directories = [".local/share/direnv"]; | ||
config = mkIf cfg.enable { | ||
programs.direnv = { | ||
enable = true; | ||
nix-direnv.enable = cfg.enableNixDirenv; | ||
}; | ||
|
||
home.persistence."/persist/home/bddvlpr".directories = [".local/share/direnv"]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
{ | ||
programs.firefox.enable = true; | ||
lib, | ||
config, | ||
... | ||
}: let | ||
inherit (lib) mkIf mkOption types; | ||
|
||
home = { | ||
sessionVariables.BROWSER = "firefox"; | ||
persistence."/persist/home/bddvlpr" = { | ||
directories = [ | ||
".mozilla/firefox" | ||
]; | ||
cfg = config.sysc.firefox; | ||
in { | ||
options.sysc.firefox = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable firefox."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.firefox.enable = true; | ||
|
||
home = { | ||
sessionVariables.BROWSER = "firefox"; | ||
persistence."/persist/home/bddvlpr" = { | ||
directories = [ | ||
".mozilla/firefox" | ||
]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,59 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
config, | ||
... | ||
}: let | ||
inherit (lib) mkIf mkOption types; | ||
inherit (lib.strings) hasSuffix; | ||
|
||
cfg = config.sysc.fish; | ||
isDarwin = hasSuffix "-darwin" pkgs.system; | ||
in { | ||
programs.fish = { | ||
enable = true; | ||
options.sysc.fish = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable fish."; | ||
}; | ||
}; | ||
|
||
shellAbbrs = let | ||
build-command = | ||
if isDarwin | ||
then "darwin-rebuild --flake ." | ||
else "sudo nixos-rebuild --flake /etc/nixos"; | ||
in { | ||
n = "nix"; | ||
nb = "nix build"; | ||
nbn = "nix build nixpkgs#"; | ||
nf = "nix flake"; | ||
nfu = "nix flake update"; | ||
nfmt = "nix fmt"; | ||
nr = "nix run"; | ||
nrn = "nix run nixpkgs#"; | ||
ns = "nix shell"; | ||
nsn = "nix shell nixpkgs#"; | ||
config = mkIf cfg.enable { | ||
programs.fish = { | ||
enable = true; | ||
|
||
snr = "${build-command} --flake /etc/nixos"; | ||
snrs = "${build-command} switch"; | ||
}; | ||
shellAbbrs = let | ||
build-command = | ||
if isDarwin | ||
then "darwin-rebuild --flake ." | ||
else "sudo nixos-rebuild --flake /etc/nixos"; | ||
in { | ||
n = "nix"; | ||
nb = "nix build"; | ||
nbn = "nix build nixpkgs#"; | ||
nf = "nix flake"; | ||
nfu = "nix flake update"; | ||
nfmt = "nix fmt"; | ||
nr = "nix run"; | ||
nrn = "nix run nixpkgs#"; | ||
ns = "nix shell"; | ||
nsn = "nix shell nixpkgs#"; | ||
|
||
shellAliases = let | ||
inherit (lib) getExe; | ||
in { | ||
ls = "${getExe pkgs.eza} --icons -F -H --group-directories-first --git"; | ||
cat = "${getExe pkgs.bat} -pp --theme=base16"; | ||
}; | ||
snr = "${build-command} --flake /etc/nixos"; | ||
snrs = "${build-command} switch"; | ||
}; | ||
|
||
shellAliases = let | ||
inherit (lib) getExe; | ||
in { | ||
ls = "${getExe pkgs.eza} --icons -F -H --group-directories-first --git"; | ||
cat = "${getExe pkgs.bat} -pp --theme=base16"; | ||
}; | ||
|
||
shellInit = '' | ||
set fish_greeting | ||
export TERM=xterm-256color | ||
''; | ||
shellInit = '' | ||
set fish_greeting | ||
export TERM=xterm-256color | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
{pkgs, ...}: { | ||
programs.git = { | ||
enable = true; | ||
package = pkgs.gitFull; | ||
{ | ||
lib, | ||
config, | ||
pkgs, | ||
... | ||
}: let | ||
inherit (lib) mkIf mkOption types; | ||
|
||
userName = "Luna Simons"; | ||
userEmail = "[email protected]"; | ||
|
||
signing = { | ||
key = "42EDAE8164B99C3A4B835711AB69B6F3380869A8"; | ||
signByDefault = true; | ||
cfg = config.sysc.git; | ||
in { | ||
options.sysc.git = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = true; | ||
description = "Whether to enable git."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
programs.git = { | ||
enable = true; | ||
package = pkgs.gitFull; | ||
|
||
userName = "Luna Simons"; | ||
userEmail = "[email protected]"; | ||
|
||
signing = { | ||
key = "42EDAE8164B99C3A4B835711AB69B6F3380869A8"; | ||
signByDefault = true; | ||
}; | ||
|
||
extraConfig = { | ||
init.defaultBranch = "main"; | ||
push.autoSetupRemote = true; | ||
credential.helper = "libsecret"; | ||
extraConfig = { | ||
init.defaultBranch = "main"; | ||
push.autoSetupRemote = true; | ||
credential.helper = "libsecret"; | ||
}; | ||
}; | ||
}; | ||
} |