Compare commits
183 Commits
starship
...
upstream_a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cdb8f066f | ||
|
|
c73ecf422c | ||
|
|
b179bee277 | ||
|
|
b1c85417e1 | ||
|
|
96ea6c4232 | ||
|
|
2a584915e4 | ||
|
|
a6a50d7c22 | ||
|
|
edfafd1017 | ||
|
|
9adff4ebc1 | ||
|
|
a788879d92 | ||
|
|
955c5963c8 | ||
|
|
11436c0efe | ||
|
|
5b487330e1 | ||
|
|
d25e9173dd | ||
|
|
8bddf10e9d | ||
|
|
64c94e9b06 | ||
|
|
c87957b8cb | ||
|
|
bf419b6f4a | ||
|
|
b224a78b89 | ||
|
|
748584c78e | ||
|
|
64e8903ae4 | ||
|
|
f4338ec8df | ||
|
|
c947def321 | ||
|
|
f1eaaf12b3 | ||
|
|
2b485f7f1d | ||
|
|
6db8e01309 | ||
|
|
03e389195c | ||
|
|
2c3e5483e9 | ||
|
|
6b42a09468 | ||
|
|
eb5815048f | ||
|
|
1cb4fa4234 | ||
|
|
146dc5f79a | ||
|
|
f667c9daa6 | ||
|
|
83eaba357f | ||
|
|
6284ce8d86 | ||
|
|
c26d6f34ea | ||
|
|
c3f715d010 | ||
|
|
45514d147c | ||
|
|
aafa880b7c | ||
|
|
dde8be4d9f | ||
|
|
03ae8d3b0a | ||
|
|
03f0721e1f | ||
|
|
8847063948 | ||
|
|
399379cea0 | ||
|
|
1cdfebf392 | ||
|
|
045fed0748 | ||
|
|
7fe153bfd3 | ||
|
|
52490457f0 | ||
|
|
e5e9bba2a5 | ||
|
|
7ef079afc0 | ||
|
|
a06fece8f1 | ||
|
|
51c7888347 | ||
|
|
7656c30a29 | ||
|
|
929401b359 | ||
|
|
16746d58d2 | ||
|
|
82a016ec68 | ||
|
|
eed2bd4f13 | ||
|
|
99f1b1a51b | ||
|
|
99bc8c6d79 | ||
|
|
0f2c595538 | ||
|
|
996cb27a89 | ||
|
|
9008d9b7c6 | ||
|
|
38a1168a32 | ||
|
|
3a4344a112 | ||
|
|
18cb758986 | ||
|
|
e28c7f8968 | ||
|
|
5c17148635 | ||
|
|
199bb38dfb | ||
|
|
5af4a95940 | ||
|
|
daf35778c5 | ||
|
|
1866cf6290 | ||
|
|
23ef4d50b9 | ||
|
|
4aec400388 | ||
|
|
f211282376 | ||
|
|
96a96a0bc4 | ||
|
|
554a6aff65 | ||
|
|
14c5c7d0fd | ||
|
|
22f9a0efcd | ||
|
|
3e80452235 | ||
|
|
c68c069667 | ||
|
|
e08d93425a | ||
|
|
5b7cae49c3 | ||
|
|
e65504b5f3 | ||
|
|
158188c4c6 | ||
|
|
c587fcc2ac | ||
|
|
9d16c7bd7b | ||
|
|
2b3b9af70b | ||
|
|
53f370b1ee | ||
|
|
25c8c30488 | ||
|
|
4d754355b7 | ||
|
|
902c6e1127 | ||
|
|
98f98a8895 | ||
|
|
4a303d17d8 | ||
|
|
7f4c41bb32 | ||
|
|
c68a6aaa19 | ||
|
|
a36ebbf94c | ||
|
|
1044aa16b0 | ||
|
|
efcefc129a | ||
|
|
16dd93668d | ||
|
|
c457f6414b | ||
|
|
844466c2ca | ||
|
|
6cf6e61193 | ||
|
|
ca3ef67533 | ||
|
|
56c0add33f | ||
|
|
ba81687d42 | ||
|
|
144f83982d | ||
|
|
a97a03f642 | ||
|
|
fc47359184 | ||
|
|
812a762652 | ||
|
|
fb785e036b | ||
|
|
cdc7d13225 | ||
|
|
ec4583b79e | ||
|
|
cab8c8d955 | ||
|
|
33f582d17a | ||
|
|
295ac24361 | ||
|
|
42dd67f9da | ||
|
|
c173ea87cf | ||
|
|
33f45c56bf | ||
|
|
83389cb5cf | ||
|
|
4db3ef1ed3 | ||
|
|
fe7a083a7b | ||
|
|
cd0578d0a6 | ||
|
|
f56dcc7c42 | ||
|
|
83de1e3708 | ||
|
|
2b20ab5123 | ||
|
|
3ecb2fc790 | ||
|
|
44a49d7ac7 | ||
|
|
acfc9ac1a4 | ||
|
|
e733dcdcbf | ||
|
|
3099a18424 | ||
|
|
15c209fdd9 | ||
|
|
ee181b535e | ||
|
|
4d0fc61e13 | ||
|
|
2b54630053 | ||
|
|
84bd6be8e6 | ||
|
|
dd96520ad1 | ||
|
|
11a1d61581 | ||
|
|
bab2cfdc7b | ||
|
|
fd0c92f3eb | ||
|
|
6ac33d2538 | ||
|
|
8d4b345414 | ||
|
|
8beaf00693 | ||
|
|
181e650094 | ||
|
|
449f288214 | ||
|
|
f6df27d7a9 | ||
|
|
e3a7a410c4 | ||
|
|
345c62a477 | ||
|
|
e7528765a9 | ||
|
|
54860370c0 | ||
|
|
46b21370bd | ||
|
|
381e3fb591 | ||
|
|
5d4ebf90b3 | ||
|
|
7dcdcc906c | ||
|
|
a4abb96de3 | ||
|
|
5859a06c5d | ||
|
|
02223deb64 | ||
|
|
20e247f8ed | ||
|
|
b0186dc85b | ||
|
|
cac15febfa | ||
|
|
48fa3c7436 | ||
|
|
7dd922c2a2 | ||
|
|
ab6f7dbea5 | ||
|
|
fea86b00b4 | ||
|
|
197b8fcced | ||
|
|
0bec3dbe63 | ||
|
|
53caf8bc81 | ||
|
|
c37d0d9b9e | ||
|
|
a663a90ada | ||
|
|
2d976a1cf3 | ||
|
|
d8e8781287 | ||
|
|
502e18fdec | ||
|
|
24d83e95a5 | ||
|
|
3ed43b1b8a | ||
|
|
64e735abbf | ||
|
|
ed11bf1e65 | ||
|
|
c0afe006b8 | ||
|
|
1fe305576b | ||
|
|
fc400a98db | ||
|
|
4a63e1c23e | ||
|
|
379795f6e8 | ||
|
|
edd3c6a266 | ||
|
|
dd785692ce | ||
|
|
c6ff6a1f24 |
@@ -8,6 +8,7 @@
|
|||||||
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
||||||
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
||||||
amend = commit --amend --no-edit
|
amend = commit --amend --no-edit
|
||||||
|
authorcount = shortlog --summary --numbered --all --no-merges
|
||||||
[core]
|
[core]
|
||||||
excludesfile = ~/.gitignore_global
|
excludesfile = ~/.gitignore_global
|
||||||
[commit]
|
[commit]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
||||||
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
||||||
amend = commit --amend --no-edit
|
amend = commit --amend --no-edit
|
||||||
|
authorcount = shortlog --summary --numbered --all --no-merges
|
||||||
[core]
|
[core]
|
||||||
excludesfile = ~/.gitignore_global
|
excludesfile = ~/.gitignore_global
|
||||||
[commit]
|
[commit]
|
||||||
|
|||||||
1
nix/configuration/.gitignore
vendored
Normal file
1
nix/configuration/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
result
|
||||||
@@ -2,67 +2,81 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
home-manager,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./roles/reset
|
./roles/2ship2harkinian
|
||||||
./roles/global_options
|
|
||||||
./util/unfree_polyfill
|
|
||||||
./roles/iso
|
|
||||||
"${
|
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.9.0.tar.gz";
|
|
||||||
sha256 = "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388";
|
|
||||||
}
|
|
||||||
}/module.nix"
|
|
||||||
./roles/boot
|
|
||||||
./roles/zfs
|
|
||||||
./roles/network
|
|
||||||
./roles/firewall
|
|
||||||
./roles/zsh
|
|
||||||
./roles/zrepl
|
|
||||||
./roles/graphics
|
|
||||||
./roles/sound
|
|
||||||
./roles/sway
|
|
||||||
./roles/kanshi
|
|
||||||
./roles/alacritty
|
./roles/alacritty
|
||||||
./roles/firefox
|
./roles/amd_s2idle
|
||||||
./roles/chromium
|
./roles/ansible
|
||||||
./roles/emacs
|
|
||||||
./roles/git
|
|
||||||
./roles/fonts
|
|
||||||
./roles/gpg
|
|
||||||
./roles/waybar
|
|
||||||
./roles/qemu
|
|
||||||
./roles/wireguard
|
|
||||||
./roles/ares
|
./roles/ares
|
||||||
./roles/ssh
|
./roles/bluetooth
|
||||||
./roles/python
|
./roles/boot
|
||||||
|
./roles/chromecast
|
||||||
|
./roles/chromium
|
||||||
|
./roles/d2
|
||||||
|
./roles/direnv
|
||||||
|
./roles/distributed_build
|
||||||
./roles/docker
|
./roles/docker
|
||||||
|
./roles/ecc
|
||||||
|
./roles/emacs
|
||||||
|
./roles/firefox
|
||||||
|
./roles/firewall
|
||||||
|
./roles/flux
|
||||||
|
./roles/fonts
|
||||||
|
./roles/gcloud
|
||||||
|
./roles/git
|
||||||
|
./roles/global_options
|
||||||
|
./roles/gnuplot
|
||||||
|
./roles/gpg
|
||||||
|
./roles/graphics
|
||||||
|
./roles/hydra
|
||||||
|
./roles/iso
|
||||||
|
./roles/iso_mount
|
||||||
|
./roles/kanshi
|
||||||
|
./roles/kodi
|
||||||
./roles/kubernetes
|
./roles/kubernetes
|
||||||
./roles/rust
|
|
||||||
./roles/media
|
|
||||||
./roles/steam
|
|
||||||
./roles/latex
|
./roles/latex
|
||||||
./roles/launch_keyboard
|
./roles/launch_keyboard
|
||||||
./roles/lvfs
|
./roles/lvfs
|
||||||
|
./roles/media
|
||||||
|
./roles/memtest86
|
||||||
|
./roles/network
|
||||||
|
./roles/nix_index
|
||||||
|
./roles/nix_worker
|
||||||
./roles/nvme
|
./roles/nvme
|
||||||
|
./roles/optimized_build
|
||||||
|
./roles/pcsx2
|
||||||
|
./roles/python
|
||||||
|
./roles/qemu
|
||||||
|
./roles/reset
|
||||||
|
./roles/rpcs3
|
||||||
|
./roles/rust
|
||||||
|
./roles/shadps4
|
||||||
|
./roles/shikane
|
||||||
|
./roles/shipwright
|
||||||
|
./roles/sm64ex
|
||||||
|
./roles/sops
|
||||||
|
./roles/sound
|
||||||
|
./roles/ssh
|
||||||
|
./roles/steam
|
||||||
|
./roles/steam_run_free
|
||||||
|
./roles/sway
|
||||||
|
./roles/tekton
|
||||||
./roles/terraform
|
./roles/terraform
|
||||||
|
./roles/thunderbolt
|
||||||
|
./roles/vnc_client
|
||||||
./roles/vscode
|
./roles/vscode
|
||||||
./roles/wasm
|
./roles/wasm
|
||||||
./roles/vnc_client
|
./roles/waybar
|
||||||
./roles/chromecast
|
./roles/wireguard
|
||||||
./roles/memtest86
|
./roles/zfs
|
||||||
./roles/kodi
|
./roles/zrepl
|
||||||
./roles/ansible
|
./roles/zsh
|
||||||
./roles/bluetooth
|
./util/install_files
|
||||||
./roles/sm64ex
|
./util/unfree_polyfill
|
||||||
./roles/shipwright
|
|
||||||
./roles/2ship2harkinian
|
|
||||||
./roles/nix_index
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
@@ -74,6 +88,19 @@
|
|||||||
# boot.kernelPackages = pkgs.linuxPackages_6_11;
|
# boot.kernelPackages = pkgs.linuxPackages_6_11;
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
|
# Use nixos-rebuild-ng
|
||||||
|
# system.rebuild.enableNg = true;
|
||||||
|
|
||||||
|
# Keep outputs so we can build offline.
|
||||||
|
nix.extraOptions = ''
|
||||||
|
keep-outputs = true
|
||||||
|
keep-derivations = true
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Technically only needed when building the ISO because nix detects ZFS in the filesystem list normally. I basically always want this so I'm just setting it to always be on.
|
||||||
|
boot.supportedFilesystems.zfs = true;
|
||||||
|
# TODO: Is this different from boot.supportedFilesystems = [ "zfs" ]; ?
|
||||||
|
|
||||||
services.getty = {
|
services.getty = {
|
||||||
autologinUser = "talexander"; # I use full disk encryption so the user password is irrelevant.
|
autologinUser = "talexander"; # I use full disk encryption so the user password is irrelevant.
|
||||||
autologinOnce = true;
|
autologinOnce = true;
|
||||||
@@ -97,25 +124,14 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
users.groups.talexander.gid = 11235;
|
users.groups.talexander.gid = 11235;
|
||||||
home-manager.users.talexander =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
home.packages = [
|
|
||||||
pkgs.atool
|
|
||||||
pkgs.httpie
|
|
||||||
];
|
|
||||||
programs.bash.enable = true;
|
|
||||||
|
|
||||||
# The state version is required and should stay at the version you
|
|
||||||
# originally installed.
|
|
||||||
home.stateVersion = "24.11";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Automatic garbage collection
|
# Automatic garbage collection
|
||||||
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
||||||
# Runs nix-collect-garbage --delete-older-than 5d
|
# Runs nix-collect-garbage --delete-older-than 5d
|
||||||
automatic = true;
|
automatic = true;
|
||||||
randomizedDelaySec = "14m";
|
persistent = true;
|
||||||
|
dates = "monthly";
|
||||||
|
# randomizedDelaySec = "14m";
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
nix.settings.auto-optimise-store = !config.me.buildingIso;
|
nix.settings.auto-optimise-store = !config.me.buildingIso;
|
||||||
@@ -144,7 +160,7 @@
|
|||||||
pciutils # for lspci
|
pciutils # for lspci
|
||||||
ripgrep
|
ripgrep
|
||||||
strace
|
strace
|
||||||
ltrace
|
# ltrace # Disabled because it uses more than 48GB of /tmp space during test phase.
|
||||||
trace-cmd # ftrace
|
trace-cmd # ftrace
|
||||||
tcpdump
|
tcpdump
|
||||||
git-crypt
|
git-crypt
|
||||||
@@ -152,6 +168,13 @@
|
|||||||
ncdu
|
ncdu
|
||||||
nix-tree
|
nix-tree
|
||||||
libarchive # bsdtar
|
libarchive # bsdtar
|
||||||
|
lsof
|
||||||
|
doas-sudo-shim # To support --use-remote-sudo for remote builds
|
||||||
|
dmidecode # Read SMBIOS information.
|
||||||
|
ipcalc
|
||||||
|
gptfdisk # for cgdisk
|
||||||
|
nix-output-monitor # For better view into nixos-rebuild
|
||||||
|
nix-serve-ng # Serve nix store over http
|
||||||
];
|
];
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
|
|||||||
101
nix/configuration/flake.lock
generated
101
nix/configuration/flake.lock
generated
@@ -8,15 +8,14 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
|
||||||
"narHash": "sha256-c4Ds4E/10Zj5AQLuJ3JvJTuDK8o2WjVXLcIL7eyhTfw=",
|
|
||||||
"path": "flakes/ansible-sshjail",
|
"path": "flakes/ansible-sshjail",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "flakes/ansible-sshjail",
|
"path": "flakes/ansible-sshjail",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
},
|
||||||
|
"parent": []
|
||||||
},
|
},
|
||||||
"crane": {
|
"crane": {
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -33,6 +32,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1758160037,
|
||||||
|
"narHash": "sha256-fXelTdjdILspZ1IUU9aICB1+PXwSFiF8j+7ujwo1VpQ=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "4f554162fff88e77655073d352eec0cea71103a2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -128,26 +147,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"home-manager": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1737762889,
|
|
||||||
"narHash": "sha256-5HGG09bh/Yx0JA8wtBMAzt0HMCL1bYZ93x4IqzVExio=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "daf04c5950b676f47a794300657f1d3d14c1a120",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"impermanence": {
|
"impermanence": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737831083,
|
"lastModified": 1737831083,
|
||||||
@@ -191,33 +190,33 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737885589,
|
"lastModified": 1758242085,
|
||||||
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
|
"narHash": "sha256-hnrtEiy8qLMskZr0FBp0vbtMJ9xA4HvDdzuFRLxRiFg=",
|
||||||
"owner": "NixOS",
|
"ref": "og-amd-debug-tools",
|
||||||
"repo": "nixpkgs",
|
"rev": "7b0f433195e299008850d16e85a862177419cef6",
|
||||||
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
|
"revCount": 862645,
|
||||||
"type": "github"
|
"type": "git",
|
||||||
|
"url": "https://github.com/tomalexander/nixpkgs.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"ref": "og-amd-debug-tools",
|
||||||
"ref": "nixos-unstable",
|
"type": "git",
|
||||||
"repo": "nixpkgs",
|
"url": "https://github.com/tomalexander/nixpkgs.git"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-b93b4e9b5": {
|
"nixpkgs-dda3dcd3f": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713721570,
|
"lastModified": 1746663147,
|
||||||
"narHash": "sha256-R0s+O5UjTePQRb72XPgtkTmEiOOW8n+1q9Gxt/OJnKU=",
|
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b93b4e9b527904aadf52dba6ca35efde2067cbd4",
|
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b93b4e9b527904aadf52dba6ca35efde2067cbd4",
|
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -237,6 +236,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-unoptimized": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1758242085,
|
||||||
|
"narHash": "sha256-hnrtEiy8qLMskZr0FBp0vbtMJ9xA4HvDdzuFRLxRiFg=",
|
||||||
|
"ref": "og-amd-debug-tools",
|
||||||
|
"rev": "7b0f433195e299008850d16e85a862177419cef6",
|
||||||
|
"revCount": 862645,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/tomalexander/nixpkgs.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "og-amd-debug-tools",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/tomalexander/nixpkgs.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pre-commit-hooks-nix": {
|
"pre-commit-hooks-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
@@ -267,11 +282,12 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"ansible-sshjail": "ansible-sshjail",
|
"ansible-sshjail": "ansible-sshjail",
|
||||||
"home-manager": "home-manager",
|
"disko": "disko",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-b93b4e9b5": "nixpkgs-b93b4e9b5",
|
"nixpkgs-dda3dcd3f": "nixpkgs-dda3dcd3f",
|
||||||
|
"nixpkgs-unoptimized": "nixpkgs-unoptimized",
|
||||||
"zsh-histdb": "zsh-histdb"
|
"zsh-histdb": "zsh-histdb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -334,15 +350,14 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
|
||||||
"narHash": "sha256-5DWw7GnwVZ98HUp/UUJcyUmmy9Bh/mcQB8MQQ0t3ZRo=",
|
|
||||||
"path": "flakes/zsh-histdb",
|
"path": "flakes/zsh-histdb",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "flakes/zsh-histdb",
|
"path": "flakes/zsh-histdb",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
},
|
||||||
|
"parent": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# output: result/iso/nixos.iso
|
# output: result/iso/nixos.iso
|
||||||
|
|
||||||
# Run the ISO image
|
# Run the ISO image
|
||||||
# "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||||
# -accel kvm \
|
# -accel kvm \
|
||||||
# -cpu host \
|
# -cpu host \
|
||||||
# -smp cores=8 \
|
# -smp cores=8 \
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
# -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" \
|
# -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" \
|
||||||
# -nic user,hostfwd=tcp::60022-:22 \
|
# -nic user,hostfwd=tcp::60022-:22 \
|
||||||
# -boot order=d \
|
# -boot order=d \
|
||||||
# -cdrom "$(readlink -f ./result/iso/nixos.iso)" \
|
# -cdrom "$(readlink -f ./result/iso/nixos*.iso)" \
|
||||||
# -display vnc=127.0.0.1:0
|
# -display vnc=127.0.0.1:0
|
||||||
#
|
#
|
||||||
# doas cp "$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF_VARS.fd" /tmp/OVMF_VARS.fd
|
# doas cp "$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF_VARS.fd" /tmp/OVMF_VARS.fd
|
||||||
@@ -25,15 +25,28 @@
|
|||||||
# iso.odo.isoName == "nixos.iso"
|
# iso.odo.isoName == "nixos.iso"
|
||||||
# full path = <outPath> / iso / <isoName>
|
# full path = <outPath> / iso / <isoName>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Install on a new machine:
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# doas nix --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/odo/disk-config.nix
|
||||||
|
|
||||||
|
# nix flake update zsh-histdb --flake .
|
||||||
|
# nix flake update ansible-sshjail --flake .
|
||||||
|
# for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
# nixos-install --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --flake ".#vm_ionlybootzfs"
|
||||||
|
#
|
||||||
|
|
||||||
{
|
{
|
||||||
description = "My system configuration";
|
description = "My system configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
nixpkgs-b93b4e9b5.url = "github:NixOS/nixpkgs/b93b4e9b527904aadf52dba6ca35efde2067cbd4";
|
# nixpkgs.url = "github:tomalexander/nixpkgs/amd-debug-tools";
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
nixpkgs.url = "git+https://github.com/tomalexander/nixpkgs.git?ref=og-amd-debug-tools";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
nixpkgs-dda3dcd3f.url = "github:NixOS/nixpkgs/dda3dcd3fe03e991015e9a74b22d35950f264a54";
|
||||||
|
nixpkgs-unoptimized.url = "git+https://github.com/tomalexander/nixpkgs.git?ref=og-amd-debug-tools";
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
url = "github:nix-community/lanzaboote/v0.4.2";
|
url = "github:nix-community/lanzaboote/v0.4.2";
|
||||||
|
|
||||||
@@ -52,15 +65,19 @@
|
|||||||
# Optional but recommended to limit the size of your system closure.
|
# Optional but recommended to limit the size of your system closure.
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixpkgs-b93b4e9b5,
|
nixpkgs-unoptimized,
|
||||||
|
nixpkgs-dda3dcd3f,
|
||||||
impermanence,
|
impermanence,
|
||||||
home-manager,
|
|
||||||
lanzaboote,
|
lanzaboote,
|
||||||
zsh-histdb,
|
zsh-histdb,
|
||||||
ansible-sshjail,
|
ansible-sshjail,
|
||||||
@@ -70,18 +87,19 @@
|
|||||||
base_x86_64_linux = rec {
|
base_x86_64_linux = rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
|
pkgs-dda3dcd3f = import nixpkgs-dda3dcd3f {
|
||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
pkgs-unoptimized = import nixpkgs-unoptimized {
|
||||||
|
inherit system;
|
||||||
|
hostPlatform.gcc.arch = "default";
|
||||||
|
hostPlatform.gcc.tune = "default";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
impermanence.nixosModules.impermanence
|
impermanence.nixosModules.impermanence
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
lanzaboote.nixosModules.lanzaboote
|
lanzaboote.nixosModules.lanzaboote
|
||||||
{
|
inputs.disko.nixosModules.disko
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
zsh-histdb.overlays.default
|
zsh-histdb.overlays.default
|
||||||
@@ -91,21 +109,9 @@
|
|||||||
./configuration.nix
|
./configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
systems = {
|
systems =
|
||||||
odo = {
|
let
|
||||||
main = nixpkgs.lib.nixosSystem (
|
additional_iso_modules = [
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/odo
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
iso = nixpkgs.lib.nixosSystem (
|
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/odo
|
|
||||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
||||||
# TODO: Figure out how to do image based appliances
|
# TODO: Figure out how to do image based appliances
|
||||||
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
||||||
@@ -113,41 +119,148 @@
|
|||||||
isoImage.makeEfiBootable = true;
|
isoImage.makeEfiBootable = true;
|
||||||
isoImage.makeUsbBootable = true;
|
isoImage.makeUsbBootable = true;
|
||||||
me.buildingIso = true;
|
me.buildingIso = true;
|
||||||
|
me.optimizations.enable = nixpkgs.lib.mkForce false;
|
||||||
}
|
}
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
neelix = {
|
|
||||||
main = nixpkgs.lib.nixosSystem (
|
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/neelix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
iso = nixpkgs.lib.nixosSystem (
|
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/neelix
|
|
||||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
|
||||||
{
|
{
|
||||||
isoImage.makeEfiBootable = true;
|
# These are big space hogs. The chance that I need them on an ISO is slim.
|
||||||
isoImage.makeUsbBootable = true;
|
me.steam.enable = nixpkgs.lib.mkForce false;
|
||||||
me.buildingIso = true;
|
me.pcsx2.enable = nixpkgs.lib.mkForce false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
additional_vm_modules = [
|
||||||
|
(nixpkgs + "/nixos/modules/profiles/qemu-guest.nix")
|
||||||
|
{
|
||||||
|
networking.dhcpcd.enable = true;
|
||||||
|
networking.useDHCP = true;
|
||||||
|
me.optimizations.enable = nixpkgs.lib.mkForce false;
|
||||||
}
|
}
|
||||||
);
|
{
|
||||||
|
# I don't need games on a virtual machine.
|
||||||
|
me.steam.enable = nixpkgs.lib.mkForce false;
|
||||||
|
me.pcsx2.enable = nixpkgs.lib.mkForce false;
|
||||||
|
me.sm64ex.enable = nixpkgs.lib.mkForce false;
|
||||||
|
me.shipwright.enable = nixpkgs.lib.mkForce false;
|
||||||
|
me.ship2harkinian.enable = nixpkgs.lib.mkForce false;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
odo = rec {
|
||||||
|
main = base_x86_64_linux // {
|
||||||
|
modules = base_x86_64_linux.modules ++ [
|
||||||
|
./hosts/odo
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
iso = main // {
|
||||||
|
modules = main.modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
vm = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules;
|
||||||
|
};
|
||||||
|
vm_iso = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
quark = rec {
|
||||||
|
main = base_x86_64_linux // {
|
||||||
|
modules = base_x86_64_linux.modules ++ [
|
||||||
|
./hosts/quark
|
||||||
|
];
|
||||||
|
};
|
||||||
|
iso = main // {
|
||||||
|
modules = main.modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
vm = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules;
|
||||||
|
};
|
||||||
|
vm_iso = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
neelix = rec {
|
||||||
|
main = base_x86_64_linux // {
|
||||||
|
modules = base_x86_64_linux.modules ++ [
|
||||||
|
./hosts/neelix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
iso = main // {
|
||||||
|
modules = main.modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
vm = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules;
|
||||||
|
};
|
||||||
|
vm_iso = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
hydra =
|
||||||
|
let
|
||||||
|
additional_iso_modules = additional_iso_modules ++ [
|
||||||
|
{
|
||||||
|
me.optimizations.enable = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
main = base_x86_64_linux // {
|
||||||
|
modules = base_x86_64_linux.modules ++ [
|
||||||
|
./hosts/hydra
|
||||||
|
];
|
||||||
|
};
|
||||||
|
iso = main // {
|
||||||
|
modules = main.modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
vm = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules;
|
||||||
|
};
|
||||||
|
vm_iso = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ionlybootzfs = rec {
|
||||||
|
main = base_x86_64_linux // {
|
||||||
|
modules = base_x86_64_linux.modules ++ [
|
||||||
|
./hosts/ionlybootzfs
|
||||||
|
];
|
||||||
|
};
|
||||||
|
iso = main // {
|
||||||
|
modules = main.modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
vm = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules;
|
||||||
|
};
|
||||||
|
vm_iso = main // {
|
||||||
|
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.odo = systems.odo.main;
|
nixosConfigurations.odo = nixpkgs.lib.nixosSystem systems.odo.main;
|
||||||
iso.odo = systems.odo.iso.config.system.build.isoImage;
|
iso.odo = (nixpkgs.lib.nixosSystem systems.odo.iso).config.system.build.isoImage;
|
||||||
nixosConfigurations.neelix = systems.neelix.main;
|
nixosConfigurations.vm_odo = nixpkgs.lib.nixosSystem systems.odo.vm;
|
||||||
iso.neelix = systems.neelix.iso.config.system.build.isoImage;
|
vm_iso.odo = (nixpkgs.lib.nixosSystem systems.odo.vm_iso).config.system.build.isoImage;
|
||||||
|
|
||||||
|
nixosConfigurations.quark = nixpkgs.lib.nixosSystem systems.quark.main;
|
||||||
|
iso.quark = (nixpkgs.lib.nixosSystem systems.quark.iso).config.system.build.isoImage;
|
||||||
|
nixosConfigurations.vm_quark = nixpkgs.lib.nixosSystem systems.quark.vm;
|
||||||
|
vm_iso.quark = (nixpkgs.lib.nixosSystem systems.quark.vm_iso).config.system.build.isoImage;
|
||||||
|
|
||||||
|
nixosConfigurations.neelix = nixpkgs.lib.nixosSystem systems.neelix.main;
|
||||||
|
iso.neelix = (nixpkgs.lib.nixosSystem systems.neelix.iso).config.system.build.isoImage;
|
||||||
|
nixosConfigurations.vm_neelix = nixpkgs.lib.nixosSystem systems.neelix.vm;
|
||||||
|
vm_iso.neelix = (nixpkgs.lib.nixosSystem systems.neelix.vm_iso).config.system.build.isoImage;
|
||||||
|
|
||||||
|
nixosConfigurations.hydra = nixpkgs.lib.nixosSystem systems.hydra.main;
|
||||||
|
iso.hydra = (nixpkgs.lib.nixosSystem systems.hydra.iso).config.system.build.isoImage;
|
||||||
|
nixosConfigurations.vm_hydra = nixpkgs.lib.nixosSystem systems.hydra.vm;
|
||||||
|
vm_iso.hydra = (nixpkgs.lib.nixosSystem systems.hydra.vm_iso).config.system.build.isoImage;
|
||||||
|
|
||||||
|
nixosConfigurations.ionlybootzfs = nixpkgs.lib.nixosSystem systems.ionlybootzfs.main;
|
||||||
|
iso.ionlybootzfs = (nixpkgs.lib.nixosSystem systems.ionlybootzfs.iso).config.system.build.isoImage;
|
||||||
|
nixosConfigurations.vm_ionlybootzfs = nixpkgs.lib.nixosSystem systems.ionlybootzfs.vm;
|
||||||
|
vm_iso.ionlybootzfs =
|
||||||
|
(nixpkgs.lib.nixosSystem systems.ionlybootzfs.vm_iso).config.system.build.isoImage;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
19
nix/configuration/hosts/hydra/DEPLOY_BOOT
Executable file
19
nix/configuration/hosts/hydra/DEPLOY_BOOT
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=hydra
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild boot --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#hydra'
|
||||||
19
nix/configuration/hosts/hydra/DEPLOY_SWITCH
Executable file
19
nix/configuration/hosts/hydra/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=hydra
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild switch --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#hydra'
|
||||||
12
nix/configuration/hosts/hydra/ISO
Executable file
12
nix/configuration/hosts/hydra/ISO
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.hydra" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
68
nix/configuration/hosts/hydra/default.nix
Normal file
68
nix/configuration/hosts/hydra/default.nix
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
#
|
||||||
|
# Testing:
|
||||||
|
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||||
|
# -accel kvm \
|
||||||
|
# -cpu host \
|
||||||
|
# -smp cores=8 \
|
||||||
|
# -m 32768 \
|
||||||
|
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||||
|
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
|
||||||
|
# -device nvme,serial=deadbeef,drive=nvm \
|
||||||
|
# -nic user,hostfwd=tcp::60022-:22 \
|
||||||
|
# -boot order=d \
|
||||||
|
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
|
||||||
|
# -display vnc=127.0.0.1:0
|
||||||
|
#
|
||||||
|
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./disk-config.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./optimized_build.nix
|
||||||
|
./vm_disk.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
|
networking.hostId = "fbd233d8";
|
||||||
|
|
||||||
|
networking.hostName = "hydra"; # Define your hostname.
|
||||||
|
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.secureBoot.enable = false;
|
||||||
|
|
||||||
|
me.optimizations = {
|
||||||
|
enable = true;
|
||||||
|
arch = "znver4";
|
||||||
|
system_features = [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Mount tmpfs at /tmp
|
||||||
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
|
me.emacs_flavor = "plainmacs";
|
||||||
|
me.graphical = false;
|
||||||
|
me.hydra.enable = false;
|
||||||
|
me.nix_worker.enable = true;
|
||||||
|
me.vm_disk.enable = true;
|
||||||
|
me.wireguard.activated = [ ];
|
||||||
|
me.wireguard.deactivated = [ ];
|
||||||
|
me.zsh.enable = true;
|
||||||
|
}
|
||||||
140
nix/configuration/hosts/hydra/disk-config.nix
Normal file
140
nix/configuration/hosts/hydra/disk-config.nix
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
# Manual Step:
|
||||||
|
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||||
|
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
lib.mkIf (!config.me.buildingIso) {
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "1G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [
|
||||||
|
"umask=0077"
|
||||||
|
"noatime"
|
||||||
|
"discard"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "zroot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
zroot = {
|
||||||
|
type = "zpool";
|
||||||
|
# mode = "mirror";
|
||||||
|
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||||
|
options.cachefile = "none";
|
||||||
|
options = {
|
||||||
|
ashift = "12";
|
||||||
|
compatibility = "openzfs-2.2-freebsd";
|
||||||
|
autotrim = "on";
|
||||||
|
};
|
||||||
|
rootFsOptions = {
|
||||||
|
acltype = "posixacl";
|
||||||
|
atime = "off";
|
||||||
|
relatime = "off";
|
||||||
|
xattr = "sa";
|
||||||
|
mountpoint = "none";
|
||||||
|
compression = "lz4";
|
||||||
|
canmount = "off";
|
||||||
|
utf8only = "on";
|
||||||
|
dnodesize = "auto";
|
||||||
|
normalization = "formD";
|
||||||
|
};
|
||||||
|
|
||||||
|
datasets = {
|
||||||
|
"linux/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "none";
|
||||||
|
};
|
||||||
|
"linux/nix/root" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||||
|
options = {
|
||||||
|
recordsize = "1MiB";
|
||||||
|
compression = "lz4";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"linux/nix/home" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/home";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/home@blank$' || zfs snapshot zroot/linux/nix/home@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/persist" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/persist";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/persist@blank$' || zfs snapshot zroot/linux/nix/persist@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/state" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/state";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/state@blank$' || zfs snapshot zroot/linux/nix/state@blank";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Make sure all persistent volumes are marked as neededForBoot
|
||||||
|
#
|
||||||
|
# Also mounts /home so it is mounted before the user home directories are created.
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
fileSystems."/state".neededForBoot = true;
|
||||||
|
fileSystems."/home".neededForBoot = true;
|
||||||
|
|
||||||
|
fileSystems."/".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/nix".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/persist".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/state".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/home".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
}
|
||||||
39
nix/configuration/hosts/hydra/hardware-configuration.nix
Normal file
39
nix/configuration/hosts/hydra/hardware-configuration.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.dhcpcd.enable = lib.mkForce true;
|
||||||
|
networking.useDHCP = lib.mkForce true;
|
||||||
|
networking.interfaces.enp0s2.useDHCP = lib.mkForce true;
|
||||||
|
# systemd.network.enable = true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
||||||
77
nix/configuration/hosts/hydra/vm_disk.nix
Normal file
77
nix/configuration/hosts/hydra/vm_disk.nix
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
vm_disk.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to mount the local disk for persistent storage.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.vm_disk.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
# Mount the local disk
|
||||||
|
fileSystems = {
|
||||||
|
"/.disk" = lib.mkForce {
|
||||||
|
device = "/dev/nvme0n1p1";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [
|
||||||
|
"noatime"
|
||||||
|
"discard"
|
||||||
|
];
|
||||||
|
neededForBoot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"/persist" = {
|
||||||
|
fsType = "none";
|
||||||
|
device = "/.disk/persist";
|
||||||
|
options = [
|
||||||
|
"bind"
|
||||||
|
"rw"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
"/.disk/persist"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/state" = {
|
||||||
|
fsType = "none";
|
||||||
|
device = "/.disk/state";
|
||||||
|
options = [
|
||||||
|
"bind"
|
||||||
|
"rw"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
"/.disk/state"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/nix/store" = lib.mkForce {
|
||||||
|
fsType = "overlay";
|
||||||
|
device = "overlay";
|
||||||
|
options = [
|
||||||
|
"lowerdir=/nix/.ro-store"
|
||||||
|
"upperdir=/.disk/persist/store"
|
||||||
|
"workdir=/.disk/state/work"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
"/nix/.ro-store"
|
||||||
|
"/.disk/persist/store"
|
||||||
|
"/.disk/state/work"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
19
nix/configuration/hosts/ionlybootzfs/DEPLOY_BOOT
Executable file
19
nix/configuration/hosts/ionlybootzfs/DEPLOY_BOOT
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET="ionlybootzfs"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild boot --flake "$DIR/../../#ionlybootzfs" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#ionlybootzfs'
|
||||||
19
nix/configuration/hosts/ionlybootzfs/DEPLOY_SWITCH
Executable file
19
nix/configuration/hosts/ionlybootzfs/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=ionlybootzfs
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild switch --flake "$DIR/../../#ionlybootzfs" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#ionlybootzfs'
|
||||||
12
nix/configuration/hosts/ionlybootzfs/ISO
Executable file
12
nix/configuration/hosts/ionlybootzfs/ISO
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.ionlybootzfs" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
63
nix/configuration/hosts/ionlybootzfs/default.nix
Normal file
63
nix/configuration/hosts/ionlybootzfs/default.nix
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#
|
||||||
|
# Testing:
|
||||||
|
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||||
|
# -accel kvm \
|
||||||
|
# -cpu host \
|
||||||
|
# -smp cores=8 \
|
||||||
|
# -m 32768 \
|
||||||
|
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||||
|
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
|
||||||
|
# -device nvme,serial=deadbeef,drive=nvm \
|
||||||
|
# -nic user,hostfwd=tcp::60022-:22 \
|
||||||
|
# -boot order=d \
|
||||||
|
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
|
||||||
|
# -display vnc=127.0.0.1:0
|
||||||
|
#
|
||||||
|
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./wrapped-disk-config.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
|
networking.hostId = "fbd233d8";
|
||||||
|
|
||||||
|
networking.hostName = "ionlybootzfs"; # Define your hostname.
|
||||||
|
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.secureBoot.enable = true;
|
||||||
|
|
||||||
|
me.optimizations = {
|
||||||
|
enable = false;
|
||||||
|
arch = "znver4";
|
||||||
|
system_features = [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Mount tmpfs at /tmp
|
||||||
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
|
me.emacs_flavor = "plainmacs";
|
||||||
|
me.graphical = false;
|
||||||
|
me.wireguard.activated = [ ];
|
||||||
|
me.wireguard.deactivated = [ ];
|
||||||
|
me.zsh.enable = true;
|
||||||
|
}
|
||||||
142
nix/configuration/hosts/ionlybootzfs/disk-config.nix
Normal file
142
nix/configuration/hosts/ionlybootzfs/disk-config.nix
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
# Manual Step:
|
||||||
|
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||||
|
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||||
|
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "1G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [
|
||||||
|
"umask=0077"
|
||||||
|
"noatime"
|
||||||
|
"discard"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "zroot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
zroot = {
|
||||||
|
type = "zpool";
|
||||||
|
# mode = "mirror";
|
||||||
|
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||||
|
options.cachefile = "none";
|
||||||
|
options = {
|
||||||
|
ashift = "12";
|
||||||
|
compatibility = "openzfs-2.2-freebsd";
|
||||||
|
autotrim = "on";
|
||||||
|
};
|
||||||
|
rootFsOptions = {
|
||||||
|
acltype = "posixacl";
|
||||||
|
atime = "off";
|
||||||
|
relatime = "off";
|
||||||
|
xattr = "sa";
|
||||||
|
mountpoint = "none";
|
||||||
|
compression = "lz4";
|
||||||
|
canmount = "off";
|
||||||
|
utf8only = "on";
|
||||||
|
dnodesize = "auto";
|
||||||
|
normalization = "formD";
|
||||||
|
};
|
||||||
|
|
||||||
|
datasets = {
|
||||||
|
"linux/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "none";
|
||||||
|
options = {
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
# keylocation = "file:///tmp/secret.key";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"linux/nix/root" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||||
|
options = {
|
||||||
|
recordsize = "16MiB";
|
||||||
|
compression = "zstd-19";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"linux/nix/home" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/home";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/home@blank$' || zfs snapshot zroot/linux/nix/home@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/persist" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/persist";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/persist@blank$' || zfs snapshot zroot/linux/nix/persist@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/state" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/state";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/state@blank$' || zfs snapshot zroot/linux/nix/state@blank";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Make sure all persistent volumes are marked as neededForBoot
|
||||||
|
#
|
||||||
|
# Also mounts /home so it is mounted before the user home directories are created.
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
fileSystems."/state".neededForBoot = true;
|
||||||
|
fileSystems."/home".neededForBoot = true;
|
||||||
|
|
||||||
|
fileSystems."/".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/nix".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/persist".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/state".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/home".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Only attempt to decrypt the main pool. Otherwise it attempts to decrypt pools that aren't even used.
|
||||||
|
boot.zfs.requestEncryptionCredentials = [ "zroot/linux/nix" ];
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.dhcpcd.enable = lib.mkForce true;
|
||||||
|
networking.useDHCP = lib.mkForce true;
|
||||||
|
# systemd.network.enable = true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
||||||
131
nix/configuration/hosts/ionlybootzfs/optimized_build.nix
Normal file
131
nix/configuration/hosts/ionlybootzfs/optimized_build.nix
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
pkgs-unoptimized,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{ }
|
||||||
|
(lib.mkIf (!config.me.optimizations.enable) {
|
||||||
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.optimizations.enable) {
|
||||||
|
nixpkgs.hostPlatform = {
|
||||||
|
gcc.arch = "znver4";
|
||||||
|
gcc.tune = "znver4";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(
|
||||||
|
final: prev:
|
||||||
|
let
|
||||||
|
addConfig =
|
||||||
|
additionalConfig: pkg:
|
||||||
|
pkg.override (oldconfig: {
|
||||||
|
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
linux_me = addConfig {
|
||||||
|
# Full preemption
|
||||||
|
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
||||||
|
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
||||||
|
|
||||||
|
# Google's BBRv3 TCP congestion Control
|
||||||
|
TCP_CONG_BBR = lib.kernel.yes;
|
||||||
|
DEFAULT_BBR = lib.kernel.yes;
|
||||||
|
|
||||||
|
# Preemptive Full Tickless Kernel at 300Hz
|
||||||
|
HZ = lib.kernel.freeform "300";
|
||||||
|
HZ_300 = lib.kernel.yes;
|
||||||
|
HZ_1000 = lib.kernel.no;
|
||||||
|
} prev.linux_6_14;
|
||||||
|
# gsl = prev.gsl.overrideAttrs (old: {
|
||||||
|
# # gsl tests fails when optimizations are enabled.
|
||||||
|
# # > FAIL: cholesky_invert unscaled hilbert ( 4, 4)[0,2]: 2.55795384873636067e-13 0
|
||||||
|
# # > (2.55795384873636067e-13 observed vs 0 expected) [28259614]
|
||||||
|
# doCheck = false;
|
||||||
|
# });
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(final: prev: {
|
||||||
|
haskellPackages = prev.haskellPackages.extend (
|
||||||
|
final': prev': {
|
||||||
|
inherit (pkgs-unoptimized.haskellPackages)
|
||||||
|
crypton
|
||||||
|
crypton-connection
|
||||||
|
crypton-x509
|
||||||
|
crypton-x509-store
|
||||||
|
crypton-x509-system
|
||||||
|
crypton-x509-validation
|
||||||
|
hspec-wai
|
||||||
|
http-client-tls
|
||||||
|
http2
|
||||||
|
pandoc
|
||||||
|
pandoc-cli
|
||||||
|
pandoc-lua-engine
|
||||||
|
pandoc-server
|
||||||
|
servant-server
|
||||||
|
tls
|
||||||
|
wai-app-static
|
||||||
|
wai-extra
|
||||||
|
warp
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})
|
||||||
|
(final: prev: {
|
||||||
|
inherit (pkgs-unoptimized)
|
||||||
|
gsl
|
||||||
|
redis
|
||||||
|
valkey
|
||||||
|
;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
||||||
|
})
|
||||||
|
(lib.mkIf (!config.me.buildingIso) {
|
||||||
|
nix.settings.system-features = lib.mkForce [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
||||||
|
# system.includeBuildDependencies = true;
|
||||||
|
|
||||||
|
# This also should enable building offline? TODO: test.
|
||||||
|
nix.extraOptions = ''
|
||||||
|
keep-outputs = true
|
||||||
|
keep-derivations = true
|
||||||
|
'';
|
||||||
|
|
||||||
|
# # building ON
|
||||||
|
# nixpkgs.localSystem = { system = "aarch64-linux"; };
|
||||||
|
# # building FOR
|
||||||
|
# nixpkgs.crossSystem = { system = "aarch64-linux"; };
|
||||||
|
|
||||||
|
# nixpkgs.config = {
|
||||||
|
# replaceStdenv = ({ pkgs }: pkgs.clangStdenv);
|
||||||
|
# };
|
||||||
|
# or maybe an overlay
|
||||||
|
# stdenv = prev.clangStdenv;
|
||||||
|
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.buildingIso) {
|
||||||
|
boot.supportedFilesystems.zfs = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
lib.mkIf (!config.me.buildingIso) (import ./disk-config.nix)
|
||||||
19
nix/configuration/hosts/neelix/DEPLOY_BOOT
Executable file
19
nix/configuration/hosts/neelix/DEPLOY_BOOT
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=neelix
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild boot --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#neelix'
|
||||||
19
nix/configuration/hosts/neelix/DEPLOY_SWITCH
Executable file
19
nix/configuration/hosts/neelix/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=neelix
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild switch --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#neelix'
|
||||||
@@ -3,12 +3,11 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disk-config.nix
|
./disk-config.nix
|
||||||
./optimized_build.nix
|
|
||||||
./power_management.nix
|
./power_management.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
networking.hostId = "fbd233d8";
|
networking.hostId = "bca9d0a5";
|
||||||
|
|
||||||
networking.hostName = "neelix"; # Define your hostname.
|
networking.hostName = "neelix"; # Define your hostname.
|
||||||
|
|
||||||
@@ -17,11 +16,25 @@
|
|||||||
|
|
||||||
me.secureBoot.enable = false;
|
me.secureBoot.enable = false;
|
||||||
|
|
||||||
|
me.optimizations = {
|
||||||
|
enable = false;
|
||||||
|
arch = "alderlake";
|
||||||
|
system_features = [
|
||||||
|
"gccarch-alderlake"
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Early KMS
|
# Early KMS
|
||||||
boot.initrd.kernelModules = [ "i915" ];
|
boot.initrd.kernelModules = [ "i915" ];
|
||||||
|
|
||||||
# Mount tmpfs at /tmp
|
# Mount tmpfs at /tmp
|
||||||
boot.tmp.useTmpfs = true;
|
# boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
me.bluetooth.enable = true;
|
me.bluetooth.enable = true;
|
||||||
me.emacs_flavor = "plainmacs";
|
me.emacs_flavor = "plainmacs";
|
||||||
|
|||||||
@@ -14,7 +14,14 @@
|
|||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
@@ -23,7 +30,7 @@
|
|||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = lib.mkDefault true;
|
# networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{ }
|
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
|
||||||
nix.settings.system-features = lib.mkForce [
|
|
||||||
"gccarch-alderlake"
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# nixpkgs.hostPlatform = {
|
|
||||||
# gcc.arch = "alderlake";
|
|
||||||
# gcc.tune = "alderlake";
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
|
|
||||||
# };
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(
|
|
||||||
self: super:
|
|
||||||
let
|
|
||||||
optimizeWithFlags =
|
|
||||||
pkg: flags:
|
|
||||||
pkg.overrideAttrs (old: {
|
|
||||||
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
|
||||||
});
|
|
||||||
addConfig =
|
|
||||||
additionalConfig: pkg:
|
|
||||||
pkg.override (oldconfig: {
|
|
||||||
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
linux_alderlake =
|
|
||||||
addConfig
|
|
||||||
{
|
|
||||||
# Full preemption
|
|
||||||
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
|
||||||
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
|
||||||
|
|
||||||
# Google's BBRv3 TCP congestion Control
|
|
||||||
TCP_CONG_BBR = lib.kernel.yes;
|
|
||||||
DEFAULT_BBR = lib.kernel.yes;
|
|
||||||
|
|
||||||
# Preemptive Full Tickless Kernel at 300Hz
|
|
||||||
HZ = lib.kernel.freeform "300";
|
|
||||||
HZ_300 = lib.kernel.yes;
|
|
||||||
HZ_1000 = lib.kernel.no;
|
|
||||||
}
|
|
||||||
(
|
|
||||||
optimizeWithFlags super.linux_6_12 [
|
|
||||||
"-march=alderlake"
|
|
||||||
"-mtune=alderlake"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_alderlake;
|
|
||||||
})
|
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
19
nix/configuration/hosts/odo/DEPLOY_BOOT
Executable file
19
nix/configuration/hosts/odo/DEPLOY_BOOT
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
# TARGET=10.216.1.15
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=odo
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#odo'
|
||||||
19
nix/configuration/hosts/odo/DEPLOY_SWITCH
Executable file
19
nix/configuration/hosts/odo/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=odo
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#odo'
|
||||||
12
nix/configuration/hosts/odo/ISO
Executable file
12
nix/configuration/hosts/odo/ISO
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.odo" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/odo/SELF_BOOT
Executable file
12
nix/configuration/hosts/odo/SELF_BOOT
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild boot --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/odo/SELF_BUILD
Executable file
12
nix/configuration/hosts/odo/SELF_BUILD
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild build --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/odo/SELF_SWITCH
Executable file
12
nix/configuration/hosts/odo/SELF_SWITCH
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild switch --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
{ config, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disk-config.nix
|
./wrapped-disk-config.nix
|
||||||
./optimized_build.nix
|
./distributed_build.nix
|
||||||
./power_management.nix
|
./power_management.nix
|
||||||
./screen_brightness.nix
|
./screen_brightness.nix
|
||||||
./wifi.nix
|
./wifi.nix
|
||||||
|
./framework_module.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
@@ -19,6 +25,22 @@
|
|||||||
|
|
||||||
me.secureBoot.enable = true;
|
me.secureBoot.enable = true;
|
||||||
|
|
||||||
|
me.optimizations = {
|
||||||
|
enable = false;
|
||||||
|
arch = "znver4";
|
||||||
|
system_features = [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Early KMS
|
# Early KMS
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
@@ -27,35 +49,58 @@
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
fw-ectool
|
fw-ectool
|
||||||
|
framework-tool
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Enable light sensor
|
||||||
|
# hardware.sensor.iio.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Enable TRIM
|
||||||
|
# services.fstrim.enable = lib.mkDefault true;
|
||||||
|
|
||||||
me.alacritty.enable = true;
|
me.alacritty.enable = true;
|
||||||
|
me.amd_s2idle.enable = true;
|
||||||
me.ansible.enable = true;
|
me.ansible.enable = true;
|
||||||
me.ares.enable = true;
|
me.ares.enable = true;
|
||||||
me.bluetooth.enable = true;
|
me.bluetooth.enable = true;
|
||||||
me.chromecast.enable = true;
|
me.chromecast.enable = true;
|
||||||
me.chromium.enable = true;
|
me.chromium.enable = true;
|
||||||
|
me.d2.enable = true;
|
||||||
|
me.direnv.enable = true;
|
||||||
me.docker.enable = true;
|
me.docker.enable = true;
|
||||||
|
me.ecc.enable = false;
|
||||||
me.emacs_flavor = "full";
|
me.emacs_flavor = "full";
|
||||||
me.firefox.enable = true;
|
me.firefox.enable = true;
|
||||||
|
me.flux.enable = true;
|
||||||
|
me.gcloud.enable = true;
|
||||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||||
|
me.gnuplot.enable = true;
|
||||||
me.gpg.enable = true;
|
me.gpg.enable = true;
|
||||||
me.graphical = true;
|
me.graphical = true;
|
||||||
me.graphics_card_type = "amd";
|
me.graphics_card_type = "amd";
|
||||||
me.kanshi.enable = true;
|
me.iso_mount.enable = true;
|
||||||
|
me.kanshi.enable = false;
|
||||||
me.kubernetes.enable = true;
|
me.kubernetes.enable = true;
|
||||||
me.latex.enable = true;
|
me.latex.enable = true;
|
||||||
me.launch_keyboard.enable = true;
|
me.launch_keyboard.enable = true;
|
||||||
me.lvfs.enable = true;
|
me.lvfs.enable = true;
|
||||||
me.media.enable = true;
|
me.media.enable = true;
|
||||||
me.nix_index.enable = true;
|
me.nix_index.enable = true;
|
||||||
|
me.pcsx2.enable = true;
|
||||||
me.python.enable = true;
|
me.python.enable = true;
|
||||||
me.qemu.enable = true;
|
me.qemu.enable = true;
|
||||||
|
me.rpcs3.enable = true;
|
||||||
me.rust.enable = true;
|
me.rust.enable = true;
|
||||||
|
me.shadps4.enable = true;
|
||||||
|
me.shikane.enable = true;
|
||||||
|
me.sops.enable = true;
|
||||||
me.sound.enable = true;
|
me.sound.enable = true;
|
||||||
me.steam.enable = true;
|
me.steam.enable = true;
|
||||||
|
me.steam_run_free.enable = true;
|
||||||
me.sway.enable = true;
|
me.sway.enable = true;
|
||||||
|
me.tekton.enable = true;
|
||||||
me.terraform.enable = true;
|
me.terraform.enable = true;
|
||||||
|
me.thunderbolt.enable = true;
|
||||||
me.vnc_client.enable = true;
|
me.vnc_client.enable = true;
|
||||||
me.vscode.enable = true;
|
me.vscode.enable = true;
|
||||||
me.wasm.enable = true;
|
me.wasm.enable = true;
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
# Manual Step:
|
# Manual Step:
|
||||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
lib.mkIf (!config.me.buildingIso) {
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
main = {
|
main = {
|
||||||
|
|||||||
27
nix/configuration/hosts/odo/distributed_build.nix
Normal file
27
nix/configuration/hosts/odo/distributed_build.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
me.distributed_build.enable = true;
|
||||||
|
me.distributed_build.machines.hydra = {
|
||||||
|
enable = true;
|
||||||
|
additional_config = {
|
||||||
|
speedFactor = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
me.distributed_build.machines.quark = {
|
||||||
|
enable = true;
|
||||||
|
additional_config = {
|
||||||
|
speedFactor = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
23
nix/configuration/hosts/odo/framework_module.nix
Normal file
23
nix/configuration/hosts/odo/framework_module.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||||
|
framework-laptop-kmod
|
||||||
|
];
|
||||||
|
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||||
|
boot.kernelModules = [
|
||||||
|
"cros_ec"
|
||||||
|
"cros_ec_lpcs"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = lib.mkDefault true;
|
# networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{ }
|
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
|
||||||
nix.settings.system-features = lib.mkForce [
|
|
||||||
"gccarch-znver4"
|
|
||||||
"gccarch-skylake"
|
|
||||||
# "gccarch-alderlake" missing WAITPKG
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"gccarch-x86-64-v4"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# nixpkgs.hostPlatform = {
|
|
||||||
# gcc.arch = "znver4";
|
|
||||||
# gcc.tune = "znver4";
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
|
|
||||||
# };
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(
|
|
||||||
self: super:
|
|
||||||
let
|
|
||||||
optimizeWithFlags =
|
|
||||||
pkg: flags:
|
|
||||||
pkg.overrideAttrs (old: {
|
|
||||||
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
|
||||||
});
|
|
||||||
addConfig =
|
|
||||||
additionalConfig: pkg:
|
|
||||||
pkg.override (oldconfig: {
|
|
||||||
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
linux_znver4 =
|
|
||||||
addConfig
|
|
||||||
{
|
|
||||||
# Full preemption
|
|
||||||
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
|
||||||
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
|
||||||
|
|
||||||
# Google's BBRv3 TCP congestion Control
|
|
||||||
TCP_CONG_BBR = lib.kernel.yes;
|
|
||||||
DEFAULT_BBR = lib.kernel.yes;
|
|
||||||
|
|
||||||
# Preemptive Full Tickless Kernel at 300Hz
|
|
||||||
HZ = lib.kernel.freeform "300";
|
|
||||||
HZ_300 = lib.kernel.yes;
|
|
||||||
HZ_1000 = lib.kernel.no;
|
|
||||||
}
|
|
||||||
(
|
|
||||||
optimizeWithFlags super.linux_6_12 [
|
|
||||||
"-march=znver4"
|
|
||||||
"-mtune=znver4"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4;
|
|
||||||
})
|
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
|
||||||
boot.supportedFilesystems.zfs = true;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||||
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"amdgpu.abmlevel=3"
|
"amdgpu.abmlevel=2"
|
||||||
"pcie_aspm=force"
|
"pcie_aspm=force"
|
||||||
# "pcie_aspm.policy=powersupersave"
|
# "pcie_aspm.policy=powersupersave"
|
||||||
"nowatchdog"
|
"nowatchdog"
|
||||||
@@ -47,6 +47,22 @@
|
|||||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||||
|
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||||
|
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 85"
|
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 21845"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,10 @@
|
|||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
# Doesn't seem necessary starting with 6.13
|
||||||
doas iw dev wlan0 set power_save off
|
# environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||||
'';
|
# doas iw dev wlan0 set power_save off
|
||||||
|
# '';
|
||||||
|
|
||||||
# Enable debug logging for ath12k wifi card.
|
# Enable debug logging for ath12k wifi card.
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
|
|||||||
8
nix/configuration/hosts/odo/wrapped-disk-config.nix
Normal file
8
nix/configuration/hosts/odo/wrapped-disk-config.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
lib.mkIf (!config.me.buildingIso) (import ./disk-config.nix)
|
||||||
19
nix/configuration/hosts/quark/DEPLOY_BOOT
Executable file
19
nix/configuration/hosts/quark/DEPLOY_BOOT
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.15
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=quark
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild boot --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#quark'
|
||||||
19
nix/configuration/hosts/quark/DEPLOY_SWITCH
Executable file
19
nix/configuration/hosts/quark/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
#TARGET=10.216.1.14
|
||||||
|
# TARGET=192.168.211.250
|
||||||
|
TARGET=quark
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
|
||||||
|
nixos-rebuild switch --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
|
|
||||||
|
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#quark'
|
||||||
12
nix/configuration/hosts/quark/ISO
Executable file
12
nix/configuration/hosts/quark/ISO
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.quark" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/quark/SELF_BOOT
Executable file
12
nix/configuration/hosts/quark/SELF_BOOT
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild boot --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/quark/SELF_BUILD
Executable file
12
nix/configuration/hosts/quark/SELF_BUILD
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild build --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||||
12
nix/configuration/hosts/quark/SELF_SWITCH
Executable file
12
nix/configuration/hosts/quark/SELF_SWITCH
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
: "${JOBS:="1"}"
|
||||||
|
|
||||||
|
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||||
|
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||||
|
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||||
|
nixos-rebuild switch --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||||
117
nix/configuration/hosts/quark/default.nix
Normal file
117
nix/configuration/hosts/quark/default.nix
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./disk-config.nix
|
||||||
|
./distributed_build.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./power_management.nix
|
||||||
|
./wifi.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
|
networking.hostId = "47ee7d7c";
|
||||||
|
|
||||||
|
networking.hostName = "quark"; # Define your hostname.
|
||||||
|
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
me.secureBoot.enable = true;
|
||||||
|
|
||||||
|
me.optimizations = {
|
||||||
|
enable = true;
|
||||||
|
arch = "znver5";
|
||||||
|
system_features = [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-znver5"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Early KMS
|
||||||
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
|
# Mount tmpfs at /tmp
|
||||||
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
|
# Enable TRIM
|
||||||
|
# services.fstrim.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# RPCS3 has difficulty with znver5
|
||||||
|
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||||
|
|
||||||
|
me.alacritty.enable = true;
|
||||||
|
me.amd_s2idle.enable = true;
|
||||||
|
me.ansible.enable = true;
|
||||||
|
me.ares.enable = true;
|
||||||
|
me.bluetooth.enable = true;
|
||||||
|
me.chromecast.enable = true;
|
||||||
|
me.chromium.enable = true;
|
||||||
|
me.d2.enable = true;
|
||||||
|
me.direnv.enable = true;
|
||||||
|
me.docker.enable = true;
|
||||||
|
me.ecc.enable = true;
|
||||||
|
me.emacs_flavor = "full";
|
||||||
|
me.firefox.enable = true;
|
||||||
|
me.flux.enable = true;
|
||||||
|
me.gcloud.enable = true;
|
||||||
|
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||||
|
me.gnuplot.enable = true;
|
||||||
|
me.gpg.enable = true;
|
||||||
|
me.graphical = true;
|
||||||
|
me.graphics_card_type = "amd";
|
||||||
|
me.iso_mount.enable = true;
|
||||||
|
me.kanshi.enable = false;
|
||||||
|
me.kubernetes.enable = true;
|
||||||
|
me.latex.enable = true;
|
||||||
|
me.launch_keyboard.enable = true;
|
||||||
|
me.lvfs.enable = true;
|
||||||
|
me.media.enable = true;
|
||||||
|
me.nix_index.enable = true;
|
||||||
|
me.nix_worker.enable = true;
|
||||||
|
me.pcsx2.enable = true;
|
||||||
|
me.python.enable = true;
|
||||||
|
me.qemu.enable = true;
|
||||||
|
me.rpcs3.enable = true;
|
||||||
|
me.rust.enable = true;
|
||||||
|
me.shadps4.enable = true;
|
||||||
|
me.shikane.enable = true;
|
||||||
|
me.sops.enable = true;
|
||||||
|
me.sound.enable = true;
|
||||||
|
me.steam.enable = true;
|
||||||
|
me.steam_run_free.enable = true;
|
||||||
|
me.sway.enable = true;
|
||||||
|
me.tekton.enable = true;
|
||||||
|
me.terraform.enable = true;
|
||||||
|
me.thunderbolt.enable = true;
|
||||||
|
me.vnc_client.enable = true;
|
||||||
|
me.vscode.enable = true;
|
||||||
|
me.wasm.enable = true;
|
||||||
|
me.waybar.enable = true;
|
||||||
|
me.wireguard.activated = [
|
||||||
|
"drmario"
|
||||||
|
"wgh"
|
||||||
|
"colo"
|
||||||
|
];
|
||||||
|
me.wireguard.deactivated = [ "wgf" ];
|
||||||
|
me.zrepl.enable = true;
|
||||||
|
me.zsh.enable = true;
|
||||||
|
|
||||||
|
me.sm64ex.enable = true;
|
||||||
|
me.shipwright.enable = true;
|
||||||
|
me.ship2harkinian.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
148
nix/configuration/hosts/quark/disk-config.nix
Normal file
148
nix/configuration/hosts/quark/disk-config.nix
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
# Manual Step:
|
||||||
|
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||||
|
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
lib.mkIf (!config.me.buildingIso) {
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "1G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [
|
||||||
|
"umask=0077"
|
||||||
|
"noatime"
|
||||||
|
"discard"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "zroot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
zroot = {
|
||||||
|
type = "zpool";
|
||||||
|
# mode = "mirror";
|
||||||
|
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||||
|
options.cachefile = "none";
|
||||||
|
options = {
|
||||||
|
ashift = "12";
|
||||||
|
compatibility = "openzfs-2.2-freebsd";
|
||||||
|
autotrim = "on";
|
||||||
|
};
|
||||||
|
rootFsOptions = {
|
||||||
|
acltype = "posixacl";
|
||||||
|
atime = "off";
|
||||||
|
relatime = "off";
|
||||||
|
xattr = "sa";
|
||||||
|
mountpoint = "none";
|
||||||
|
compression = "lz4";
|
||||||
|
canmount = "off";
|
||||||
|
utf8only = "on";
|
||||||
|
dnodesize = "auto";
|
||||||
|
normalization = "formD";
|
||||||
|
};
|
||||||
|
|
||||||
|
datasets = {
|
||||||
|
"linux/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "none";
|
||||||
|
options = {
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
# keylocation = "file:///tmp/secret.key";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"linux/nix/root" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||||
|
options = {
|
||||||
|
recordsize = "16MiB";
|
||||||
|
compression = "zstd-19";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"linux/nix/home" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/home";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/home@blank$' || zfs snapshot zroot/linux/nix/home@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/persist" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/persist";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/persist@blank$' || zfs snapshot zroot/linux/nix/persist@blank";
|
||||||
|
};
|
||||||
|
"linux/nix/state" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/state";
|
||||||
|
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/state@blank$' || zfs snapshot zroot/linux/nix/state@blank";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Make sure all persistent volumes are marked as neededForBoot
|
||||||
|
#
|
||||||
|
# Also mounts /home so it is mounted before the user home directories are created.
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
fileSystems."/state".neededForBoot = true;
|
||||||
|
fileSystems."/home".neededForBoot = true;
|
||||||
|
|
||||||
|
fileSystems."/".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/nix".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/persist".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/state".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
fileSystems."/home".options = [
|
||||||
|
"noatime"
|
||||||
|
"norelatime"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Only attempt to decrypt the main pool. Otherwise it attempts to decrypt pools that aren't even used.
|
||||||
|
boot.zfs.requestEncryptionCredentials = [ "zroot/linux/nix" ];
|
||||||
|
}
|
||||||
21
nix/configuration/hosts/quark/distributed_build.nix
Normal file
21
nix/configuration/hosts/quark/distributed_build.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
me.distributed_build.enable = true;
|
||||||
|
me.distributed_build.machines.hydra = {
|
||||||
|
enable = true;
|
||||||
|
additional_config = {
|
||||||
|
speedFactor = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
35
nix/configuration/hosts/quark/hardware-configuration.nix
Normal file
35
nix/configuration/hosts/quark/hardware-configuration.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"thunderbolt"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
# networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
48
nix/configuration/hosts/quark/power_management.nix
Normal file
48
nix/configuration/hosts/quark/power_management.nix
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
powertop
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
# Enable undervolting GPU.
|
||||||
|
# "amdgpu.ppfeaturemask=0xfff7ffff"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||||
|
# "w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||||
|
];
|
||||||
|
|
||||||
|
# services.udev.packages = [
|
||||||
|
# (pkgs.writeTextFile {
|
||||||
|
# name = "amdgpu-low-power";
|
||||||
|
# text = ''
|
||||||
|
# ACTION=="add", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="low"
|
||||||
|
# '';
|
||||||
|
# destination = "/etc/udev/rules.d/30-amdgpu-low-power.rules";
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
}
|
||||||
16
nix/configuration/hosts/quark/wifi.nix
Normal file
16
nix/configuration/hosts/quark/wifi.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||||
|
doas iw dev wlan0 set power_save off
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -24,10 +24,8 @@
|
|||||||
xdg-utils # for xdg-open
|
xdg-utils # for xdg-open
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.talexander =
|
me.install.user.talexander.file = {
|
||||||
{ pkgs, ... }:
|
".config/alacritty/alacritty.toml" = {
|
||||||
{
|
|
||||||
home.file.".config/alacritty/alacritty.toml" = {
|
|
||||||
source = ./files/alacritty.toml;
|
source = ./files/alacritty.toml;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
29
nix/configuration/roles/amd_s2idle/default.nix
Normal file
29
nix/configuration/roles/amd_s2idle/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
amd_s2idle.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install amd_s2idle.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.amd_s2idle.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
amd-debug-tools
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -75,9 +75,14 @@
|
|||||||
# options root=PARTUUID=17e325bf-a378-4d1d-be6a-f6df5476f0fa
|
# options root=PARTUUID=17e325bf-a378-4d1d-be6a-f6df5476f0fa
|
||||||
# '';
|
# '';
|
||||||
# };
|
# };
|
||||||
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
directories = [
|
||||||
|
"/var/lib/sbctl" # Secure Boot Keys
|
||||||
|
];
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(lib.mkIf (config.me.secureBoot.enable) {
|
(lib.mkIf (config.me.secureBoot.enable) {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
sbctl
|
sbctl
|
||||||
];
|
];
|
||||||
@@ -86,12 +91,6 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
pkiBundle = "/var/lib/sbctl";
|
pkiBundle = "/var/lib/sbctl";
|
||||||
};
|
};
|
||||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
|
||||||
hideMounts = true;
|
|
||||||
directories = [
|
|
||||||
"/var/lib/sbctl" # Secure Boot Keys
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
{ }
|
{ }
|
||||||
(lib.mkIf config.me.graphical {
|
(lib.mkIf config.me.graphical {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(chromium.override { enableWideVine = true; })
|
chromium
|
||||||
];
|
];
|
||||||
allowedUnfree = [
|
allowedUnfree = [
|
||||||
"chromium"
|
"chromium"
|
||||||
@@ -57,8 +57,18 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
chromium = prev.chromium.override {
|
||||||
|
enableWideVine = true;
|
||||||
|
commandLineArgs = [
|
||||||
|
"--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,AcceleratedVideoEncoder"
|
||||||
# Enabling vulkan causes video to render as white
|
# Enabling vulkan causes video to render as white
|
||||||
# nixpkgs.config.chromium.commandLineArgs = "--enable-features=Vulkan";
|
# "--enable-features=Vulkan";
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
29
nix/configuration/roles/d2/default.nix
Normal file
29
nix/configuration/roles/d2/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
d2.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install d2.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.d2.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
d2
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
55
nix/configuration/roles/direnv/default.nix
Normal file
55
nix/configuration/roles/direnv/default.nix
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
direnv_zsh_hook = pkgs.writeTextFile {
|
||||||
|
name = "direnv_zsh_hook.zsh";
|
||||||
|
text = ''
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
direnv.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install direnv.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.direnv.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
direnv
|
||||||
|
nix-direnv
|
||||||
|
];
|
||||||
|
|
||||||
|
me.zsh.includes = [ direnv_zsh_hook ];
|
||||||
|
|
||||||
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# List of allowed directories from `direnv allow`.
|
||||||
|
directory = ".local/share/direnv";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
105
nix/configuration/roles/distributed_build/default.nix
Normal file
105
nix/configuration/roles/distributed_build/default.nix
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
make_machine_config = name: {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to use the ${name} machine during distributed builds.";
|
||||||
|
};
|
||||||
|
|
||||||
|
additional_config = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
default = { };
|
||||||
|
example = lib.literalExpression {
|
||||||
|
speedFactor = 2;
|
||||||
|
};
|
||||||
|
description = "Additional config values for the buildMachines entry. For example, speedFactor.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
distributed_build.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to use multiple machines to perform a nixos-rebuild.";
|
||||||
|
};
|
||||||
|
|
||||||
|
distributed_build.machines.hydra = make_machine_config "hydra";
|
||||||
|
distributed_build.machines.quark = make_machine_config "quark";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.distributed_build.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
nix.distributedBuilds = true;
|
||||||
|
}
|
||||||
|
(lib.mkIf config.me.distributed_build.machines.hydra.enable {
|
||||||
|
nix.buildMachines = [
|
||||||
|
(
|
||||||
|
{
|
||||||
|
hostName = "hydra";
|
||||||
|
sshUser = "nixworker";
|
||||||
|
# sshKey = "";
|
||||||
|
# publicHostKey = "";
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
# "aarch64-linux"
|
||||||
|
];
|
||||||
|
maxJobs = 1;
|
||||||
|
supportedFeatures = [
|
||||||
|
# "nixos-test"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
# "kvm"
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"gccarch-znver4"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// config.me.distributed_build.machines.hydra.additional_config
|
||||||
|
)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(lib.mkIf config.me.distributed_build.machines.quark.enable {
|
||||||
|
nix.buildMachines = [
|
||||||
|
(
|
||||||
|
{
|
||||||
|
hostName = "quark";
|
||||||
|
sshUser = "nixworker";
|
||||||
|
sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
|
||||||
|
# From: base64 -w0 /persist/ssh/ssh_host_ed25519_key.pub
|
||||||
|
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUx0alplYlVYTkRkU3Y1enVGbjM3eFNMZUN3S2hPKzFMdWovM2FYNFJRTEEgcm9vdEBxdWFyawo=";
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
# "aarch64-linux"
|
||||||
|
];
|
||||||
|
maxJobs = 1;
|
||||||
|
supportedFeatures = [
|
||||||
|
# "nixos-test"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
# "kvm"
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-znver5"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// config.me.distributed_build.machines.quark.additional_config
|
||||||
|
)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -56,6 +56,32 @@
|
|||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.link-docker-creds = {
|
||||||
|
# Contains credentials so it cannot be added to the nix store
|
||||||
|
enable = true;
|
||||||
|
description = "link-docker-creds";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "multi-user.target" ];
|
||||||
|
after = [ "multi-user.target" ];
|
||||||
|
# path = with pkgs; [
|
||||||
|
# zfs
|
||||||
|
# ];
|
||||||
|
unitConfig.DefaultDependencies = "no";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = "yes";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
if [ -e /persist/manual/docker/config.json ]; then
|
||||||
|
install --directory --owner talexander --group talexander --mode 0700 /home/talexander/.docker
|
||||||
|
ln -s /persist/manual/docker/config.json /home/talexander/.docker/config.json
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
preStop = ''
|
||||||
|
rm -f /home/talexander/.docker/config.json
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Needed for non-rootless docker
|
# Needed for non-rootless docker
|
||||||
users.users.talexander.extraGroups = [ "docker" ];
|
users.users.talexander.extraGroups = [ "docker" ];
|
||||||
}
|
}
|
||||||
|
|||||||
28
nix/configuration/roles/ecc/default.nix
Normal file
28
nix/configuration/roles/ecc/default.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Check memory errors with: ras-mc-ctl --error-count
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
ecc.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install ecc.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.ecc.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
hardware.rasdaemon.enable = true;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -89,7 +89,7 @@ in
|
|||||||
(lib.mkIf (config.me.graphical) {
|
(lib.mkIf (config.me.graphical) {
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
my_emacs = final.emacs29-pgtk;
|
my_emacs = final.emacs-pgtk;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
@@ -113,7 +113,7 @@ in
|
|||||||
"doc"
|
"doc"
|
||||||
"info"
|
"info"
|
||||||
];
|
];
|
||||||
buildInputs = [ final.makeWrapper ];
|
nativeBuildInputs = [ final.makeWrapper ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/emacs --prefix PATH : ${
|
wrapProgram $out/bin/emacs --prefix PATH : ${
|
||||||
lib.makeBinPath [
|
lib.makeBinPath [
|
||||||
@@ -121,6 +121,7 @@ in
|
|||||||
dicts: with dicts; [
|
dicts: with dicts; [
|
||||||
en
|
en
|
||||||
en-computers
|
en-computers
|
||||||
|
# en-science # TODO: Why is en-science non-free?
|
||||||
]
|
]
|
||||||
))
|
))
|
||||||
final.nixd # nix language server
|
final.nixd # nix language server
|
||||||
@@ -129,6 +130,11 @@ in
|
|||||||
final.shellcheck
|
final.shellcheck
|
||||||
final.cmake-language-server
|
final.cmake-language-server
|
||||||
final.cmake # Used by cmake-language-server
|
final.cmake # Used by cmake-language-server
|
||||||
|
final.rust-analyzer
|
||||||
|
final.prettier # Format yaml, json, and JS
|
||||||
|
final.terraform-ls
|
||||||
|
final.typescript-language-server
|
||||||
|
final.tex
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
@@ -136,10 +142,8 @@ in
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.talexander =
|
me.install.user.talexander.file = {
|
||||||
{ pkgs, ... }:
|
".config/emacs" = {
|
||||||
{
|
|
||||||
home.file.".config/emacs" = {
|
|
||||||
source = ./files/emacs;
|
source = ./files/emacs;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,17 +14,6 @@
|
|||||||
|
|
||||||
;; Other packages
|
;; Other packages
|
||||||
|
|
||||||
(use-package emacs
|
|
||||||
:config
|
|
||||||
(setq enable-recursive-minibuffers t)
|
|
||||||
|
|
||||||
;; Filter the M-x list base on the current mode
|
|
||||||
(setq read-extended-command-predicate #'command-completion-default-include-p)
|
|
||||||
|
|
||||||
;; Enable triggering completion with the tab key.
|
|
||||||
(setq tab-always-indent 'complete)
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
:config
|
:config
|
||||||
(dashboard-setup-startup-hook))
|
(dashboard-setup-startup-hook))
|
||||||
@@ -51,17 +40,27 @@
|
|||||||
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
;; This is an emacs built-in but we're pulling the latest version
|
;; This is an emacs built-in but we're pulling the latest version
|
||||||
|
:pin gnu
|
||||||
:config
|
:config
|
||||||
(savehist-mode))
|
(savehist-mode))
|
||||||
|
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
|
:pin gnu
|
||||||
:diminish
|
:diminish
|
||||||
:config
|
:config
|
||||||
(which-key-mode))
|
(which-key-mode))
|
||||||
|
|
||||||
(use-package windmove
|
(use-package windmove
|
||||||
:config
|
;; This is an emacs built-in but we're pulling the latest version
|
||||||
(windmove-default-keybindings))
|
:pin gnu
|
||||||
|
:bind
|
||||||
|
(
|
||||||
|
("S-<up>" . windmove-up)
|
||||||
|
("S-<right>" . windmove-right)
|
||||||
|
("S-<down>" . windmove-down)
|
||||||
|
("S-<left>" . windmove-left)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(setq tramp-default-method "ssh")
|
(setq tramp-default-method "ssh")
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,51 @@
|
|||||||
(setq autoload-directory (concat user-emacs-directory (file-name-as-directory "elisp") (file-name-as-directory "autoload")))
|
(setq autoload-directory (concat user-emacs-directory (file-name-as-directory "elisp") (file-name-as-directory "autoload")))
|
||||||
(add-to-list 'load-path (assert-directory autoload-directory))
|
(add-to-list 'load-path (assert-directory autoload-directory))
|
||||||
|
|
||||||
(setq-default
|
(use-package emacs
|
||||||
|
:ensure nil
|
||||||
|
:bind
|
||||||
|
(("C-z" . nil)
|
||||||
|
("C-x C-z" . nil)
|
||||||
|
("RET" . newline-and-indent)
|
||||||
|
)
|
||||||
|
:custom
|
||||||
|
;; Replace highlighted text if you start typing.
|
||||||
|
(delete-selection-mode 1)
|
||||||
|
|
||||||
|
(history-length 300)
|
||||||
|
|
||||||
|
;; Enable auto-revert for buffers like dired
|
||||||
|
(global-auto-revert-non-file-buffers t)
|
||||||
|
|
||||||
|
;; If the underlying file changes, reload it automatically. This is useful for moving around in git without confusing language servers.
|
||||||
|
(auto-revert-avoid-polling t)
|
||||||
|
(auto-revert-interval 5)
|
||||||
|
(auto-revert-check-vc-info t)
|
||||||
|
(global-auto-revert-mode t)
|
||||||
|
|
||||||
;; Disable backup files and lockfiles
|
;; Disable backup files and lockfiles
|
||||||
make-backup-files nil
|
(create-lockfiles nil)
|
||||||
auto-save-default nil
|
(make-backup-files nil)
|
||||||
create-lockfiles nil
|
(backup-inhibited t)
|
||||||
|
|
||||||
|
;; Do not auto-save files
|
||||||
|
(auto-save-default nil)
|
||||||
|
|
||||||
|
(pixel-scroll-precision-mode t)
|
||||||
|
(pixel-scroll-precision-use-momentum nil)
|
||||||
|
|
||||||
|
:config
|
||||||
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
|
;; Filter the M-x list base on the current mode
|
||||||
|
(setq read-extended-command-predicate #'command-completion-default-include-p)
|
||||||
|
|
||||||
|
;; Enable triggering completion with the tab key.
|
||||||
|
(setq tab-always-indent 'complete)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
(setq-default
|
||||||
;; Unless otherwise specified, always install packages if they are absent.
|
;; Unless otherwise specified, always install packages if they are absent.
|
||||||
use-package-always-ensure t
|
use-package-always-ensure t
|
||||||
;; Point custom-file at /dev/null so emacs does not write any settings to my dotfiles.
|
;; Point custom-file at /dev/null so emacs does not write any settings to my dotfiles.
|
||||||
@@ -63,6 +103,9 @@
|
|||||||
show-trailing-whitespace t
|
show-trailing-whitespace t
|
||||||
;; Remove the line when killing it with ctrl-k
|
;; Remove the line when killing it with ctrl-k
|
||||||
kill-whole-line t
|
kill-whole-line t
|
||||||
|
|
||||||
|
;; Show the current project in the mode line
|
||||||
|
project-mode-line t
|
||||||
)
|
)
|
||||||
|
|
||||||
;; (setq-default fringes-outside-margins t)
|
;; (setq-default fringes-outside-margins t)
|
||||||
@@ -77,12 +120,6 @@
|
|||||||
;; Delete trailing whitespace before save
|
;; Delete trailing whitespace before save
|
||||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||||
|
|
||||||
;; If the underlying file changes, reload it automatically. This is useful for moving around in git without confusing language servers.
|
|
||||||
(setopt auto-revert-avoid-polling t)
|
|
||||||
(setopt auto-revert-interval 5)
|
|
||||||
(setopt auto-revert-check-vc-info t)
|
|
||||||
(global-auto-revert-mode)
|
|
||||||
|
|
||||||
;;;;; Performance
|
;;;;; Performance
|
||||||
;; Run garbage collect when emacs is idle
|
;; Run garbage collect when emacs is idle
|
||||||
(run-with-idle-timer 5 t (lambda () (garbage-collect)))
|
(run-with-idle-timer 5 t (lambda () (garbage-collect)))
|
||||||
|
|||||||
16
nix/configuration/roles/emacs/files/emacs/elisp/lang-d2.el
Normal file
16
nix/configuration/roles/emacs/files/emacs/elisp/lang-d2.el
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
(defun d2-format-buffer ()
|
||||||
|
"Run prettier."
|
||||||
|
(interactive)
|
||||||
|
(run-command-on-buffer "d2" "fmt" "-")
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package d2-mode
|
||||||
|
:commands (d2-mode)
|
||||||
|
:hook (
|
||||||
|
(d2-mode . (lambda ()
|
||||||
|
;; (add-hook 'before-save-hook 'd2-format-buffer nil 'local)
|
||||||
|
))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(provide 'lang-d2)
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
(require 'common-lsp)
|
(require 'common-lsp)
|
||||||
(require 'util-tree-sitter)
|
(require 'util-tree-sitter)
|
||||||
|
|
||||||
|
(defun js-format-buffer ()
|
||||||
|
"Run prettier."
|
||||||
|
(interactive)
|
||||||
|
(run-command-on-buffer "prettier" "--stdin-filepath" buffer-file-name)
|
||||||
|
)
|
||||||
|
|
||||||
(use-package json-ts-mode
|
(use-package json-ts-mode
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:pin manual
|
:pin manual
|
||||||
@@ -113,10 +119,14 @@
|
|||||||
("\\.js\\'" . js-ts-mode)
|
("\\.js\\'" . js-ts-mode)
|
||||||
)
|
)
|
||||||
:commands (js-ts-mode)
|
:commands (js-ts-mode)
|
||||||
|
:custom (
|
||||||
|
(js-indent-level 2)
|
||||||
|
)
|
||||||
:hook (
|
:hook (
|
||||||
(js-ts-mode . (lambda ()
|
(js-ts-mode . (lambda ()
|
||||||
(when-linux
|
(when-linux
|
||||||
(eglot-ensure)
|
(eglot-ensure)
|
||||||
|
(add-hook 'before-save-hook 'js-format-buffer nil 'local)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
(use-package org
|
(use-package org
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:commands org-mode
|
:commands org-mode
|
||||||
:bind (
|
:bind (:map org-mode-map
|
||||||
("C-c l" . org-store-link)
|
("C-c l" . org-store-link)
|
||||||
("C-c a" . org-agenda)
|
("C-c a" . org-agenda)
|
||||||
("C--" . org-timestamp-down)
|
("S-<up>" . org-shiftup)
|
||||||
("C-=" . org-timestamp-up)
|
("S-<right>" . org-shiftright)
|
||||||
|
("S-<down>" . org-shiftdown)
|
||||||
|
("S-<left>" . org-shiftleft)
|
||||||
)
|
)
|
||||||
:hook (
|
:hook (
|
||||||
(org-mode . (lambda ()
|
(org-mode . (lambda ()
|
||||||
(org-indent-mode +1)
|
(org-indent-mode +1)
|
||||||
))
|
))
|
||||||
|
;; Make windmove work in Org mode:
|
||||||
|
(org-shiftup-final . windmove-up)
|
||||||
|
(org-shiftleft-final . windmove-left)
|
||||||
|
(org-shiftdown-final . windmove-down)
|
||||||
|
(org-shiftright-final . windmove-right)
|
||||||
)
|
)
|
||||||
:config
|
:config
|
||||||
(require 'org-tempo)
|
(require 'org-tempo)
|
||||||
@@ -80,4 +87,8 @@
|
|||||||
(use-package gnuplot)
|
(use-package gnuplot)
|
||||||
(use-package graphviz-dot-mode)
|
(use-package graphviz-dot-mode)
|
||||||
|
|
||||||
|
(use-package htmlize
|
||||||
|
;; For syntax highlighting when exporting to HTML.
|
||||||
|
)
|
||||||
|
|
||||||
(provide 'lang-org)
|
(provide 'lang-org)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
(when rust-analyzer-command
|
(when rust-analyzer-command
|
||||||
;; (add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command)))
|
;; (add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command)))
|
||||||
(add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command :initializationOptions (:imports (:granularity (:enforce t :group "item")
|
(add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command :initializationOptions (:imports (:granularity (:enforce t :group "item")
|
||||||
:merge (:glob nil)
|
:merge (:glob :json-false)
|
||||||
:prefix "self")
|
:prefix "self")
|
||||||
))))
|
))))
|
||||||
)
|
)
|
||||||
@@ -60,8 +60,8 @@
|
|||||||
(unless (treesit-ready-p 'rust) (treesit-install-language-grammar 'rust))
|
(unless (treesit-ready-p 'rust) (treesit-install-language-grammar 'rust))
|
||||||
:config
|
:config
|
||||||
;; Add keybindings for interacting with Cargo
|
;; Add keybindings for interacting with Cargo
|
||||||
(use-package cargo
|
;; (use-package cargo
|
||||||
:hook (rust-ts-mode . cargo-minor-mode))
|
;; :hook (rust-ts-mode . cargo-minor-mode))
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package toml-ts-mode
|
(use-package toml-ts-mode
|
||||||
|
|||||||
@@ -40,4 +40,6 @@
|
|||||||
|
|
||||||
(require 'lang-cmake)
|
(require 'lang-cmake)
|
||||||
|
|
||||||
|
(require 'lang-d2)
|
||||||
|
|
||||||
(load-directory autoload-directory)
|
(load-directory autoload-directory)
|
||||||
|
|||||||
@@ -73,6 +73,9 @@
|
|||||||
"+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC,-CanvasExtractionBeforeUserInputIsBlocked";
|
"+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC,-CanvasExtractionBeforeUserInputIsBlocked";
|
||||||
# Disable weather on new tab page
|
# Disable weather on new tab page
|
||||||
"browser.newtabpage.activity-stream.showWeather" = false;
|
"browser.newtabpage.activity-stream.showWeather" = false;
|
||||||
|
# Disable AI stuff that wastes battery life
|
||||||
|
"browser.ml.chat.enabled" = false;
|
||||||
|
"browser.ml.enabled" = false;
|
||||||
};
|
};
|
||||||
# Check about:policies#documentation and https://mozilla.github.io/policy-templates/ for options.
|
# Check about:policies#documentation and https://mozilla.github.io/policy-templates/ for options.
|
||||||
policies = {
|
policies = {
|
||||||
@@ -88,10 +91,10 @@
|
|||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||||
installation_mode = "force_installed";
|
installation_mode = "force_installed";
|
||||||
};
|
};
|
||||||
"firefox@teleparty.com" = {
|
# "firefox@teleparty.com" = {
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/netflix-party-is-now-teleparty/latest.xpi";
|
# install_url = "https://addons.mozilla.org/firefox/downloads/latest/netflix-party-is-now-teleparty/latest.xpi";
|
||||||
installation_mode = "normal_installed";
|
# installation_mode = "normal_installed";
|
||||||
};
|
# };
|
||||||
"@ublacklist" = {
|
"@ublacklist" = {
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublacklist/latest.xpi";
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublacklist/latest.xpi";
|
||||||
installation_mode = "normal_installed";
|
installation_mode = "normal_installed";
|
||||||
|
|||||||
29
nix/configuration/roles/flux/default.nix
Normal file
29
nix/configuration/roles/flux/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
flux.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install flux.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.flux.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
fluxcd
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -47,17 +47,17 @@
|
|||||||
</alias>
|
</alias>
|
||||||
|
|
||||||
|
|
||||||
<!-- Screw it. Force Liberation Mono to be source code pro. -->
|
<!-- Screw it. Force Liberation Mono to be cascadia mono. -->
|
||||||
<match target="pattern">
|
<!-- <match target="pattern"> -->
|
||||||
<test qual="any" name="family"><string>Liberation Mono</string></test>
|
<!-- <test qual="any" name="family"><string>Liberation Mono</string></test> -->
|
||||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
<!-- <edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit> -->
|
||||||
</match>
|
<!-- </match> -->
|
||||||
|
|
||||||
<!-- Dejavu Sans Mono keeps coming back when I query "monospace". Doesn't happen when I'm using Souce Code Pro but does happen with cascadia... force it to cascadia -->
|
<!-- Dejavu Sans Mono keeps coming back when I query "monospace". Doesn't happen when I'm using Souce Code Pro but does happen with cascadia... force it to cascadia -->
|
||||||
<match target="pattern">
|
<!-- <match target="pattern"> -->
|
||||||
<test qual="any" name="family"><string>monospace</string></test>
|
<!-- <test qual="any" name="family"><string>monospace</string></test> -->
|
||||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
<!-- <edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit> -->
|
||||||
</match>
|
<!-- </match> -->
|
||||||
|
|
||||||
<!-- Disable ligatures in monospace fonts. -->
|
<!-- Disable ligatures in monospace fonts. -->
|
||||||
<match target="font">
|
<match target="font">
|
||||||
|
|||||||
43
nix/configuration/roles/gcloud/default.nix
Normal file
43
nix/configuration/roles/gcloud/default.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
gcloud.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install gcloud.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.gcloud.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
(google-cloud-sdk.withExtraComponents [ google-cloud-sdk.components.gke-gcloud-auth-plugin ])
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = ".config/gcloud";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0700";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,6 +5,18 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
git_wrapped =
|
||||||
|
package: prog:
|
||||||
|
pkgs.writeShellScriptBin "${prog}" ''
|
||||||
|
export PATH="${
|
||||||
|
lib.makeBinPath [
|
||||||
|
pkgs.meld
|
||||||
|
]
|
||||||
|
}:$PATH"
|
||||||
|
exec ${package}/bin/${prog} "''${@}"
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
@@ -20,66 +32,48 @@
|
|||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
my_git
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf (config.me.git.config != null) {
|
(lib.mkIf (config.me.git.config != null) {
|
||||||
home-manager.users.talexander =
|
me.install.user.talexander.file = {
|
||||||
{ pkgs, ... }:
|
".gitconfig" = {
|
||||||
{
|
|
||||||
home.file.".gitconfig" = {
|
|
||||||
source = config.me.git.config;
|
source = config.me.git.config;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
# (lib.mkIf (config.me.graphical) {
|
(lib.mkIf (config.me.graphical) {
|
||||||
# nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
# (final: prev: {
|
(final: prev: {
|
||||||
# git = pkgs.buildEnv {
|
my_git = (
|
||||||
# name = prev.git.name;
|
pkgs.buildEnv {
|
||||||
# paths = [
|
name = prev.git.name;
|
||||||
# prev.git
|
version = prev.git.version;
|
||||||
# ];
|
paths =
|
||||||
# extraOutputsToInstall = [
|
(builtins.map (git_wrapped prev.git) [
|
||||||
# "man"
|
"git"
|
||||||
# "doc"
|
])
|
||||||
# "info"
|
++ [
|
||||||
# ];
|
prev.git
|
||||||
# buildInputs = [ final.makeWrapper ];
|
];
|
||||||
# postBuild = ''
|
extraOutputsToInstall = [
|
||||||
# wrapProgram $out/bin/git --prefix PATH : ${
|
"man"
|
||||||
# lib.makeBinPath [
|
"doc"
|
||||||
# final.meld
|
"info"
|
||||||
# ]
|
];
|
||||||
# }
|
nativeBuildInputs = [ final.makeWrapper ];
|
||||||
# '';
|
ignoreCollisions = true;
|
||||||
# };
|
}
|
||||||
# })
|
);
|
||||||
# ];
|
})
|
||||||
# })
|
];
|
||||||
# (lib.mkIf (!config.me.graphical) {
|
})
|
||||||
# nixpkgs.overlays = [
|
(lib.mkIf (!config.me.graphical) {
|
||||||
# (final: prev: {
|
nixpkgs.overlays = [
|
||||||
# git = pkgs.buildEnv {
|
(final: prev: {
|
||||||
# name = prev.git.name;
|
my_git = prev.git;
|
||||||
# paths = [
|
})
|
||||||
# prev.git
|
];
|
||||||
# ];
|
})
|
||||||
# extraOutputsToInstall = [
|
|
||||||
# "man"
|
|
||||||
# "doc"
|
|
||||||
# "info"
|
|
||||||
# ];
|
|
||||||
# buildInputs = [ final.makeWrapper ];
|
|
||||||
# postBuild = ''
|
|
||||||
# wrapProgram $out/bin/git --prefix PATH : ${
|
|
||||||
# lib.makeBinPath [
|
|
||||||
# ]
|
|
||||||
# }
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
# })
|
|
||||||
# ];
|
|
||||||
# })
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,33 +3,53 @@
|
|||||||
name = Tom Alexander
|
name = Tom Alexander
|
||||||
signingkey = D3A179C9A53C0EDE
|
signingkey = D3A179C9A53C0EDE
|
||||||
[push]
|
[push]
|
||||||
default = simple
|
default = simple # (default since 2.0)
|
||||||
[alias]
|
[alias]
|
||||||
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
||||||
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
bh = log --oneline --branches=* --remotes=* --graph --decorate
|
||||||
amend = commit --amend --no-edit
|
amend = commit --amend --no-edit
|
||||||
|
authorcount = shortlog --summary --numbered --all --no-merges
|
||||||
[core]
|
[core]
|
||||||
excludesfile = ~/.gitignore_global
|
excludesfile = ~/.gitignore_global
|
||||||
[commit]
|
[commit]
|
||||||
gpgsign = true
|
gpgsign = true
|
||||||
|
verbose = true
|
||||||
[pull]
|
[pull]
|
||||||
rebase = true
|
rebase = true
|
||||||
[log]
|
[log]
|
||||||
date = local
|
date = local
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
|
|
||||||
# Use meld for `git difftool` and `git mergetool`
|
|
||||||
[diff]
|
[diff]
|
||||||
tool = meld
|
tool = meld # Use meld for `git difftool` and `git mergetool`
|
||||||
|
algorithm = histogram
|
||||||
|
colorMoved = plain
|
||||||
|
mnemonicPrefix = true
|
||||||
|
renames = true
|
||||||
[difftool]
|
[difftool]
|
||||||
prompt = false
|
prompt = false
|
||||||
[difftool "meld"]
|
[difftool "meld"]
|
||||||
cmd = meld "$LOCAL" "$REMOTE"
|
cmd = meld "$LOCAL" "$REMOTE"
|
||||||
[merge]
|
[merge]
|
||||||
tool = meld
|
tool = meld
|
||||||
|
conflictStyle = zdiff3
|
||||||
[mergetool "meld"]
|
[mergetool "meld"]
|
||||||
# Make the middle pane start with partially-merged contents:
|
# Make the middle pane start with partially-merged contents:
|
||||||
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
||||||
# Make the middle pane start without any merge progress:
|
# Make the middle pane start without any merge progress:
|
||||||
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
|
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
|
||||||
|
[column]
|
||||||
|
ui = auto
|
||||||
|
[branch]
|
||||||
|
sort = -committerdate
|
||||||
|
[tag]
|
||||||
|
sort = version:refname
|
||||||
|
[fetch]
|
||||||
|
prune = true
|
||||||
|
pruneTags = true
|
||||||
|
all = true
|
||||||
|
[rebase]
|
||||||
|
autoSquash = true
|
||||||
|
autoStash = true
|
||||||
|
# updateRefs was annoying when you want to split a branch in two by rebasing away from commits from one branch and rebasing away some commits from another branch.
|
||||||
|
updateRefs = false
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
options.me = {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# options.me.graphics_card_type = lib.mkOption {
|
# options.me.graphics_card_type = lib.mkOption {
|
||||||
# type = lib.types.nullOr (
|
# type = lib.types.nullOr (
|
||||||
# lib.types.enum [
|
# lib.types.enum [
|
||||||
|
|||||||
29
nix/configuration/roles/gnuplot/default.nix
Normal file
29
nix/configuration/roles/gnuplot/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
gnuplot.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install gnuplot.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.gnuplot.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
gnuplot
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -57,11 +57,8 @@ in
|
|||||||
# disable-ccid = true;
|
# disable-ccid = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# .gnupg/scdaemon.conf
|
me.install.user.talexander.file = {
|
||||||
home-manager.users.talexander =
|
".gnupg/scdaemon.conf" = {
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
home.file.".gnupg/scdaemon.conf" = {
|
|
||||||
source = ./files/scdaemon.conf;
|
source = ./files/scdaemon.conf;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,6 +37,26 @@
|
|||||||
xorg.xeyes # to test which windows are using x11
|
xorg.xeyes # to test which windows are using x11
|
||||||
];
|
];
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
# hardware.graphics.enable32Bit = true;
|
||||||
|
|
||||||
|
# Vulkan Support (64-bit is enabled by default, 32-bit is disabled by default)
|
||||||
|
# hardware.opengl.driSupport = true; # This is already enabled by default
|
||||||
|
# hardware.opengl.driSupport32Bit = true; # For 32 bit applications
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.graphics_card_type == "amd") {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvtopPackages.amd
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.graphics_card_type == "intel") {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvtopPackages.intel
|
||||||
|
];
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.graphics_card_type == "nvidia") {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvtopPackages.nvidia
|
||||||
|
];
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
49
nix/configuration/roles/hydra/default.nix
Normal file
49
nix/configuration/roles/hydra/default.nix
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
hydra.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install hydra.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.hydra.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
services.hydra = {
|
||||||
|
enable = true;
|
||||||
|
hydraURL = "http://localhost:3000"; # Externally visible URL
|
||||||
|
notificationSender = "hydra@localhost"; # "From" address for hydra emails.
|
||||||
|
# a standalone Hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
|
||||||
|
buildMachinesFiles = [ ];
|
||||||
|
useSubstitutes = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# nix.buildMachines = [
|
||||||
|
# {
|
||||||
|
# hostName = "localhost";
|
||||||
|
# protocol = null;
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# supportedFeatures = [
|
||||||
|
# "kvm"
|
||||||
|
# "nixos-test"
|
||||||
|
# "big-parallel"
|
||||||
|
# "benchmark"
|
||||||
|
# ];
|
||||||
|
# maxJobs = 8;
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
45
nix/configuration/roles/iso_mount/default.nix
Normal file
45
nix/configuration/roles/iso_mount/default.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
iso_mount =
|
||||||
|
(pkgs.writeScriptBin "iso_mount" (builtins.readFile ./files/iso_mount.bash)).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
|
||||||
|
});
|
||||||
|
iso_unmount =
|
||||||
|
(pkgs.writeScriptBin "iso_unmount" (builtins.readFile ./files/iso_unmount.bash)).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
iso_mount.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install iso_mount.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.iso_mount.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
iso_mount
|
||||||
|
iso_unmount
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
8
nix/configuration/roles/iso_mount/files/iso_mount.bash
Normal file
8
nix/configuration/roles/iso_mount/files/iso_mount.bash
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Mount a full-disk image as a loopback device so you can mount individual partitions from inside of it.
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec udisksctl loop-setup -r -f "${@}"
|
||||||
8
nix/configuration/roles/iso_mount/files/iso_unmount.bash
Normal file
8
nix/configuration/roles/iso_mount/files/iso_unmount.bash
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Mount a full-disk image as a loopback device so you can mount individual partitions from inside of it.
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec udisksctl loop-delete "${@}"
|
||||||
@@ -41,15 +41,11 @@ in
|
|||||||
exec_kanshi
|
exec_kanshi
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.talexander =
|
me.install.user.talexander.file = {
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
home.file = {
|
|
||||||
".config/kanshi/config" = {
|
".config/kanshi/config" = {
|
||||||
source = ./files/config_kanshi;
|
source = ./files/config_kanshi;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -78,9 +78,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.kodi =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
# home.file.".kodi/userdata/mediasources.xml".source = ./files/mediasources.xml;
|
# home.file.".kodi/userdata/mediasources.xml".source = ./files/mediasources.xml;
|
||||||
|
|
||||||
# home.file.".kodi/userdata/addon_data/peripheral.joystick/resources/buttonmaps/xml/linux/DualSense_Wireless_Controller_13b_8a.xml".source =
|
# home.file.".kodi/userdata/addon_data/peripheral.joystick/resources/buttonmaps/xml/linux/DualSense_Wireless_Controller_13b_8a.xml".source =
|
||||||
@@ -88,11 +85,6 @@
|
|||||||
|
|
||||||
# TODO: Maybe .kodi/userdata/sources.xml
|
# TODO: Maybe .kodi/userdata/sources.xml
|
||||||
# TODO: ./userdata/guisettings.xml:303: <setting id="filecache.memorysize">128</setting>
|
# TODO: ./userdata/guisettings.xml:303: <setting id="filecache.memorysize">128</setting>
|
||||||
|
|
||||||
# The state version is required and should stay at the version you
|
|
||||||
# originally installed.
|
|
||||||
home.stateVersion = "24.11";
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -28,6 +28,21 @@ let
|
|||||||
alias_klog = pkgs.writeShellScriptBin "klog" ''
|
alias_klog = pkgs.writeShellScriptBin "klog" ''
|
||||||
exec ${pkgs.kubectl}/bin/kubectl logs --all-containers "$@"
|
exec ${pkgs.kubectl}/bin/kubectl logs --all-containers "$@"
|
||||||
'';
|
'';
|
||||||
|
decrypt_k8s_secret =
|
||||||
|
(pkgs.writeScriptBin "decrypt_k8s_secret" (builtins.readFile ./files/decrypt_k8s_secret.bash))
|
||||||
|
.overrideAttrs
|
||||||
|
(old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/decrypt_k8s_secret --prefix PATH : ${
|
||||||
|
lib.makeBinPath [
|
||||||
|
pkgs.kubectl
|
||||||
|
pkgs.jq
|
||||||
|
]
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
@@ -55,6 +70,8 @@ in
|
|||||||
alias_kdel
|
alias_kdel
|
||||||
alias_kd
|
alias_kd
|
||||||
alias_klog
|
alias_klog
|
||||||
|
decrypt_k8s_secret
|
||||||
|
ingress2gateway # Convert ingress yaml to gateway yaml
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
kubectl get secret -o json "${@}" | jq '.data[] |= @base64d | .data'
|
||||||
@@ -5,22 +5,6 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
tex = (
|
|
||||||
pkgs.texlive.combine {
|
|
||||||
inherit (pkgs.texlive)
|
|
||||||
scheme-basic
|
|
||||||
dvisvgm
|
|
||||||
dvipng # for preview and export as html in org-mode
|
|
||||||
wrapfig
|
|
||||||
amsmath
|
|
||||||
ulem
|
|
||||||
hyperref
|
|
||||||
capt-of
|
|
||||||
;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
@@ -40,6 +24,35 @@ in
|
|||||||
tex
|
tex
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
tex = (
|
||||||
|
pkgs.texlive.combine {
|
||||||
|
inherit (pkgs.texlive)
|
||||||
|
scheme-basic
|
||||||
|
dvisvgm
|
||||||
|
dvipng # for preview and export as html in org-mode
|
||||||
|
wrapfig
|
||||||
|
amsmath
|
||||||
|
ulem
|
||||||
|
hyperref
|
||||||
|
capt-of
|
||||||
|
svg # emacs org-mode pdf export
|
||||||
|
catchfile # emacs org-mode pdf export
|
||||||
|
xcolor # emacs org-mode pdf export
|
||||||
|
transparent # emacs org-mode pdf export
|
||||||
|
pgf # emacs org-mode pdf export
|
||||||
|
minted # emacs org-mode pdf export code block highlighting
|
||||||
|
upquote # emacs org-mode pdf export
|
||||||
|
lineno # emacs org-mode pdf export
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
config = lib.mkIf config.me.lvfs.enable (
|
config = lib.mkIf config.me.lvfs.enable (
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
# TODO: Is this installing firmware or just downloading it?
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
hideMounts = true;
|
hideMounts = true;
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ let
|
|||||||
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
|
||||||
});
|
});
|
||||||
|
kernel_version_check = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.12";
|
||||||
|
nixos_version_check = lib.versionAtLeast (lib.versions.majorMinor lib.version) "25.05";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
@@ -26,7 +28,7 @@ in
|
|||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = "Whether we want to install media.";
|
description = "Whether we want to install media utilities.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,6 +37,10 @@ in
|
|||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
libva-utils # for vainfo
|
||||||
|
vdpauinfo
|
||||||
|
mkvtoolnix-cli # for mkvmerge
|
||||||
|
yt-dlp
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
(lib.mkIf config.me.graphical {
|
(lib.mkIf config.me.graphical {
|
||||||
@@ -46,10 +52,8 @@ in
|
|||||||
imv
|
imv
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.talexander =
|
me.install.user.talexander.file = {
|
||||||
{ pkgs, ... }:
|
".config/mpv/mpv.conf" = {
|
||||||
{
|
|
||||||
home.file.".config/mpv/mpv.conf" = {
|
|
||||||
source = ./files/mpv.conf;
|
source = ./files/mpv.conf;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -59,6 +63,21 @@ in
|
|||||||
cast_file_vaapi
|
cast_file_vaapi
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
|
(lib.mkIf (config.me.graphics_card_type == "amd") {
|
||||||
|
environment.sessionVariables = {
|
||||||
|
VDPAU_DRIVER = "radeonsi";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(lib.mkIf (config.me.graphics_card_type == "intel") {
|
||||||
|
hardware.graphics.extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
libvdpau-va-gl # Support vdpau applications using va-api
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
VDPAU_DRIVER = "va_gl";
|
||||||
|
};
|
||||||
|
})
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
|
|
||||||
: ${VIDEO_BITRATE:="1M"} # Only for encoding modes targeting bitrate
|
: ${VIDEO_BITRATE:="1M"} # Only for encoding modes targeting bitrate
|
||||||
: ${AUDIO_BITRATE:="192k"}
|
: ${AUDIO_BITRATE:="192k"}
|
||||||
|
: ${SPEED:="1"}
|
||||||
|
|
||||||
############## Setup #########################
|
############## Setup #########################
|
||||||
|
|
||||||
@@ -62,6 +63,8 @@ function copy {
|
|||||||
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# benchmark vulkan decode:
|
||||||
|
# ffmpeg -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i INPUT -f null - -benchmark
|
||||||
function convert {
|
function convert {
|
||||||
local args=()
|
local args=()
|
||||||
local acceleration_type="$1" # "software" or "hardware"
|
local acceleration_type="$1" # "software" or "hardware"
|
||||||
@@ -99,11 +102,23 @@ function convert {
|
|||||||
if [ "$acceleration_type" == "software" ]; then
|
if [ "$acceleration_type" == "software" ]; then
|
||||||
true
|
true
|
||||||
elif [ "$acceleration_type" == "hardware" ]; then
|
elif [ "$acceleration_type" == "hardware" ]; then
|
||||||
|
if [ "$codec" == "h264" ]; then
|
||||||
|
args+=(-init_hw_device vulkan)
|
||||||
|
elif [ "$codec" == "av1" ]; then
|
||||||
args+=(-vaapi_device /dev/dri/renderD128)
|
args+=(-vaapi_device /dev/dri/renderD128)
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
args+=(-i "$file_to_cast")
|
args+=(-i "$file_to_cast")
|
||||||
|
|
||||||
|
if [ "$SPEED" != "1" ]; then
|
||||||
|
local audio_speed video_speed
|
||||||
|
video_speed=$(bc -l <<< "1/${SPEED}")
|
||||||
|
audio_speed=$(bc -l <<< "${SPEED}/1")
|
||||||
|
args+=(-filter:v "setpts=${video_speed}*PTS")
|
||||||
|
args+=(-filter:a "atempo=${audio_speed}")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$codec" == "h264" ]; then
|
if [ "$codec" == "h264" ]; then
|
||||||
if [ "$acceleration_type" == "software" ]; then
|
if [ "$acceleration_type" == "software" ]; then
|
||||||
args+=(-c:v h264)
|
args+=(-c:v h264)
|
||||||
@@ -111,7 +126,7 @@ function convert {
|
|||||||
args+=(-b:v "$VIDEO_BITRATE")
|
args+=(-b:v "$VIDEO_BITRATE")
|
||||||
elif [ "$acceleration_type" == "hardware" ]; then
|
elif [ "$acceleration_type" == "hardware" ]; then
|
||||||
args+=(-vf 'format=nv12|vaapi,hwupload')
|
args+=(-vf 'format=nv12|vaapi,hwupload')
|
||||||
args+=(-c:v h264_vaapi)
|
args+=(-c:v h264_vulkan)
|
||||||
args+=(-profile:v high)
|
args+=(-profile:v high)
|
||||||
args+=(-b:v "$VIDEO_BITRATE")
|
args+=(-b:v "$VIDEO_BITRATE")
|
||||||
fi
|
fi
|
||||||
@@ -119,12 +134,14 @@ function convert {
|
|||||||
if [ "$acceleration_type" == "software" ]; then
|
if [ "$acceleration_type" == "software" ]; then
|
||||||
args+=(-c:v libsvtav1)
|
args+=(-c:v libsvtav1)
|
||||||
args+=(-preset 4) # [0-13] default 10, lower = higher quality / slower encode
|
args+=(-preset 4) # [0-13] default 10, lower = higher quality / slower encode
|
||||||
args+=(-crf 20) # [0-63] default 35, lower = higher quality / larger file
|
# args+=(-crf 20) # [0-63] default 35, lower = higher quality / larger file
|
||||||
# Parameters: https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Parameters.md
|
# Parameters: https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Parameters.md
|
||||||
# fast-decode [0-2] default 0 (off), higher = faster decode
|
# fast-decode [0-2] default 0 (off), higher = faster decode
|
||||||
# tune [0-2] default 1, Specifies whether to use PSNR or VQ as the tuning metric [0 = VQ, 1 = PSNR, 2 = SSIM]
|
# tune [0-2] default 1, Specifies whether to use PSNR or VQ as the tuning metric [0 = VQ, 1 = PSNR, 2 = SSIM]
|
||||||
# film-grain-denoise, setting to 0 uses the original frames instead of denoising the film grain
|
# film-grain-denoise, setting to 0 uses the original frames instead of denoising the film grain
|
||||||
args+=(-svtav1-params "fast-decode=1:film-grain-denoise=0")
|
# rc 1 = vbr 2 = cbr
|
||||||
|
# tbr = average bitrate
|
||||||
|
args+=(-svtav1-params "fast-decode=1:film-grain-denoise=0:tbr=${VIDEO_BITRATE}:rc=1:passes=2")
|
||||||
elif [ "$acceleration_type" == "hardware" ]; then
|
elif [ "$acceleration_type" == "hardware" ]; then
|
||||||
# -c:v av1_amf -quality quality
|
# -c:v av1_amf -quality quality
|
||||||
args+=(-vf 'format=nv12|vaapi,hwupload')
|
args+=(-vf 'format=nv12|vaapi,hwupload')
|
||||||
@@ -206,32 +223,4 @@ function encode_webcam {
|
|||||||
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
||||||
}
|
}
|
||||||
|
|
||||||
function speed_up_preprocess_vp8 {
|
|
||||||
local file_to_cast file_to_save
|
|
||||||
file_to_cast="$1"
|
|
||||||
file_to_save="$2"
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
|
||||||
# -strict -2 :: Enable support for experimental codecs like opus.
|
|
||||||
# -b:v 2M :: Target 2 megabit/s
|
|
||||||
# -crf 10 :: Target a quality level and adjust bitrate accordingly. This should be preferred, but ideally both should be used.
|
|
||||||
# Could also use -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]"
|
|
||||||
</dev/null exec ffmpeg \
|
|
||||||
-i "$file_to_cast" \
|
|
||||||
-filter:v "setpts=0.66666666*PTS" \
|
|
||||||
-filter:a "atempo=1.5" \
|
|
||||||
-c:v vp8 \
|
|
||||||
-b:v 2M \
|
|
||||||
-crf 10 \
|
|
||||||
-bf 0 \
|
|
||||||
-c:a opus \
|
|
||||||
-b:a 320k \
|
|
||||||
-ar 48000 \
|
|
||||||
-strict -2 \
|
|
||||||
"$file_to_save"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main "${@}"
|
main "${@}"
|
||||||
|
|||||||
@@ -8,10 +8,14 @@
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{ }
|
{
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
environment.systemPackages = with pkgs; [
|
||||||
# boot.loader.systemd-boot.memtest86.enable = true;
|
memtest86plus
|
||||||
boot.loader.grub.memtest86.enable = true;
|
];
|
||||||
})
|
}
|
||||||
|
# (lib.mkIf (config.me.buildingIso) {
|
||||||
|
# boot.loader.systemd-boot.memtest86.enable = true;
|
||||||
|
# boot.loader.grub.memtest86.enable = true;
|
||||||
|
# })
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-dda3dcd3f,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -18,8 +19,8 @@
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
networking.dhcpcd.enable = false;
|
networking.dhcpcd.enable = lib.mkDefault false;
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = lib.mkDefault false;
|
||||||
networking.nameservers = [
|
networking.nameservers = [
|
||||||
"194.242.2.2#doh.mullvad.net"
|
"194.242.2.2#doh.mullvad.net"
|
||||||
"2a07:e340::2#doh.mullvad.net"
|
"2a07:e340::2#doh.mullvad.net"
|
||||||
@@ -32,15 +33,17 @@
|
|||||||
dnsovertls = "true";
|
dnsovertls = "true";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Without this, systemd-resolved will send DNS requests for <X>.home.arpa to the per-link DNS server (172.16.0.1) which does not support DNS-over-TLS. This leads to the connection anging and timing out. This causes firefox startup to take an extra 10+ seconds.
|
# Without this, systemd-resolved will send DNS requests for <X>.home.arpa to the per-link DNS server (172.16.0.1) which does not support DNS-over-TLS. This leads to the connection hanging and timing out. This causes firefox startup to take an extra 10+ seconds.
|
||||||
#
|
#
|
||||||
# Test with: drill @127.0.0.53 odo.home.arpa
|
# Test with: drill @127.0.0.53 odo.home.arpa
|
||||||
|
# TODO: The 127.0.0.1 address should probably be moved to a host-specific file.
|
||||||
networking.extraHosts = ''
|
networking.extraHosts = ''
|
||||||
127.0.0.1 odo.home.arpa
|
127.0.0.1 ${config.networking.hostName}.home.arpa
|
||||||
10.216.1.1 homeserver
|
10.216.1.1 homeserver
|
||||||
10.216.1.6 media
|
10.216.1.6 media
|
||||||
#10.216.1.12 odo
|
10.216.1.12 odo
|
||||||
10.216.1.14 neelix
|
10.216.1.14 neelix
|
||||||
|
10.216.1.15 quark
|
||||||
10.217.1.1 drmario
|
10.217.1.1 drmario
|
||||||
10.217.2.1 mrmanager
|
10.217.2.1 mrmanager
|
||||||
'';
|
'';
|
||||||
@@ -61,10 +64,42 @@
|
|||||||
iwd
|
iwd
|
||||||
ldns # for drill
|
ldns # for drill
|
||||||
arp-scan # To find devices on the network
|
arp-scan # To find devices on the network
|
||||||
|
wavemon
|
||||||
|
dhcpcd # For Android USB tethering.
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
# Set wifi to US
|
# Set wifi to US
|
||||||
options cfg80211 ieee80211_regdom=US
|
options cfg80211 ieee80211_regdom=US
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
# Enable TCP packetization-layer PMTUD when an ICMP black hole is detected.
|
||||||
|
"net.ipv4.tcp_mtu_probing" = 1;
|
||||||
|
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
|
||||||
|
# We set this in the kernel config, but include this here for unoptimized builds.
|
||||||
|
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||||
|
# Don't do a slow start after a connection has been idle for a single RTO.
|
||||||
|
"net.ipv4.tcp_slow_start_after_idle" = 0;
|
||||||
|
# 3x time to accumulate filesystem changes before flushing to disk.
|
||||||
|
"vm.dirty_writeback_centisecs" = 1500;
|
||||||
|
# Adjust ttl
|
||||||
|
"net.ipv4.ip_default_ttl" = 65;
|
||||||
|
"net.ipv6.conf.all.hop_limit" = 65;
|
||||||
|
"net.ipv6.conf.default.hop_limit" = 65;
|
||||||
|
# Enable IPv6 Privacy Extensions
|
||||||
|
"net.ipv6.conf.all.use_tempaddr" = 2;
|
||||||
|
# Enable IPv6 Privacy Extensions
|
||||||
|
# This is enabled by default in nixos.
|
||||||
|
# "net.ipv6.conf.default.use_tempaddr" = 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
# nixpkgs.overlays = [
|
||||||
|
# (final: prev: {
|
||||||
|
# inherit (pkgs-dda3dcd3f)
|
||||||
|
# linux-firmware
|
||||||
|
# ;
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
57
nix/configuration/roles/nix_worker/default.nix
Normal file
57
nix/configuration/roles/nix_worker/default.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# MANUAL: Remember to set up root's ssh config with any necessary values. For example:
|
||||||
|
|
||||||
|
# Host foo
|
||||||
|
# HostName ns1.fizz.buzz
|
||||||
|
# Port 65122
|
||||||
|
# User nixworker
|
||||||
|
# IdentitiesOnly yes
|
||||||
|
# IdentityFile /persist/manual/ssh/root/keys/id_ed25519
|
||||||
|
|
||||||
|
# Host *
|
||||||
|
# Compression yes
|
||||||
|
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
nix_worker.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether this machine should be set up to function as a nix.buildMachines. This does not configure nix.buildMachines, but only does the necessary setup to get the machine ready/capable of being a nix.buildMachines.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.nix_worker.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
nix.settings.trusted-users = [ "nixworker" ];
|
||||||
|
|
||||||
|
users.users.nixworker = {
|
||||||
|
isNormalUser = true;
|
||||||
|
createHome = true; # https://github.com/NixOS/nixpkgs/issues/6481
|
||||||
|
group = "nixworker";
|
||||||
|
# extraGroups = [ "wheel" ];
|
||||||
|
# Generate with `mkpasswd -m scrypt`
|
||||||
|
hashedPassword = "$7$CU..../....VXvNQ8za3wSGpdzGXNT50/$HcFtn/yvwPMCw4888BelpiAPLAxe/zU87fD.d/N6U48";
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
# Normal keys:
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu+k5lrirokdW5zVdRVBOqEOAvAPlIkG/MdJNc9g5ky"
|
||||||
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEI6mu6I5Jp+Ib0vJxapGHbEShZjyvzV8jz5DnzDrI39AAAABHNzaDo="
|
||||||
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAFNcSXwvy+brYTOGo56G93Ptuq2MmZsjvRWAfMqbmMLAAAABHNzaDo="
|
||||||
|
# Key for nix to connect:
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB/IlYTQ0M5pFN5tdoswh37CDl/gbULI3h+SsKXCansh talexander@odo"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
users.groups.nixworker = { };
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
175
nix/configuration/roles/optimized_build/default.nix
Normal file
175
nix/configuration/roles/optimized_build/default.nix
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
pkgs-unoptimized,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
optimizations.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to enable CPU optimizations (will trigger a rebuild from source).";
|
||||||
|
};
|
||||||
|
|
||||||
|
optimizations.arch = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = null;
|
||||||
|
example = "znver4";
|
||||||
|
description = "The CPU arch for which programs should be optimized.";
|
||||||
|
};
|
||||||
|
|
||||||
|
optimizations.system_features = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [
|
||||||
|
"gccarch-znver4"
|
||||||
|
"gccarch-znver5"
|
||||||
|
"gccarch-skylake"
|
||||||
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
|
"gccarch-x86-64-v3"
|
||||||
|
"gccarch-x86-64-v4"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
"nixos-test"
|
||||||
|
];
|
||||||
|
description = "The list of CPU features that should be enabled on this machine.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf (!config.me.optimizations.enable) (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_16;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
))
|
||||||
|
(lib.mkIf config.me.optimizations.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = {
|
||||||
|
gcc.arch = config.me.optimizations.arch;
|
||||||
|
gcc.tune = config.me.optimizations.arch;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Uncomment on of these to enable cross compiling:
|
||||||
|
# nixpkgs.buildPlatform = builtins.currentSystem;
|
||||||
|
# nixpkgs.buildPlatform = {
|
||||||
|
# gcc.arch = "znver4";
|
||||||
|
# gcc.tune = "znver4";
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# };
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(
|
||||||
|
final: prev:
|
||||||
|
let
|
||||||
|
addConfig =
|
||||||
|
additionalConfig: pkg:
|
||||||
|
pkg.override (oldconfig: {
|
||||||
|
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
linux_me = addConfig {
|
||||||
|
# Full preemption
|
||||||
|
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
||||||
|
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
||||||
|
|
||||||
|
# Google's BBRv3 TCP congestion Control
|
||||||
|
TCP_CONG_BBR = lib.kernel.yes;
|
||||||
|
DEFAULT_BBR = lib.kernel.yes;
|
||||||
|
|
||||||
|
# Preemptive Full Tickless Kernel at 300Hz
|
||||||
|
HZ = lib.kernel.freeform "300";
|
||||||
|
HZ_300 = lib.kernel.yes;
|
||||||
|
HZ_1000 = lib.kernel.no;
|
||||||
|
} prev.linux_6_16;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(final: prev: {
|
||||||
|
haskellPackages = prev.haskellPackages.extend (
|
||||||
|
final': prev': {
|
||||||
|
inherit (pkgs-unoptimized.haskellPackages)
|
||||||
|
crypto-token
|
||||||
|
crypton
|
||||||
|
crypton-connection
|
||||||
|
crypton-x509
|
||||||
|
crypton-x509-store
|
||||||
|
crypton-x509-system
|
||||||
|
crypton-x509-validation
|
||||||
|
hspec-wai
|
||||||
|
http-client-tls
|
||||||
|
http2
|
||||||
|
pandoc
|
||||||
|
pandoc-cli
|
||||||
|
pandoc-lua-engine
|
||||||
|
pandoc-server
|
||||||
|
servant-server
|
||||||
|
tls
|
||||||
|
tls-session-manager
|
||||||
|
wai-app-static
|
||||||
|
wai-extra
|
||||||
|
warp
|
||||||
|
warp-tls
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})
|
||||||
|
# (final: prev: {
|
||||||
|
# python = prev.python.override {
|
||||||
|
# packageOverrides = python-final: python-prev: {
|
||||||
|
# inherit (pkgs-unoptimized.pythonPackages) coverage;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# })
|
||||||
|
# (final: prev: {
|
||||||
|
# pythonPackagesOverlays = prev.pythonPackagesOverlays.extend (
|
||||||
|
# final': prev': {
|
||||||
|
# inherit (pkgs-unoptimized.pythonPackagesOverlays)
|
||||||
|
# coverage
|
||||||
|
# ;
|
||||||
|
# }
|
||||||
|
# );
|
||||||
|
# })
|
||||||
|
# (final: prev: {
|
||||||
|
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||||
|
# (python-final: python-prev: {
|
||||||
|
# inherit (pkgs-unoptimized.pythonPackages) coverage;
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
# })
|
||||||
|
(final: prev: {
|
||||||
|
inherit (pkgs-unoptimized)
|
||||||
|
gsl
|
||||||
|
redis
|
||||||
|
valkey
|
||||||
|
nix-serve-ng
|
||||||
|
rapidjson
|
||||||
|
assimp
|
||||||
|
;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
))
|
||||||
|
(lib.mkIf (config.me.optimizations.system_features != [ ]) (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
nix.settings.system-features = lib.mkForce config.me.optimizations.system_features;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
93
nix/configuration/roles/pcsx2/default.nix
Normal file
93
nix/configuration/roles/pcsx2/default.nix
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
pcsx2.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install pcsx2.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.pcsx2.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
(lib.mkIf config.me.graphical {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pcsx2
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# Shaders, games list, and achievement data.
|
||||||
|
directory = ".config/PCSX2/cache";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Save states.
|
||||||
|
directory = ".config/PCSX2/sstates";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Screenshots.
|
||||||
|
directory = ".config/PCSX2/snaps";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Game covers.
|
||||||
|
directory = ".config/PCSX2/covers";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Video recordings.
|
||||||
|
directory = ".config/PCSX2/videos";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# Game saves
|
||||||
|
directory = ".config/PCSX2/memcards";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
me.install.user.talexander.file = {
|
||||||
|
".config/PCSX2/inis/PCSX2.ini" = {
|
||||||
|
source = ./files/PCSX2.ini;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
104
nix/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
104
nix/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
[UI]
|
||||||
|
SettingsVersion = 1
|
||||||
|
InhibitScreensaver = true
|
||||||
|
ConfirmShutdown = false
|
||||||
|
StartPaused = false
|
||||||
|
PauseOnFocusLoss = true
|
||||||
|
StartFullscreen = true
|
||||||
|
|
||||||
|
|
||||||
|
[Folders]
|
||||||
|
Bios = ../../persist/games/ps2/bios
|
||||||
|
Snapshots = snaps
|
||||||
|
Savestates = sstates
|
||||||
|
MemoryCards = memcards
|
||||||
|
Logs = logs
|
||||||
|
Cheats = cheats
|
||||||
|
Patches = patches
|
||||||
|
UserResources = resources
|
||||||
|
Cache = cache
|
||||||
|
Textures = textures
|
||||||
|
InputProfiles = inputprofiles
|
||||||
|
Videos = videos
|
||||||
|
|
||||||
|
|
||||||
|
[EmuCore/GS]
|
||||||
|
VsyncEnable = true
|
||||||
|
# Internal resolution aspect corrected
|
||||||
|
ScreenshotSize = 1
|
||||||
|
# webp
|
||||||
|
ScreenshotFormat = 2
|
||||||
|
OsdShowFPS = true
|
||||||
|
# Capture video at internal resolution
|
||||||
|
VideoCaptureAutoResolution = true
|
||||||
|
# 2x native resolution
|
||||||
|
upscale_multiplier = 2
|
||||||
|
CaptureContainer = mkv
|
||||||
|
VideoCaptureCodec = av1_vaapi
|
||||||
|
AudioCaptureCodec = flac
|
||||||
|
|
||||||
|
|
||||||
|
[Filenames]
|
||||||
|
BIOS = ps2-0230a-20080220.bin
|
||||||
|
|
||||||
|
[MemoryCards]
|
||||||
|
Slot1_Enable = true
|
||||||
|
Slot1_Filename = Mcd001.ps2
|
||||||
|
Slot2_Enable = true
|
||||||
|
Slot2_Filename = Mcd002.ps2
|
||||||
|
|
||||||
|
|
||||||
|
[InputSources]
|
||||||
|
Keyboard = false
|
||||||
|
Mouse = false
|
||||||
|
SDL = true
|
||||||
|
# Enhanced ps4 and ps5 controller support
|
||||||
|
SDLControllerEnhancedMode = true
|
||||||
|
SDLPS5PlayerLED = true
|
||||||
|
|
||||||
|
|
||||||
|
[Pad1]
|
||||||
|
Type = DualShock2
|
||||||
|
InvertL = 0
|
||||||
|
InvertR = 0
|
||||||
|
Deadzone = 0
|
||||||
|
AxisScale = 1.33
|
||||||
|
LargeMotorScale = 1
|
||||||
|
SmallMotorScale = 1
|
||||||
|
ButtonDeadzone = 0
|
||||||
|
PressureModifier = 0.5
|
||||||
|
Up = SDL-0/DPadUp
|
||||||
|
Right = SDL-0/DPadRight
|
||||||
|
Down = SDL-0/DPadDown
|
||||||
|
Left = SDL-0/DPadLeft
|
||||||
|
Triangle = SDL-0/Y
|
||||||
|
Circle = SDL-0/B
|
||||||
|
Cross = SDL-0/A
|
||||||
|
Square = SDL-0/X
|
||||||
|
Select = SDL-0/Back
|
||||||
|
Start = SDL-0/Start
|
||||||
|
L1 = SDL-0/LeftShoulder
|
||||||
|
L2 = SDL-0/+LeftTrigger
|
||||||
|
R1 = SDL-0/RightShoulder
|
||||||
|
R2 = SDL-0/+RightTrigger
|
||||||
|
L3 = SDL-0/LeftStick
|
||||||
|
R3 = SDL-0/RightStick
|
||||||
|
LUp = SDL-0/-LeftY
|
||||||
|
LRight = SDL-0/+LeftX
|
||||||
|
LDown = SDL-0/+LeftY
|
||||||
|
LLeft = SDL-0/-LeftX
|
||||||
|
RUp = SDL-0/-RightY
|
||||||
|
RRight = SDL-0/+RightX
|
||||||
|
RDown = SDL-0/+RightY
|
||||||
|
RLeft = SDL-0/-RightX
|
||||||
|
Analog = SDL-0/Guide
|
||||||
|
LargeMotor = SDL-0/LargeMotor
|
||||||
|
SmallMotor = SDL-0/SmallMotor
|
||||||
|
|
||||||
|
|
||||||
|
[AutoUpdater]
|
||||||
|
CheckAtStartup = false
|
||||||
|
|
||||||
|
|
||||||
|
[GameList]
|
||||||
|
RecursivePaths = /home/talexander/persist/games/ps2/roms
|
||||||
@@ -32,6 +32,21 @@
|
|||||||
isort
|
isort
|
||||||
black
|
black
|
||||||
];
|
];
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# Poetry virtual environments.
|
||||||
|
directory = ".cache/pypoetry";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user