tangled
alpha
login
or
join now
encode42.dev
/
nixos
0
fork
atom
Personal-use NixOS configuration
0
fork
atom
overview
issues
pulls
pipelines
Create development shells
encode42.dev
5 days ago
e07059ae
a1a60501
+111
-5
7 changed files
expand all
collapse all
unified
split
homes
encode42
common
fish.nix
hosts
encryption
homes
encode42.nix
outputs.nix
shells
default.nix
ffmpeg.nix
magick.nix
packwiz.nix
+12
-1
homes/encode42/common/fish.nix
···
1
1
-
{ pkgs, ... }:
1
1
+
{
2
2
+
flakeRoot,
3
3
+
pkgs,
4
4
+
lib,
5
5
+
...
6
6
+
}:
2
7
3
8
{
4
9
programs.fish = {
···
14
19
interactiveShellInit = ''
15
20
set fish_greeting # Disable greeting
16
21
'';
22
22
+
23
23
+
functions = {
24
24
+
develop = ''
25
25
+
nix develop ${flakeRoot}#$argv[1] --command ${lib.getExe pkgs.fish}
26
26
+
'';
27
27
+
};
17
28
};
18
29
}
+2
-2
homes/encode42/common/imagemagik.nix
shells/magick.nix
···
1
1
{ pkgs, ... }:
2
2
3
3
-
{
4
4
-
home.packages = with pkgs; [
3
3
+
pkgs.mkShell {
4
4
+
packages = with pkgs; [
5
5
(imagemagick.override {
6
6
libpngSupport = true;
7
7
libjpegSupport = true;
-2
hosts/encryption/homes/encode42.nix
···
42
42
(flakeRoot + /homes/encode42/common/github.nix)
43
43
(flakeRoot + /homes/encode42/common/ssh.nix)
44
44
45
45
-
(flakeRoot + /homes/encode42/common/imagemagik.nix)
46
46
-
47
45
(flakeRoot + /homes/encode42/desktop/environments/gnome.nix)
48
46
49
47
(flakeRoot + /homes/encode42/desktop/jetbrains/rider.nix)
+2
outputs.nix
···
33
33
34
34
checks = overlayAllSystems ./tests;
35
35
36
36
+
devShells = overlayAllSystems ./shells;
37
37
+
36
38
nixosConfigurations = {
37
39
encryption = mkSystem {
38
40
hostName = "encryption";
+27
shells/default.nix
···
1
1
+
{ flake, pkgs }:
2
2
+
3
3
+
let
4
4
+
mkAliases =
5
5
+
aliases:
6
6
+
pkgs.lib.mapAttrsToList (
7
7
+
name: cmd:
8
8
+
pkgs.writeShellScriptBin name ''
9
9
+
set -euo pipefail
10
10
+
11
11
+
${cmd}
12
12
+
''
13
13
+
) aliases;
14
14
+
15
15
+
mkShell =
16
16
+
path:
17
17
+
import path {
18
18
+
inherit flake pkgs mkAliases;
19
19
+
20
20
+
lib = pkgs.lib;
21
21
+
};
22
22
+
in
23
23
+
{
24
24
+
ffmpeg = mkShell ./ffmpeg.nix;
25
25
+
magick = mkShell ./magick.nix;
26
26
+
packwiz = mkShell ./packwiz.nix;
27
27
+
}
+45
shells/ffmpeg.nix
···
1
1
+
{
2
2
+
pkgs,
3
3
+
lib,
4
4
+
mkAliases,
5
5
+
...
6
6
+
}:
7
7
+
8
8
+
let
9
9
+
ffmpegExe = lib.getExe pkgs.ffmpeg;
10
10
+
11
11
+
aliases = {
12
12
+
opus = ''
13
13
+
INPUT_FILE_NAME="$1"
14
14
+
TEMPORARY_FILE_NAME="/tmp/''${1%.*}.opus"
15
15
+
TARGET_FILE_NAME="''${1%.*}.m4a"
16
16
+
17
17
+
BITRATE="''${2:-128k}"
18
18
+
19
19
+
${ffmpegExe} -i $INPUT_FILE_NAME \
20
20
+
-map_metadata -1 \
21
21
+
-fflags +bitexact \
22
22
+
-flags:v +bitexact \
23
23
+
-flags:a +bitexact \
24
24
+
-b:a $BITRATE \
25
25
+
-c:a libopus \
26
26
+
$TEMPORARY_FILE_NAME
27
27
+
28
28
+
${ffmpegExe} -i $TEMPORARY_FILE_NAME \
29
29
+
-c:a copy \
30
30
+
-f mp4 \
31
31
+
$TARGET_FILE_NAME
32
32
+
33
33
+
rm $TEMPORARY_FILE_NAME
34
34
+
'';
35
35
+
};
36
36
+
in
37
37
+
pkgs.mkShell {
38
38
+
packages =
39
39
+
with pkgs;
40
40
+
[
41
41
+
ffmpeg
42
42
+
rsgain
43
43
+
]
44
44
+
++ (mkAliases aliases);
45
45
+
}
+23
shells/packwiz.nix
···
1
1
+
{
2
2
+
pkgs,
3
3
+
lib,
4
4
+
mkAliases,
5
5
+
...
6
6
+
}:
7
7
+
8
8
+
let
9
9
+
packwizExe = lib.getExe pkgs.packwiz;
10
10
+
11
11
+
aliases = {
12
12
+
ma = "${packwizExe} modrinth add";
13
13
+
ca = "${packwizExe} curseforge add";
14
14
+
};
15
15
+
in
16
16
+
pkgs.mkShell {
17
17
+
packages =
18
18
+
with pkgs;
19
19
+
[
20
20
+
packwiz
21
21
+
]
22
22
+
++ (mkAliases aliases);
23
23
+
}