Compare commits
17 Commits
mt7927
...
bd99da5d38
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd99da5d38 | ||
|
|
f99fa54d60 | ||
|
|
d52b5db39b | ||
|
|
003c3cc41a | ||
|
|
d83652bb9c | ||
|
|
6fd09a712e | ||
|
|
d9c4f824d2 | ||
|
|
856e4daee6 | ||
|
|
9a9268f8cc | ||
|
|
8d3ebf7ba2 | ||
|
|
d35cfaacbd | ||
|
|
8b1212e182 | ||
|
|
7f0250cb9d | ||
|
|
bc2636a54c | ||
|
|
c8147b5e9e | ||
|
|
4115e95bb6 | ||
|
|
4c1465c8d0 |
@@ -1,9 +1,16 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
alias_nix_pin_revision = pkgs.writeShellScriptBin "nix-pin-revision" ''
|
||||
# Usage: nix-pin-revision nixpkgs 'github:NixOS/nixpkgs/00c21e4c93d963c50d4c0c89bfa84ed6e0694df2'
|
||||
exec nix flake lock --override-input "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./roles/2ship2harkinian
|
||||
@@ -140,6 +147,10 @@
|
||||
};
|
||||
nix.settings.auto-optimise-store = !config.me.buildingPortable;
|
||||
|
||||
environment.systemPackages = [
|
||||
alias_nix_pin_revision
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
@@ -225,9 +236,16 @@
|
||||
[
|
||||
(disableTests "coreutils")
|
||||
(disableTests "coreutils-full")
|
||||
(disableTests "deno") # Tests use too much disk space
|
||||
(disableTests "libuv")
|
||||
(final: prev: {
|
||||
inherit (final.unoptimized) libtpms libjxl;
|
||||
inherit (final.unoptimized)
|
||||
libtpms
|
||||
libjxl
|
||||
ddrescueview
|
||||
deno
|
||||
mesa
|
||||
;
|
||||
})
|
||||
(disableOptimizationsPython3 "scipy")
|
||||
# Works but probably sets python2's scipy to be python3:
|
||||
|
||||
12
nix/configuration/flake.lock
generated
12
nix/configuration/flake.lock
generated
@@ -22,11 +22,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769524058,
|
||||
"narHash": "sha256-zygdD6X1PcVNR2PsyK4ptzrVEiAdbMqLos7utrMDEWE=",
|
||||
"lastModified": 1779226674,
|
||||
"narHash": "sha256-wuOkjI6pRiN4sEn/EPBRnNW5cmcpvd7xtIM8y5LooAs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "71a3fc97d80881e91710fe721f1158d3b96ae14d",
|
||||
"rev": "65fb947964bd44fc0008faf77d1fcb7a9f40bb32",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -164,11 +164,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1770197578,
|
||||
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
|
||||
"lastModified": 1778869304,
|
||||
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
|
||||
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
mt7927.url = "github:cmspam/mt7927-nixos";
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -38,7 +37,6 @@
|
||||
disko,
|
||||
impermanence,
|
||||
lanzaboote,
|
||||
mt7927,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -80,7 +78,6 @@
|
||||
impermanence.nixosModules.impermanence
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
disko.nixosModules.disko
|
||||
mt7927.nixosModules.default
|
||||
./configuration.nix
|
||||
(./. + "/hosts/${hostname}")
|
||||
(./. + "/formats/${format}.nix")
|
||||
|
||||
@@ -5,7 +5,6 @@ IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
: "${NOM:="true"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.enable = true;
|
||||
me.shipwright.enable = false;
|
||||
me.ship2harkinian.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
./hardware-configuration.nix
|
||||
./power_management.nix
|
||||
./waybar.nix
|
||||
./wifi.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
@@ -160,7 +159,7 @@
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.enable = true;
|
||||
me.shipwright.enable = false;
|
||||
me.ship2harkinian.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
hardware.mediatek-mt7927 = {
|
||||
enable = true;
|
||||
enableWifi = true;
|
||||
enableBluetooth = true;
|
||||
# Highly recommended to fix upload speed issues
|
||||
disableAspm = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -14,6 +14,12 @@ let
|
||||
cleanup_temporary_files = (
|
||||
patchScriptBin "cleanup_temporary_files" (builtins.readFile ./files/cleanup_temporary_files.bash)
|
||||
);
|
||||
decode_jwt = (patchScriptBin "decode_jwt" (builtins.readFile ./files/decode_jwt.bash));
|
||||
git_find_merged_branches = (
|
||||
patchScriptBin "git_find_merged_branches" (builtins.readFile ./files/git_find_merged_branches.bash)
|
||||
);
|
||||
git_fix_author = (patchScriptBin "git_fix_author" (builtins.readFile ./files/git_fix_author.bash));
|
||||
rsync_clone = (patchScriptBin "rsync_clone" (builtins.readFile ./files/rsync_clone.bash));
|
||||
alias_rga = pkgs.writeShellScriptBin "rga" ''
|
||||
exec ${pkgs.ripgrep}/bin/rg -uuu "''${@}"
|
||||
'';
|
||||
@@ -59,8 +65,12 @@ in
|
||||
nix-output-monitor # For better view into nixos-rebuild
|
||||
# nix-serve-ng # Serve nix store over http
|
||||
cleanup_temporary_files
|
||||
decode_jwt
|
||||
jq
|
||||
inetutils # For whois
|
||||
git_find_merged_branches
|
||||
git_fix_author
|
||||
rsync_clone
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Delete temporary files on entire disk
|
||||
find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
exec find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null
|
||||
|
||||
8
nix/configuration/roles/base/files/decode_jwt.bash
Normal file
8
nix/configuration/roles/base/files/decode_jwt.bash
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Decode the contents of a JWT
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
exec jq -R 'split(".") | .[0],.[1] | gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=")| @base64d | fromjson'
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Find local branches that have been merged
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: ${MAIN_BRANCH:="main"}
|
||||
|
||||
git checkout -q ${MAIN_BRANCH} && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base ${MAIN_BRANCH} $branch) && [[ $(git cherry ${MAIN_BRANCH} $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && echo "$branch"; done
|
||||
22
nix/configuration/roles/base/files/git_fix_author.bash
Normal file
22
nix/configuration/roles/base/files/git_fix_author.bash
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
git filter-branch --env-filter '
|
||||
WRONG_EMAIL="old@email.foo"
|
||||
NEW_NAME="New Name"
|
||||
NEW_EMAIL="new@email.bar"
|
||||
|
||||
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
|
||||
then
|
||||
export GIT_COMMITTER_NAME="$NEW_NAME"
|
||||
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
|
||||
fi
|
||||
if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
|
||||
then
|
||||
export GIT_AUTHOR_NAME="$NEW_NAME"
|
||||
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
|
||||
fi
|
||||
' --tag-name-filter cat --commit-filter 'git commit-tree -S "$@";' -- --branches --tags
|
||||
8
nix/configuration/roles/base/files/rsync_clone.bash
Normal file
8
nix/configuration/roles/base/files/rsync_clone.bash
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Wrapper to set rsync flags for cloning a folder preserving attributes
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
exec rsync -aHAXS "$@"
|
||||
@@ -34,7 +34,7 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
mesa-demos # for glxgears
|
||||
vulkan-tools # for vkcube
|
||||
xorg.xeyes # to test which windows are using x11
|
||||
xeyes # to test which windows are using x11
|
||||
];
|
||||
hardware.graphics.enable = true;
|
||||
# hardware.graphics.enable32Bit = true;
|
||||
|
||||
@@ -79,9 +79,15 @@
|
||||
in
|
||||
{
|
||||
linux_me = addConfig {
|
||||
# Full preemption
|
||||
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
||||
# Server | No preemption - Run until the next tick. Highest throughput but can cause stutter.
|
||||
# PREEMPT = lib.mkOverride 60 lib.kernel.no;
|
||||
# Desktop | Preempt kernel threads only at pre-defined places that call cond_resched().
|
||||
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
||||
# Low-latency desktop | Full preemption - Kernel threads can be preempted unless they hold a spinlock or are in a no-preemption section.
|
||||
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
||||
# RT - All kernel code is preemptible except for a few critical sections.
|
||||
# Middle ground | Real-time tasks preempt immediately like FULL, normal tasks run until the next tick.
|
||||
PREEMPT_LAZY = lib.mkOverride 90 lib.kernel.no;
|
||||
|
||||
# Google's BBRv3 TCP congestion Control
|
||||
TCP_CONG_BBR = lib.kernel.yes;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
(lib.mkIf config.me.graphical {
|
||||
environment.systemPackages = with pkgs; [
|
||||
ddrescueview
|
||||
#ddrescueview
|
||||
];
|
||||
})
|
||||
]
|
||||
|
||||
@@ -53,6 +53,8 @@ in
|
||||
rpcs3
|
||||
];
|
||||
|
||||
allowedUnfree = [ "rpcs3" ];
|
||||
|
||||
security.pam.loginLimits = [
|
||||
{
|
||||
domain = "@wheel";
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
extraLv2Packages = [ pkgs.rnnoise-plugin ];
|
||||
extraLadspaPackages = [ pkgs.rnnoise-plugin.ladspa ];
|
||||
configPackages = [
|
||||
(pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-input-denoising.conf" ''
|
||||
context.modules = [
|
||||
@@ -43,7 +43,7 @@
|
||||
{
|
||||
type = ladspa
|
||||
name = rnnoise
|
||||
plugin = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"
|
||||
plugin = "librnnoise_ladspa"
|
||||
label = noise_suppressor_mono
|
||||
control = {
|
||||
"VAD Threshold (%)" = 50.0
|
||||
|
||||
Reference in New Issue
Block a user