This commit is contained in:
Finn Linck Ryan 2026-01-11 01:42:54 +00:00
commit aae151cee6
33 changed files with 1351 additions and 0 deletions

3
modules/nixos/default.nix Executable file
View file

@ -0,0 +1,3 @@
{
shells = import ./shells;
}

View file

@ -0,0 +1,8 @@
{ ...
}:
{
imports = [
./fish.nix
];
}

34
modules/nixos/shells/fish.nix Executable file
View file

@ -0,0 +1,34 @@
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.custom.shells.fish;
in
{
options.custom.shells.fish = {
enable = lib.mkEnableOption "Enable the Fish shell.";
defaultFor = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Users to set Fish as their default shell. If set the shell must be enabled.";
};
};
config = {
# Actually enable and assign the shell
programs = lib.mkIf cfg.enable {
fish.enable = true;
};
users.users = lib.mkIf cfg.enable (
lib.genAttrs cfg.defaultFor (user: {
shell = lib.mkOverride 900 "${pkgs.fish}/bin/fish";
})
);
};
}