2configs
desktops
services
websites
3modules
machines
tools
jellyseekrr
menu
mpv
muchsync
mutt
nvim
passmenu
tornade
wifi-qr
···
100
100
];
101
101
};
102
102
};
103
103
-
machines = nixpkgs.lib.mapAttrs (machineName: _: {
104
104
-
imports = [
105
105
-
./machines/${machineName}/physical.nix
106
106
-
];
107
107
-
}) (nixpkgs.lib.filterAttrs (machineName: _: builtins.pathExists ./machines/${machineName}/physical.nix) (builtins.readDir ./machines));
103
103
+
machines =
104
104
+
nixpkgs.lib.mapAttrs
105
105
+
(machineName: _: {
106
106
+
imports = [
107
107
+
./machines/${machineName}/physical.nix
108
108
+
];
109
109
+
})
110
110
+
(
111
111
+
nixpkgs.lib.filterAttrs (
112
112
+
machineName: _: builtins.pathExists ./machines/${machineName}/physical.nix
113
113
+
) (builtins.readDir ./machines)
114
114
+
);
108
115
};
109
116
in
110
117
flake-parts.lib.mkFlake { inherit inputs; } {
···
114
121
"aarch64-darwin"
115
122
"x86_64-darwin"
116
123
];
117
117
-
imports = [
118
118
-
./formatter.nix
119
119
-
] ++ (
120
120
-
# Auto-import all flake-module.nix files from tools subdirectories
121
121
-
let
122
122
-
toolDirs = builtins.attrNames (nixpkgs.lib.filterAttrs
123
123
-
(_: type: type == "directory")
124
124
-
(builtins.readDir ./tools));
125
125
-
in
124
124
+
imports =
125
125
+
[
126
126
+
./formatter.nix
127
127
+
]
128
128
+
++ (
129
129
+
# Auto-import all flake-module.nix files from tools subdirectories
130
130
+
let
131
131
+
toolDirs = builtins.attrNames (
132
132
+
nixpkgs.lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./tools)
133
133
+
);
134
134
+
in
126
135
map (dir: ./tools + "/${dir}/flake-module.nix") toolDirs
127
127
-
);
136
136
+
);
128
137
flake.nixosConfigurations = clan.nixosConfigurations;
129
138
flake.clanInternals = clan.clanInternals;
130
139
flake.darwinConfigurations = clan.darwinConfigurations;
···
9
9
nix.settings.auto-allocate-uids = true;
10
10
11
11
# for container in builds support
12
12
-
nix.settings.system-features = [ "uid-range" "kvm" "nixos-test" ];
12
12
+
nix.settings.system-features = [
13
13
+
"uid-range"
14
14
+
"kvm"
15
15
+
"nixos-test"
16
16
+
];
13
17
}
···
11
11
clan.core.facts.secretUploadDirectory = lib.mkDefault "/etc/secrets";
12
12
clan.core.vars.settings.secretStore = "password-store";
13
13
clan.core.networking.targetHost = "root@${config.networking.hostName}";
14
14
-
14
14
+
15
15
# Stockholm configuration
16
16
krebs.secret.directory = config.clan.core.facts.secretUploadDirectory;
17
17
-
17
17
+
18
18
# Nixpkgs overlays
19
19
nixpkgs.overlays = [
20
20
self.inputs.stockholm.overlays.default
···
24
24
imports = [
25
25
# Import 3modules
26
26
../3modules
27
27
-
27
27
+
28
28
# Import stockholm krebs module
29
29
self.inputs.stockholm.nixosModules.krebs
30
30
-
30
30
+
31
31
# Import individual configurations
32
32
./security-workarounds.nix
33
33
# ./binary-cache/client.nix
···
44
44
./nether.nix
45
45
./spora.nix
46
46
./nix.nix
47
47
-
47
47
+
48
48
# Import stockholm modules
49
49
self.inputs.stockholm.nixosModules.users
50
50
self.inputs.stockholm.nixosModules.hosts
···
64
64
self.inputs.stockholm.nixosModules.xresources
65
65
self.inputs.stockholm.nixosModules.ssh
66
66
self.inputs.stockholm.nixosModules.sync-containers3
67
67
-
{ # nix-index
67
67
+
{
68
68
+
# nix-index
68
69
imports = [
69
70
self.inputs.nix-index-database.nixosModules.nix-index
70
71
];
···
345
346
];
346
347
};
347
348
};
348
348
-
349
349
350
350
networking.extraHosts = ''
351
351
10.42.0.1 styx.gg23
···
57
57
config.krebs.hosts.mors
58
58
config.krebs.hosts.xerxes
59
59
];
60
60
-
internet-aliases =
61
61
-
map (from: { inherit from to; }) mails
62
62
-
++ [
63
63
-
];
60
60
+
internet-aliases = map (from: { inherit from to; }) mails ++ [
61
61
+
];
64
62
system-aliases = [
65
63
{
66
64
from = "mailer-daemon";
···
1
1
-
{ lib, ... }:
1
1
+
{ ... }:
2
2
{
3
3
4
4
networking.useNetworkd = true;
···
67
67
68
68
#run the chosen script
69
69
case $script in
70
70
-
${
71
71
-
concatMapStringsSep "\n" (
72
72
-
script:
73
73
-
slib.indent ''
74
74
-
${script.label})
75
75
-
target=$(${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
76
76
-
| ${pkgs.gnugrep}/bin/grep '${script.target}' \
77
77
-
| ${pkgs.gnugrep}/bin/grep -v TARGETS \
78
78
-
| ${pkgs.coreutils}/bin/head -1)
79
79
-
${pkgs.xclip}/bin/xclip -selection clipboard -target "$target" -out \
80
80
-
| ${script.script} \
81
81
-
| ${pkgs.xclip}/bin/xclip -selection clipboard -in
82
82
-
;;
83
83
-
''
84
84
-
) (attrValues cfg)
85
85
-
}
70
70
+
${concatMapStringsSep "\n" (
71
71
+
script:
72
72
+
slib.indent ''
73
73
+
${script.label})
74
74
+
target=$(${pkgs.xclip}/bin/xclip -selection clipboard -target TARGETS -out \
75
75
+
| ${pkgs.gnugrep}/bin/grep '${script.target}' \
76
76
+
| ${pkgs.gnugrep}/bin/grep -v TARGETS \
77
77
+
| ${pkgs.coreutils}/bin/head -1)
78
78
+
${pkgs.xclip}/bin/xclip -selection clipboard -target "$target" -out \
79
79
+
| ${script.script} \
80
80
+
| ${pkgs.xclip}/bin/xclip -selection clipboard -in
81
81
+
;;
82
82
+
''
83
83
+
) (attrValues cfg)}
86
84
esac
87
85
'';
88
86
in
···
4
4
5
5
rec {
6
6
7
7
-
ssl =
8
8
-
_domains:
9
9
-
{
10
10
-
};
7
7
+
ssl = _domains: {
8
8
+
};
11
9
12
10
servePage =
13
11
domains:
···
163
161
include ${pkgs.nginx}/conf/fastcgi.conf;
164
162
'';
165
163
#Directives to send expires headers and turn off 404 error logging.
166
166
-
locations."~* ^.+\.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$".extraConfig = ''
167
167
-
access_log off;
168
168
-
log_not_found off;
169
169
-
expires max;
170
170
-
'';
164
164
+
locations."~* ^.+\.(xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$".extraConfig =
165
165
+
''
166
166
+
access_log off;
167
167
+
log_not_found off;
168
168
+
expires max;
169
169
+
'';
171
170
locations."/nb".extraConfig = ''
172
171
index index.html;
173
172
'';
···
1
1
-
{ self, modulesPath, pkgs, ... }:
1
1
+
{ self, modulesPath, ... }:
2
2
{
3
3
imports = [
4
4
./config.nix
···
20
20
# }) {
21
21
# inherit (pkgs) system;
22
22
# }).fwupd;
23
23
-
24
23
25
24
krebs.power-action.battery = "BAT1";
26
25
···
69
69
type = "zpool";
70
70
mode = "mirror";
71
71
mountpoint = "/";
72
72
-
rootFsOptions =
73
73
-
{
74
74
-
};
72
72
+
rootFsOptions = {
73
73
+
};
75
74
datasets = {
76
75
reserved = {
77
76
type = "zfs_fs";
···
2
2
self,
3
3
config,
4
4
lib,
5
5
-
pkgs,
6
5
...
7
6
}:
8
7
let
···
14
14
text = builtins.readFile ./jellyseekrr.sh;
15
15
};
16
16
};
17
17
-
}
17
17
+
}
···
1
1
{ self, ... }:
2
2
{
3
3
perSystem =
4
4
-
{ pkgs, lib, ... }:
4
4
+
{ pkgs, ... }:
5
5
{
6
6
-
packages.mpv =
6
6
+
packages.mpv =
7
7
let
8
8
mpvInput = pkgs.writeText "mpv.input" ''
9
9
: script-binding console/enable
···
65
65
};
66
66
67
67
in
68
68
-
pkgs.writeShellApplication {
69
69
-
name = "mpv";
70
70
-
runtimeInputs = [
71
71
-
mpvPackage
72
72
-
pkgs.yt-dlp
73
73
-
];
74
74
-
text = ''
75
75
-
Y_RES=1081
76
76
-
# we need to disable sponsorblock local database because of
77
77
-
# https://github.com/po5/mpv_sponsorblock/issues/31
78
78
-
exec mpv \
79
79
-
--no-config \
80
80
-
--input-conf=${mpvInput} \
81
81
-
--include=${mpvConfig} \
82
82
-
--script=${autosub} \
83
83
-
--ytdl-format="best[height<$Y_RES]" \
84
84
-
--script-opts=ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp \
85
85
-
--script-opts-append=sponsorblock-local_database=no \
86
86
-
--audio-channels=2 \
87
87
-
"$@"
88
88
-
'';
89
89
-
};
68
68
+
pkgs.writeShellApplication {
69
69
+
name = "mpv";
70
70
+
runtimeInputs = [
71
71
+
mpvPackage
72
72
+
pkgs.yt-dlp
73
73
+
];
74
74
+
text = ''
75
75
+
Y_RES=1081
76
76
+
# we need to disable sponsorblock local database because of
77
77
+
# https://github.com/po5/mpv_sponsorblock/issues/31
78
78
+
exec mpv \
79
79
+
--no-config \
80
80
+
--input-conf=${mpvInput} \
81
81
+
--include=${mpvConfig} \
82
82
+
--script=${autosub} \
83
83
+
--ytdl-format="best[height<$Y_RES]" \
84
84
+
--script-opts=ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp \
85
85
+
--script-opts-append=sponsorblock-local_database=no \
86
86
+
--audio-channels=2 \
87
87
+
"$@"
88
88
+
'';
89
89
+
};
90
90
91
91
# Separate package for subtitle downloader
92
92
-
packages.mpv-dl-subs = pkgs.writers.writePython3Bin "dl_subs" {
93
93
-
libraries = [ pkgs.python3Packages.subliminal ];
94
94
-
flakeIgnore = [ "E501" ];
95
95
-
} ''
96
96
-
import babelfish
97
97
-
import subliminal
98
98
-
from pathlib import Path
99
99
-
import sys
100
100
-
import os
92
92
+
packages.mpv-dl-subs =
93
93
+
pkgs.writers.writePython3Bin "dl_subs"
94
94
+
{
95
95
+
libraries = [ pkgs.python3Packages.subliminal ];
96
96
+
flakeIgnore = [ "E501" ];
97
97
+
}
98
98
+
''
99
99
+
import babelfish
100
100
+
import subliminal
101
101
+
from pathlib import Path
102
102
+
import sys
103
103
+
import os
101
104
102
102
-
video_path = Path(sys.argv[1])
103
103
-
video = subliminal.scan_video(video_path)
104
104
-
cache_path = Path(os.path.expanduser("~/.cache/subliminal")) / f"{video.title}.srt"
105
105
-
if not cache_path.exists():
106
106
-
cache_path.parent.mkdir(parents=True, exist_ok=True)
107
107
-
language = babelfish.Language("eng")
108
108
-
sub = subliminal.download_best_subtitles([video], {language})[video][0]
109
109
-
cache_path.write_bytes(sub.content)
110
110
-
print(cache_path)
111
111
-
'';
105
105
+
video_path = Path(sys.argv[1])
106
106
+
video = subliminal.scan_video(video_path)
107
107
+
cache_path = Path(os.path.expanduser("~/.cache/subliminal")) / f"{video.title}.srt"
108
108
+
if not cache_path.exists():
109
109
+
cache_path.parent.mkdir(parents=True, exist_ok=True)
110
110
+
language = babelfish.Language("eng")
111
111
+
sub = subliminal.download_best_subtitles([video], {language})[video][0]
112
112
+
cache_path.write_bytes(sub.content)
113
113
+
print(cache_path)
114
114
+
'';
112
115
};
113
113
-
}
116
116
+
}
···
8
8
paths = [
9
9
(pkgs.writeShellApplication {
10
10
name = "muchsync";
11
11
-
runtimeInputs = [
12
12
-
pkgs.muchsync
13
13
-
pkgs.notmuch
14
14
-
] ++ lib.optionals pkgs.stdenv.isLinux [
15
15
-
pkgs.iputils
16
16
-
];
11
11
+
runtimeInputs =
12
12
+
[
13
13
+
pkgs.muchsync
14
14
+
pkgs.notmuch
15
15
+
]
16
16
+
++ lib.optionals pkgs.stdenv.isLinux [
17
17
+
pkgs.iputils
18
18
+
];
17
19
text = ''
18
18
-
export NOTMUCH_CONFIG=${pkgs.writeText "notmuch-config" self.packages.${pkgs.system}.mutt.passthru.notmuchConfig}
19
19
-
20
20
+
export NOTMUCH_CONFIG=${
21
21
+
pkgs.writeText "notmuch-config" self.packages.${pkgs.system}.mutt.passthru.notmuchConfig
22
22
+
}
23
23
+
20
24
set -efu
21
25
22
26
# Create Maildir structure if it doesn't exist
···
79
83
];
80
84
};
81
85
};
82
82
-
}
86
86
+
}
···
3
3
perSystem =
4
4
{ pkgs, lib, ... }:
5
5
{
6
6
-
packages.mutt =
6
6
+
packages.mutt =
7
7
let
8
8
# Mailboxes configuration from mail.nix
9
9
mailboxes = {
···
257
257
'';
258
258
259
259
in
260
260
-
(pkgs.writeShellApplication {
261
261
-
name = "mutt";
262
262
-
runtimeInputs = [
260
260
+
(pkgs.writeShellApplication {
261
261
+
name = "mutt";
262
262
+
runtimeInputs =
263
263
+
[
263
264
pkgs.neomutt
264
265
pkgs.elinks
265
266
pkgs.msmtp
266
267
pkgs.notmuch
267
268
pkgs.urlscan
268
268
-
] ++ lib.optionals pkgs.stdenv.isLinux [
269
269
+
]
270
270
+
++ lib.optionals pkgs.stdenv.isLinux [
269
271
pkgs.iputils
270
272
];
271
271
-
text = ''
272
272
-
export NOTMUCH_CONFIG_FILE=${pkgs.writeText "notmuch-config" notmuchConfig}
273
273
-
export MUTTRC=${muttrc}
274
274
-
${builtins.readFile ./mutt.sh}
275
275
-
'';
276
276
-
}) // {
277
277
-
passthru.notmuchConfig = notmuchConfig;
278
278
-
};
273
273
+
text = ''
274
274
+
export NOTMUCH_CONFIG_FILE=${pkgs.writeText "notmuch-config" notmuchConfig}
275
275
+
export MUTTRC=${muttrc}
276
276
+
${builtins.readFile ./mutt.sh}
277
277
+
'';
278
278
+
})
279
279
+
// {
280
280
+
passthru.notmuchConfig = notmuchConfig;
281
281
+
};
279
282
};
280
280
-
}
283
283
+
}
···
23
23
};
24
24
};
25
25
};
26
26
-
globals = {
26
26
+
globals = {
27
27
mapleader = " ";
28
28
lumen_light_colorscheme = "everforest";
29
29
lumen_dark_colorscheme = "ayu";
···
1
1
-
{ self, ... }:
1
1
+
{ ... }:
2
2
{
3
3
perSystem =
4
4
{ pkgs, ... }:
···
14
14
text = builtins.readFile ./tornade.sh;
15
15
};
16
16
};
17
17
-
}
17
17
+
}
···
1
1
-
2
1
{ ... }:
3
2
{
4
3
perSystem =
5
5
-
{ pkgs, ... }: {
4
4
+
{ pkgs, ... }:
5
5
+
{
6
6
packages.wifi-qr = pkgs.writeShellApplication {
7
7
name = "wifi-qr";
8
8
runtimeInputs = [
···
1
1
-
{ pkgs, lib, self, ... }:
1
1
+
{ pkgs, lib, ... }:
2
2
let
3
3
# qtile =
4
4
# (pkgs.python3.pkgs.qtile.override {
···
1
1
{
2
2
-
self,
3
2
config,
4
3
lib,
5
4
pkgs,
···
58
58
config.clan.core.vars.generators.hedgedoc.files."hedgedoc.env".path
59
59
];
60
60
clan.core.vars.generators.hedgedoc = {
61
61
-
files."hedgedoc.env" = {};
61
61
+
files."hedgedoc.env" = { };
62
62
runtimeInputs = [ pkgs.pwgen ];
63
63
script = ''
64
64
pwgen -s 64 1 > session_secret