aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-02-04 17:28:45 -0800
committerCaroline Larimore <caroline@larimo.re>2025-04-14 18:58:44 -0700
commite45aca9d0cbda0559fb3c6a8075e029faa9c58ac (patch)
tree17d9e668d56344206247e74ff8ed12e004729193
parentef4b43dfad047cbd3219deaab8f50b8cd4bc1891 (diff)
migration: bash config
-rw-r--r--core/env.nix14
-rw-r--r--snowfall/modules/nixos/apps/bash/default.nix28
-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.nix17
-rw-r--r--snowfall/systems/x86_64-linux/c-pc/default.nix4
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";