init
This commit is contained in:
commit
aae151cee6
33 changed files with 1351 additions and 0 deletions
3
modules/nixos/default.nix
Executable file
3
modules/nixos/default.nix
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
shells = import ./shells;
|
||||
}
|
||||
8
modules/nixos/shells/default.nix
Executable file
8
modules/nixos/shells/default.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ ...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
];
|
||||
}
|
||||
34
modules/nixos/shells/fish.nix
Executable file
34
modules/nixos/shells/fish.nix
Executable 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";
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue