diff options
| -rw-r--r-- | core/env.nix | 14 | ||||
| -rw-r--r-- | snowfall/modules/nixos/apps/bash/default.nix | 28 | ||||
| -rw-r--r-- | snowfall/modules/nixos/apps/bash/git-prompt.sh (renamed from core/bash/git-prompt.sh) | 0 | ||||
| -rw-r--r-- | snowfall/modules/nixos/apps/bash/prompt.sh (renamed from core/bash/prompt.sh) | 0 | ||||
| -rw-r--r-- | snowfall/modules/nixos/suites/common/default.nix | 17 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/c-pc/default.nix | 4 |
6 files changed, 49 insertions, 14 deletions
diff --git a/core/env.nix b/core/env.nix index f39f087..e67c555 100644 --- a/core/env.nix +++ b/core/env.nix @@ -4,20 +4,6 @@ environment = { localBinInPath = true; - #TODO: migrate to writeShellScriptBin - interactiveShellInit = '' - source "${./bash}/prompt.sh" - - alias lsa="ls -lAsh" - alias c="codium ." - alias p="nix-shell -p" - - mkcd() { - mkdir -p "$1" - cd "$1" - } - ''; - variables = { EDITOR = "${pkgs.vim}/bin/vim"; }; diff --git a/snowfall/modules/nixos/apps/bash/default.nix b/snowfall/modules/nixos/apps/bash/default.nix new file mode 100644 index 0000000..7589cfb --- /dev/null +++ b/snowfall/modules/nixos/apps/bash/default.nix @@ -0,0 +1,28 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.apps.bash; +in { + options.${namespace}.apps.bash = with types; { + enable = mkEnableOption "bash"; + }; + + config = mkIf cfg.enable { + #TODO: add c="codium ." alias + programs.bash = { + shellAliases = { + lsa = "ls -lAsh"; + p = "nix-shell -p"; + }; + + interactiveShellInit = '' + source "${./prompt.sh}" + + mkcd() { + mkdir -p "$1" + cd "$1" + } + ''; + }; + }; +} diff --git a/core/bash/git-prompt.sh b/snowfall/modules/nixos/apps/bash/git-prompt.sh index 5330e76..5330e76 100644 --- a/core/bash/git-prompt.sh +++ b/snowfall/modules/nixos/apps/bash/git-prompt.sh diff --git a/core/bash/prompt.sh b/snowfall/modules/nixos/apps/bash/prompt.sh index ff3ebe0..ff3ebe0 100644 --- a/core/bash/prompt.sh +++ b/snowfall/modules/nixos/apps/bash/prompt.sh diff --git a/snowfall/modules/nixos/suites/common/default.nix b/snowfall/modules/nixos/suites/common/default.nix new file mode 100644 index 0000000..0090ba3 --- /dev/null +++ b/snowfall/modules/nixos/suites/common/default.nix @@ -0,0 +1,17 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.suites.common; +in { + options.${namespace}.suites.common = with types; { + enable = mkEnableOption "common"; + }; + + config = mkIf cfg.enable { + cxl = { + apps = { + bash.enable = true; + }; + }; + }; +} diff --git a/snowfall/systems/x86_64-linux/c-pc/default.nix b/snowfall/systems/x86_64-linux/c-pc/default.nix index 044d01f..201c999 100644 --- a/snowfall/systems/x86_64-linux/c-pc/default.nix +++ b/snowfall/systems/x86_64-linux/c-pc/default.nix @@ -11,6 +11,10 @@ with lib; with lib.${namespace}; { hostname = "c-pc"; id = "23ce94ff"; }; + + suites = { + common.enable = true; + }; }; system.stateVersion = "23.11"; |