let's hope this doesn't break everything :3
This commit is contained in:
parent
608f093290
commit
2f85fb1b3b
21 changed files with 176 additions and 224 deletions
25
modules/applications/default.nix
Normal file
25
modules/applications/default.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.modules.apps;
|
||||
in
|
||||
{
|
||||
options.modules.apps = {
|
||||
enable = lib.mkEnableOption "enable desktop applications";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./firefox.nix
|
||||
./git.nix
|
||||
./kitty.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
modules.apps = {
|
||||
firefox.enable = true;
|
||||
git.enable = true;
|
||||
kitty.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
modules/applications/firefox.nix
Normal file
17
modules/applications/firefox.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.modules.apps.firefox;
|
||||
in
|
||||
{
|
||||
options.modules.apps.firefox = {
|
||||
enable = lib.mkEnableOption "enable firefox";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
# TODO: add some default firefox settings
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
34
modules/applications/git.nix
Normal file
34
modules/applications/git.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.modules.apps.git;
|
||||
in
|
||||
{
|
||||
options.modules.apps.git = {
|
||||
enable = lib.mkEnableOption "enable git";
|
||||
name = lib.mkOption {
|
||||
example = "Jill Doe";
|
||||
description = "the git user Name";
|
||||
type = lib.types.str;
|
||||
};
|
||||
email = lib.mkOption {
|
||||
example = "jilldoe@test.local";
|
||||
description = "the git user Name";
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = cfg.name;
|
||||
userEmail = cfg.email;
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
safe.directory = "/etc/nixos";
|
||||
pull.rebase = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
19
modules/applications/kitty.nix
Normal file
19
modules/applications/kitty.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.modules.apps.kitty;
|
||||
in
|
||||
{
|
||||
options.modules.apps.kitty = {
|
||||
enable = lib.mkEnableOption "enable the kitty terminal emulator";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
confirm_os_window_close = 0;
|
||||
};
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
36
modules/applications/zsh.nix
Normal file
36
modules/applications/zsh.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.modules.apps.zsh;
|
||||
in
|
||||
{
|
||||
options.modules.apps.zsh = {
|
||||
enable = lib.mkEnableOption "enable zsh with oh-my-zsh";
|
||||
enableAliases = lib.mkEnableOption "whether to enable shellAliases";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable=true;
|
||||
enableZshIntegration=true;
|
||||
nix-direnv.enable=true;
|
||||
};
|
||||
programs.zsh = {
|
||||
enable=true;
|
||||
shellAliases = lib.mkIf cfg.enableAliases {
|
||||
ll = "lsd -l";
|
||||
lt = "lsd -l --tree";
|
||||
update = "nix flake update --commit-lock-file $HOME/nixos && sudo nixos-rebuild switch --flake $HOME/nixos";
|
||||
};
|
||||
history = {
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
size = 10000;
|
||||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" ];
|
||||
theme = "frisk";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue