-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
126 lines (110 loc) · 2.83 KB
/
Copy pathflake.nix
File metadata and controls
126 lines (110 loc) · 2.83 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
description = "Simple shells called baseshells";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
inputs@{ flake-parts, ... }:
let
version = "1.1.0";
repo = "https://github.com/TureBentzin/baseshell";
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ ];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{ pkgs, ... }:
let
shell = pkgs.fish;
baseShellLicense = pkgs.stdenv.mkDerivation {
pname = "baseshell-license";
inherit version;
src = ./.;
installPhase = ''
mkdir -p $out/bin
cp $src/LICENSE.md $out/LICENSE.md
cat > $out/bin/baseshell-license << EOF
#!/usr/bin/env bash
echo "Baseshell version ${version} is licensed under the MIT-License:"
echo
cat "$out/LICENSE.md"
echo
echo "The source is available at: ${repo}"
EOF
chmod +x $out/bin/baseshell-license
'';
};
editors = with pkgs; [
nano
helix
vim
];
git = pkgs.gitFull;
programs = with pkgs; [
htop
btop
direnv
];
tools = with pkgs; [
tree
openssh
];
default-packages = [
shell
git
baseShellLicense
]
++ editors
++ programs
++ tools;
minimal-packages =
with pkgs;
[
helix
htop
git
direnv
tree
]
++ [
shell
baseShellLicense
]
++ tools;
mkShell =
name: packages:
pkgs.mkShell {
name = "baseshell-${name}";
inherit packages version;
shellHook = ''
echo "Thank you for using baseshell! (https://github.com/TureBentzin/baseshell.git)"
'';
};
in
{
devShells = {
default = mkShell "default" default-packages;
minimal = mkShell "minimal" minimal-packages;
};
};
flake = {
meta = {
description = "Very simple devshell environments built around the fish shell.";
homepage = repo;
license = "MIT";
maintainers = [
{
name = "Ture Bentzin";
github = "TureBentzin";
}
];
};
};
};
}