-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (66 loc) · 2.44 KB
/
flake.nix
File metadata and controls
69 lines (66 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "DevOps dev shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgsUnfree = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowAliases = true;
};
};
defaultPackages = with pkgs; [
fish
wget
curl
shellcheck
unzip
htop
btop
nano
cacert
gnupg
ncdu
git
neofetch
nodejs
yq
(writeShellScriptBin "nixhelp" (builtins.readFile ./scripts/nixhelp))
];
shellCustom = profileName: ''
export NIXPKGS_PROFILE="${profileName}"
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
if [ "$color_prompt" = yes ]; then
export PS1="\[\033[90m\][$NIXPKGS_PROFILE]\[\033[0m\] $PS1"
else
export PS1="[$NIXPKGS_PROFILE] $PS1"
fi
'';
fishLaunch = ''
# Launch Fish if available and not already in Fish
if command -v fish >/dev/null 2>&1 && [ "$SHELL" != "$(command -v fish)" ]; then
exec fish
fi
'';
in
{
devShells = {
default = import ./shells/default.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "default"; inherit fishLaunch; };
python = import ./shells/python.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "python"; inherit fishLaunch; };
docker = import ./shells/docker.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "docker"; inherit fishLaunch; };
hugo = import ./shells/hugo.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "hugo"; inherit fishLaunch; };
devops = import ./shells/devops.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "devops"; inherit fishLaunch; };
ai = import ./shells/ai.nix { inherit pkgs defaultPackages; shellCustom = shellCustom "ai"; inherit fishLaunch; };
kotlin = import ./shells/kotlin.nix { pkgs = pkgsUnfree; inherit defaultPackages; shellCustom = shellCustom "kotlin"; inherit fishLaunch; };
};
}
);
}