aboutsummaryrefslogtreecommitdiff
path: root/nixos.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-03-21 18:19:32 +0100
committerKarel Kočí <cynerd@email.cz>2023-03-21 20:46:05 +0100
commit7be0acbb1cd6b6d3c4c3df95611cb86be4b46915 (patch)
treefcdca6619a05b1e72ebb8b9ddf0d04586b434e94 /nixos.nix
parentf0eab21bab34beb657059cf5dfe91ca8072edb35 (diff)
downloadshellrc-7be0acbb1cd6b6d3c4c3df95611cb86be4b46915.tar.gz
shellrc-7be0acbb1cd6b6d3c4c3df95611cb86be4b46915.tar.bz2
shellrc-7be0acbb1cd6b6d3c4c3df95611cb86be4b46915.zip
Drop desktop variant and rework nix packages
Diffstat (limited to 'nixos.nix')
-rw-r--r--nixos.nix49
1 files changed, 8 insertions, 41 deletions
diff --git a/nixos.nix b/nixos.nix
index 4dc23c9..ca4edd2 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -8,56 +8,23 @@ with lib; let
cnf = config.programs.shellrc;
zshEnable = config.programs.zsh.enable;
in {
- options = {
- programs.shellrc = {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = "If shellrc should be enabled.";
- };
- desktop = mkOption {
- type = types.bool;
- default = false;
- description = "If shellrc's desktop specific files should be used.";
- };
- };
- };
+ options.programs.shellrc = mkEnableOption "shellrc";
config = mkMerge [
{
nixpkgs.overlays = overlays;
+ }
+ (mkIf cnf {
+ # Disable default prompt as we have our own
+ programs.bash.promptInit = "";
+ programs.zsh.promptInit = ""; # Disable default prompt as we have our own
- environment.pathsToLink = ["/etc/shellrc.d" "/etc/bashrc.d"] ++ optional zshEnable "/etc/zshrc.d";
programs.bash.interactiveShellInit = ''
- # Load files provided by packages
- for p in $NIX_PROFILES; do
- [ -e $p/etc/bashrc.d ] || continue
- for file in $p/etc/bashrc.d/*; do
- [ -f "$file" ] || continue
- . "$file"
- done
- done
+ eval $(${pkgs.shellrc-bash}/bin/shellrc-bash)
'';
programs.zsh.interactiveShellInit = mkIf zshEnable ''
- # Load files provided by packages
- for p in ''${=NIX_PROFILES}; do
- [ -e $p/etc/zshrc.d ] || continue
- for file in $p/etc/zshrc.d/*; do
- [ -f "$file" ] || continue
- . "$file"
- done
- done
+ eval $(${pkgs.shellrc-zsh}/bin/shellrc-zsh)
'';
- }
- (mkIf cnf.enable {
- environment.systemPackages =
- [pkgs.shellrc-generic pkgs.shellrc-bash]
- ++ optional cnf.desktop pkgs.shellrc-desktop
- ++ optional zshEnable pkgs.shellrc-zsh;
-
- # Disable default prompt as we have our own
- programs.bash.promptInit = "";
- programs.zsh.promptInit = ""; # Disable default prompt as we have our own
})
];
}