-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
117 lines (110 loc) · 2.45 KB
/
shell.nix
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
{ mkShell
, nixpkgs-fmt
, nil
, shellcheck
, shfmt
, lib
, writeShellApplication
, nh
, python3
, gst_all_1
, pipenv
, coreutils
, docker
, act
, libsForQt5
, sddm
, nix
, haskell-language-server
, cabal-install
, kdePackages
, haskellPackages
, ...
}:
with lib;
let
testGithubActions = writeShellApplication
{
name = "testGithubActions";
runtimeInputs = [ coreutils docker act ];
text = ''
function stop_docker {
CONTAINER_IDS=$(docker ps | tail -n +2)
if [ -n "$CONTAINER_IDS" ]; then
echo "Stopping and cleaning docker from act staff"
echo "$CONTAINER_IDS" | cut -f 1 -d " " | tail -n +2 | xargs docker stop > /dev/null
echo "$CONTAINER_IDS" | xargs docker rm > /dev/null
fi
}
trap stop_docker SIGINT
act --use-gitignore -q --rm -W "$NIX_DOTFILES/.github/workflows" -C "$NIX_DOTFILES"
stop_docker
'';
};
testSddmTheme = writeShellApplication
{
name = "testSddmTheme";
runtimeInputs =
let
gstreamerDeps = with gst_all_1; [
gstreamer
gst-plugins-ugly
gst-plugins-bad
gst-plugins-good
gst-plugins-base
gst-libav
];
plasmaDeps = with libsForQt5; [
plasma-framework
plasma-workspace
kdePackages.sddm
];
qt5Deps = with libsForQt5.qt5; [
qtgraphicaleffects
qtquickcontrols2
qtbase
qtsvg
qtmultimedia
libsForQt5.phonon-backend-gstreamer
];
in
[ coreutils sddm nix ] ++ qt5Deps ++ plasmaDeps ++ gstreamerDeps;
text = ''
THEME_DIR="./pkgs/sddm/theme/$1";
if [ ! -d "$THEME_DIR" ]; then
echo "SDDM theme $THEME_DIR wasn't found"
exit 1
fi
nix build "$NIX_DOTFILES#$1"
sddm-greeter --test-mode --theme "$NIX_DOTFILES/result/share/sddm/themes/$1"
'';
};
xmonadDevDeps = haskellPackages.ghcWithPackages (pkgs: with pkgs; [
xmonad
xmonad-contrib
xmonad-extras
xmobar
]);
in
mkShell {
nativeBuildInputs = [
# Nix
nixpkgs-fmt
nil
nh
# Bash
shellcheck
shfmt
# Desktop
testGithubActions
testSddmTheme
# Python
python3
pipenv
# Haskell deps
# haskell-language-server
# cabal-install
# Xmonad
# xmonadDevDeps
];
}