3 Commits

Author SHA1 Message Date
Tom Alexander
9513882870 Still not working. 2025-01-27 20:38:45 -05:00
Tom Alexander
71a6843b37 Same issue with package based on 2ship2harkinian. 2025-01-27 19:26:38 -05:00
Tom Alexander
7d9d1ca80e Add a package for starship (Star Fox 64). 2025-01-27 19:26:38 -05:00
117 changed files with 536 additions and 6788 deletions

View File

@@ -1 +0,0 @@
result

View File

@@ -8,68 +8,61 @@
{ {
imports = [ imports = [
./roles/2ship2harkinian ./roles/reset
./roles/alacritty
./roles/ansible
./roles/ares
./roles/bluetooth
./roles/boot
./roles/chromecast
./roles/chromium
./roles/distributed_build
./roles/docker
./roles/ecc
./roles/emacs
./roles/firefox
./roles/firewall
./roles/flux
./roles/fonts
./roles/gcloud
./roles/git
./roles/global_options ./roles/global_options
./roles/gnuplot ./util/unfree_polyfill
./roles/gpg
./roles/graphics
./roles/hydra
./roles/iso ./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/kanshi
./roles/kodi ./roles/alacritty
./roles/firefox
./roles/chromium
./roles/emacs
./roles/git
./roles/fonts
./roles/gpg
./roles/waybar
./roles/qemu
./roles/wireguard
./roles/ares
./roles/ssh
./roles/python
./roles/docker
./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/pcsx2
./roles/python
./roles/qemu
./roles/reset
./roles/rust
./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/waybar ./roles/vnc_client
./roles/wireguard ./roles/chromecast
./roles/zfs ./roles/memtest86
./roles/zrepl ./roles/kodi
./roles/zsh ./roles/ansible
./util/unfree_polyfill ./roles/bluetooth
./roles/sm64ex
./roles/shipwright
./roles/2ship2harkinian
./roles/nix_index
]; ];
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@@ -81,9 +74,6 @@
# 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;
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;
@@ -110,14 +100,12 @@
home-manager.users.talexander = home-manager.users.talexander =
{ pkgs, ... }: { pkgs, ... }:
{ {
# The state version is required and should stay at the version you home.packages = [
# originally installed. pkgs.atool
home.stateVersion = "24.11"; pkgs.httpie
}; ];
programs.bash.enable = true;
home-manager.users.root =
{ pkgs, ... }:
{
# The state version is required and should stay at the version you # The state version is required and should stay at the version you
# originally installed. # originally installed.
home.stateVersion = "24.11"; home.stateVersion = "24.11";
@@ -164,12 +152,6 @@
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
]; ];
services.openssh = { services.openssh = {

View File

@@ -8,14 +8,15 @@
] ]
}, },
"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": {
@@ -32,26 +33,6 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1745812220,
"narHash": "sha256-hotBG0EJ9VmAHJYF0yhWuTVZpENHvwcJ2SxvIPrXm+g=",
"owner": "nix-community",
"repo": "disko",
"rev": "d0c543d740fad42fe2c035b43c9d41127e073c78",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -154,11 +135,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1746369725, "lastModified": 1737762889,
"narHash": "sha256-m3ai7LLFYsymMK0uVywCceWfUhP0k3CALyFOfcJACqE=", "narHash": "sha256-5HGG09bh/Yx0JA8wtBMAzt0HMCL1bYZ93x4IqzVExio=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1a1793f6d940d22c6e49753548c5b6cb7dc5545d", "rev": "daf04c5950b676f47a794300657f1d3d14c1a120",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -210,11 +191,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1746232882, "lastModified": 1737885589,
"narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=", "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008", "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -256,22 +237,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unoptimized": {
"locked": {
"lastModified": 1746232882,
"narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@@ -302,13 +267,11 @@
"root": { "root": {
"inputs": { "inputs": {
"ansible-sshjail": "ansible-sshjail", "ansible-sshjail": "ansible-sshjail",
"disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-b93b4e9b5": "nixpkgs-b93b4e9b5", "nixpkgs-b93b4e9b5": "nixpkgs-b93b4e9b5",
"nixpkgs-unoptimized": "nixpkgs-unoptimized",
"zsh-histdb": "zsh-histdb" "zsh-histdb": "zsh-histdb"
} }
}, },
@@ -371,14 +334,15 @@
] ]
}, },
"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",

View File

@@ -3,7 +3,7 @@
# output: result/iso/nixos.iso # output: result/iso/nixos.iso
# Run the ISO image # Run the ISO image
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \ # "$(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,18 +25,6 @@
# 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 --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/quark/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 --flake ".#quark"
#
{ {
description = "My system configuration"; description = "My system configuration";
@@ -44,7 +32,6 @@
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-b93b4e9b5.url = "github:NixOS/nixpkgs/b93b4e9b527904aadf52dba6ca35efde2067cbd4";
nixpkgs-unoptimized.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote = { lanzaboote = {
@@ -65,17 +52,12 @@
# 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-unoptimized,
nixpkgs-b93b4e9b5, nixpkgs-b93b4e9b5,
impermanence, impermanence,
home-manager, home-manager,
@@ -91,17 +73,11 @@
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 { pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
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 home-manager.nixosModules.home-manager
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
inputs.disko.nixosModules.disko
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
@@ -137,34 +113,6 @@
isoImage.makeEfiBootable = true; isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true; isoImage.makeUsbBootable = true;
me.buildingIso = true; me.buildingIso = true;
me.optimizations.enable = false;
}
];
}
);
};
quark = {
main = nixpkgs.lib.nixosSystem (
base_x86_64_linux
// {
modules = base_x86_64_linux.modules ++ [
./hosts/quark
];
}
);
iso = nixpkgs.lib.nixosSystem (
base_x86_64_linux
// {
modules = base_x86_64_linux.modules ++ [
./hosts/quark
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
# TODO: Figure out how to do image based appliances
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
{
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
me.buildingIso = true;
me.optimizations.enable = false;
} }
]; ];
} }
@@ -185,31 +133,6 @@
modules = base_x86_64_linux.modules ++ [ modules = base_x86_64_linux.modules ++ [
./hosts/neelix ./hosts/neelix
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix") (nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
{
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
me.buildingIso = true;
me.optimizations.enable = false;
}
];
}
);
};
hydra = {
main = nixpkgs.lib.nixosSystem (
base_x86_64_linux
// {
modules = base_x86_64_linux.modules ++ [
./hosts/hydra
];
}
);
iso = nixpkgs.lib.nixosSystem (
base_x86_64_linux
// {
modules = base_x86_64_linux.modules ++ [
./hosts/hydra
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
{ {
isoImage.makeEfiBootable = true; isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true; isoImage.makeUsbBootable = true;
@@ -224,11 +147,7 @@
{ {
nixosConfigurations.odo = systems.odo.main; nixosConfigurations.odo = systems.odo.main;
iso.odo = systems.odo.iso.config.system.build.isoImage; iso.odo = systems.odo.iso.config.system.build.isoImage;
nixosConfigurations.quark = systems.quark.main;
iso.quark = systems.quark.iso.config.system.build.isoImage;
nixosConfigurations.neelix = systems.neelix.main; nixosConfigurations.neelix = systems.neelix.main;
iso.neelix = systems.neelix.iso.config.system.build.isoImage; iso.neelix = systems.neelix.iso.config.system.build.isoImage;
nixosConfigurations.hydra = systems.hydra.main;
iso.hydra = systems.hydra.iso.config.system.build.isoImage;
}; };
} }

View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1735141468,
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -0,0 +1,34 @@
{
description = "A slightly better history for zsh";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
let
out =
system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Maybe pkgs = import nixpkgs { inherit system; }; ?
appliedOverlay = self.overlays.default pkgs pkgs;
in
{
packages = rec {
default = starship-game;
starship-game = appliedOverlay.starship-game;
};
};
in
flake-utils.lib.eachDefaultSystem out
// {
overlays.default = final: prev: {
starship-game = final.callPackage ./package.nix { };
};
};
}

View File

@@ -0,0 +1,261 @@
{
lib,
stdenv,
SDL2,
cmake,
copyDesktopItems,
fetchFromGitHub,
fetchpatch,
fetchurl,
imagemagick,
imgui,
libpng,
libpulseaudio,
libzip,
lsb-release,
makeDesktopItem,
makeWrapper,
ninja,
nlohmann_json,
pkg-config,
python3,
spdlog,
stormlib,
tinyxml-2,
writeTextFile,
zenity,
}:
let
# This would get fetched at build time otherwise, see:
# https://github.com/HarbourMasters/2ship2harkinian/blob/1.0.2/mm/CMakeLists.txt#L708
gamecontrollerdb = fetchurl {
name = "gamecontrollerdb.txt";
url = "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/b1759cf84028aab89caa1c395e198c340b8dfd89/gamecontrollerdb.txt";
hash = "sha256-7C5EkqBIhLGNJuhi3832y0ffW5Ep7iuTYXb1bL5h2Js=";
};
# 2ship needs a specific imgui version
imgui' = imgui.overrideAttrs rec {
version = "1.90.6";
src = fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
rev = "v${version}-docking";
hash = "sha256-Y8lZb1cLJF48sbuxQ3vXq6GLru/WThR78pq7LlORIzc=";
};
};
libgfxd = fetchFromGitHub {
owner = "glankk";
repo = "libgfxd";
rev = "96fd3b849f38b3a7c7b7f3ff03c5921d328e6cdf";
hash = "sha256-dedZuV0BxU6goT+rPvrofYqTz9pTA/f6eQcsvpDWdvQ=";
};
yaml_cpp = fetchFromGitHub {
owner = "jbeder";
repo = "yaml-cpp";
rev = "f7320141120f720aecc4c32be25586e7da9eb978";
hash = "sha256-J87oS6Az1/vNdyXu3L7KmUGWzU0IAkGrGMUUha+xDXI=";
};
# spdlog = fetchFromGitHub {
# owner = "gabime";
# repo = "spdlog";
# rev = "7e635fca68d014934b4af8a1cf874f63989352b7";
# hash = "sha256-cxTaOuLXHRU8xMz9gluYz0a93O0ez2xOxbloyc1m1ns=";
# };
# stb_impl = writeTextFile {
# name = "stb_impl.c";
# text = ''
# #define STB_IMAGE_IMPLEMENTATION
# #include "stb_image.h"
# '';
# };
# stb' = fetchurl {
# name = "stb_image.h";
# url = "https://raw.githubusercontent.com/nothings/stb/0bc88af4de5fb022db643c2d8e549a0927749354/stb_image.h";
# hash = "sha256-xUsVponmofMsdeLsI6+kQuPg436JS3PBl00IZ5sg3Vw=";
# };
# Apply 2ship's patch for stormlib
stormlib' = stormlib.overrideAttrs (prev: rec {
version = "9.25";
src = fetchFromGitHub {
owner = "ladislav-zezula";
repo = "StormLib";
rev = "v${version}";
hash = "sha256-HTi2FKzKCbRaP13XERUmHkJgw8IfKaRJvsK3+YxFFdc=";
};
nativeBuildInputs = prev.nativeBuildInputs ++ [ pkg-config ];
patches = (prev.patches or [ ]) ++ [
(fetchpatch {
name = "stormlib-optimizations.patch";
url = "https://github.com/briaguya-ai/StormLib/commit/ff338b230544f8b2bb68d2fbe075175ed2fd758c.patch";
hash = "sha256-Jbnsu5E6PkBifcx/yULMVC//ab7tszYgktS09Azs5+4=";
})
];
});
thread_pool = fetchFromGitHub {
owner = "bshoshany";
repo = "thread-pool";
rev = "v4.1.0";
hash = "sha256-zhRFEmPYNFLqQCfvdAaG5VBNle9Qm8FepIIIrT9sh88=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "starship-game";
version = "v1.0.0";
src = fetchFromGitHub {
owner = "HarbourMasters";
repo = "starship";
# rev = "5e5e49da93e066f51c3010ba38f09331d866f2db";
tag = finalAttrs.version;
hash = "sha256-kaLLlLuonqE2DJcRlWR4tCEBNjwIYFlzeDLcYsvMO7I=";
fetchSubmodules = true;
};
# patches = [
# # remove fetching stb as we will patch our own
# ./0001-deps.patch
# ];
nativeBuildInputs = [
cmake
copyDesktopItems
imagemagick
lsb-release
makeWrapper
ninja
pkg-config
python3
];
buildInputs = [
SDL2
imgui'
libpng
libpulseaudio
libzip
nlohmann_json
spdlog
stormlib'
tinyxml-2
zenity
];
cmakeFlags = [
(lib.cmakeBool "NON_PORTABLE" true)
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/starship-game")
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_IMGUI" "${imgui'.src}")
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_LIBGFXD" "${libgfxd}")
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_STORMLIB" "${stormlib'}")
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_THREADPOOL" "${thread_pool}")
];
dontAddPrefix = true;
# Linking fails without this
hardeningDisable = [ "format" ];
# Pie needs to be enabled or else it segfaults
hardeningEnable = [ "pie" ];
# preConfigure = ''
# # mirror 2ship's stb
# mkdir stb
# cp ${stb'} ./stb/${stb'.name}
# cp ${stb_impl} ./stb/${stb_impl.name}
# substituteInPlace libultraship/cmake/dependencies/common.cmake \
# --replace-fail "\''${STB_DIR}" "/build/source/stb"
# '';
# (cd tools/Torch && cmake -H. -Bbuild-cmake -GNinja \
# -DFETCHCONTENT_SOURCE_DIR_LIBGFXD=${libgfxd} \
# -DFETCHCONTENT_SOURCE_DIR_YAML-CPP=${finalAttrs.yaml_cpp_src} \
# -DFETCHCONTENT_SOURCE_DIR_SPDLOG=${finalAttrs.spdlog_src}
# )
configurePhase = ''
cmake -H. -Bbuild-cmake -GNinja \
-DFETCHCONTENT_SOURCE_DIR_IMGUI=${imgui'.src} \
-DFETCHCONTENT_SOURCE_DIR_STORMLIB=${stormlib'} \
-DFETCHCONTENT_SOURCE_DIR_THREADPOOL=${thread_pool}
(cd tools/Torch && cmake -H. -Bbuild-cmake -GNinja \
-DFETCHCONTENT_SOURCE_DIR_LIBGFXD=${libgfxd} \
-DFETCHCONTENT_SOURCE_DIR_YAML-CPP=${yaml_cpp} \
-DFETCHCONTENT_SOURCE_DIR_SPDLOG=${spdlog}
)
(cd libultraship && cmake -H. -Bbuild-cmake -GNinja \
-DFETCHCONTENT_SOURCE_DIR_LIBGFXD=${libgfxd} \
-DFETCHCONTENT_SOURCE_DIR_IMGUI=${imgui'.src} \
-DFETCHCONTENT_SOURCE_DIR_STORMLIB=${stormlib'} \
-DFETCHCONTENT_SOURCE_DIR_THREADPOOL=${thread_pool}
)
'';
buildPhase = ''
cmake --build build-cmake
'';
postBuild = ''
cp ${gamecontrollerdb} ${gamecontrollerdb.name}
pushd ../OTRExporter
python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out --norom --xml-root ../mm/assets/xml --custom-assets-path ../mm/assets/custom --custom-otr-file 2ship.o2r --port-ver ${finalAttrs.version}
popd
'';
preInstall = ''
# Cmake likes it here for its install paths
cp ../OTRExporter/2ship.o2r mm/
'';
postInstall = ''
mkdir -p $out/bin
ln -s $out/2s2h/2s2h.elf $out/bin/2s2h
install -Dm644 ../mm/linux/2s2hIcon.png $out/share/pixmaps/2s2h.png
'';
postFixup = ''
wrapProgram $out/2s2h/2s2h.elf --prefix PATH ":" ${lib.makeBinPath [ zenity ]}
'';
desktopItems = [
(makeDesktopItem {
name = "starship";
icon = "starship";
exec = "starship";
comment = finalAttrs.meta.description;
genericName = "Starship";
desktopName = "starship";
categories = [ "Game" ];
})
];
meta = {
homepage = "https://github.com/HarbourMasters/2ship2harkinian";
description = "A PC port of Majora's Mask with modern controls, widescreen, high-resolution, and more";
mainProgram = "starship";
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ ];
license = with lib.licenses; [
# # OTRExporter, OTRGui, ZAPDTR, libultraship
# mit
# # 2 Ship 2 Harkinian
# cc0
# # Reverse engineering
# unfree
];
};
})

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,53 +0,0 @@
#
# 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.optimizations.enable = true;
me.secureBoot.enable = false;
# 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;
}

View File

@@ -1,140 +0,0 @@
# 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"
];
}

View File

@@ -1,39 +0,0 @@
# 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";
}

View File

@@ -1,73 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = lib.mkMerge [
{
nix.settings.system-features = lib.mkForce [
"gccarch-znver4"
"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 = [
(
final: prev:
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 prev.linux_6_14 [
"-march=znver4"
"-mtune=znver4"
]
);
}
)
];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4;
}
];
}

View File

@@ -1,77 +0,0 @@
{
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"
];
};
};
}
]
);
}

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -8,21 +8,20 @@
]; ];
# Generate with `head -c4 /dev/urandom | od -A none -t x4` # Generate with `head -c4 /dev/urandom | od -A none -t x4`
networking.hostId = "bca9d0a5"; networking.hostId = "fbd233d8";
networking.hostName = "neelix"; # Define your hostname. networking.hostName = "neelix"; # Define your hostname.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
me.optimizations.enable = false;
me.secureBoot.enable = false; me.secureBoot.enable = false;
# 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";

View File

@@ -9,15 +9,22 @@
config = lib.mkMerge [ config = lib.mkMerge [
{ } { }
(lib.mkIf (!config.me.optimizations.enable) { (lib.mkIf (!config.me.buildingIso) {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_13; nix.settings.system-features = lib.mkForce [
}) "gccarch-alderlake"
(lib.mkIf (config.me.optimizations.enable) { "gccarch-x86-64-v3"
nixpkgs.hostPlatform = { "benchmark"
gcc.arch = "alderlake"; "big-parallel"
gcc.tune = "alderlake"; "kvm"
system = "x86_64-linux"; "nixos-test"
}; ];
# nixpkgs.hostPlatform = {
# gcc.arch = "alderlake";
# gcc.tune = "alderlake";
# system = "x86_64-linux";
# };
nixpkgs.overlays = [ nixpkgs.overlays = [
( (
@@ -35,7 +42,7 @@
}); });
in in
{ {
linux_me = linux_alderlake =
addConfig addConfig
{ {
# Full preemption # Full preemption
@@ -61,19 +68,10 @@
) )
]; ];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me; boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_alderlake;
})
(lib.mkIf (!config.me.buildingIso) {
nix.settings.system-features = lib.mkForce [
"gccarch-alderlake"
"gccarch-x86-64-v3"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
}) })
(lib.mkIf (config.me.buildingIso) { (lib.mkIf (config.me.buildingIso) {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
}) })
]; ];

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,19 +1,12 @@
{ { config, pkgs, ... }:
config,
lib,
pkgs,
...
}:
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./disk-config.nix ./disk-config.nix
./optimized_build.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`
@@ -24,7 +17,6 @@
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
me.optimizations.enable = true;
me.secureBoot.enable = true; me.secureBoot.enable = true;
# Early KMS # Early KMS
@@ -35,15 +27,8 @@
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.ansible.enable = true; me.ansible.enable = true;
me.ares.enable = true; me.ares.enable = true;
@@ -51,36 +36,26 @@
me.chromecast.enable = true; me.chromecast.enable = true;
me.chromium.enable = true; me.chromium.enable = true;
me.docker.enable = true; me.docker.enable = true;
me.ecc.enable = true;
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 = false; me.kanshi.enable = true;
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.rust.enable = true; me.rust.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;

View File

@@ -1,27 +0,0 @@
{
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;
};
};
}
];
}

View File

@@ -1,23 +0,0 @@
{
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"
];
}
];
}

View File

@@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
pkgs-unoptimized,
... ...
}: }:
{ {
@@ -10,82 +9,6 @@
config = lib.mkMerge [ 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': {
crypton = pkgs-unoptimized.haskellPackages.crypton;
crypton-connection = pkgs-unoptimized.haskellPackages.crypton-connection;
crypton-x509 = pkgs-unoptimized.haskellPackages.crypton-x509;
crypton-x509-store = pkgs-unoptimized.haskellPackages.crypton-x509-store;
crypton-x509-system = pkgs-unoptimized.haskellPackages.crypton-x509-system;
crypton-x509-validation = pkgs-unoptimized.haskellPackages.crypton-x509-validation;
hspec-wai = pkgs-unoptimized.haskellPackages.hspec-wai;
http-client-tls = pkgs-unoptimized.haskellPackages.http-client-tls;
http2 = pkgs-unoptimized.haskellPackages.http2;
pandoc = pkgs-unoptimized.haskellPackages.pandoc;
pandoc-cli = pkgs-unoptimized.haskellPackages.pandoc-cli;
pandoc-lua-engine = pkgs-unoptimized.haskellPackages.pandoc-lua-engine;
pandoc-server = pkgs-unoptimized.haskellPackages.pandoc-server;
servant-server = pkgs-unoptimized.haskellPackages.servant-server;
tls = pkgs-unoptimized.haskellPackages.tls;
wai-app-static = pkgs-unoptimized.haskellPackages.wai-app-static;
wai-extra = pkgs-unoptimized.haskellPackages.wai-extra;
warp = pkgs-unoptimized.haskellPackages.warp;
}
);
})
(final: prev: {
gsl = pkgs-unoptimized.gsl;
redis = pkgs-unoptimized.redis;
valkey = pkgs-unoptimized.valkey;
})
];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
})
(lib.mkIf (!config.me.buildingIso) { (lib.mkIf (!config.me.buildingIso) {
nix.settings.system-features = lib.mkForce [ nix.settings.system-features = lib.mkForce [
"gccarch-znver4" "gccarch-znver4"
@@ -99,28 +22,59 @@
"nixos-test" "nixos-test"
]; ];
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap. # nixpkgs.hostPlatform = {
# system.includeBuildDependencies = true; # gcc.arch = "znver4";
# gcc.tune = "znver4";
# system = "x86_64-linux";
# 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;
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) { (lib.mkIf (config.me.buildingIso) {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
}) })
]; ];

View File

@@ -9,10 +9,9 @@
imports = [ ]; imports = [ ];
config = { config = {
# Doesn't seem necessary starting with 6.13 environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
# environment.loginShellInit = lib.mkIf (!config.me.buildingIso) '' doas iw dev wlan0 set power_save off
# 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 = [

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,19 +0,0 @@
#!/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" "${@}" |& nom
# 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'

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,12 +0,0 @@
#!/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" "${@}" |& nom

View File

@@ -1,91 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./disk-config.nix
./distributed_build.nix
./hardware-configuration.nix
./optimized_build.nix
./power_management.nix
./wifi.nix
];
# 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.optimizations.enable = true;
me.secureBoot.enable = true;
# Early KMS
boot.initrd.kernelModules = [ "amdgpu" ];
# Mount tmpfs at /tmp
boot.tmp.useTmpfs = true;
# Enable TRIM
# services.fstrim.enable = lib.mkDefault true;
me.alacritty.enable = true;
me.ansible.enable = true;
me.ares.enable = true;
me.bluetooth.enable = true;
me.chromecast.enable = true;
me.chromium.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.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.rust.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;
}

View File

@@ -1,148 +0,0 @@
# 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" ];
}

View File

@@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = lib.mkMerge [
{
me.distributed_build.enable = true;
me.distributed_build.machines.hydra = {
enable = true;
additional_config = {
speedFactor = 2;
};
};
}
];
}

View File

@@ -1,36 +0,0 @@
# 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;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,122 +0,0 @@
{
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 = "znver5";
gcc.tune = "znver5";
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;
}
)
(final: prev: {
haskellPackages = prev.haskellPackages.extend (
final': prev': {
crypton = pkgs-unoptimized.haskellPackages.crypton;
crypton-connection = pkgs-unoptimized.haskellPackages.crypton-connection;
crypton-x509 = pkgs-unoptimized.haskellPackages.crypton-x509;
crypton-x509-store = pkgs-unoptimized.haskellPackages.crypton-x509-store;
crypton-x509-system = pkgs-unoptimized.haskellPackages.crypton-x509-system;
crypton-x509-validation = pkgs-unoptimized.haskellPackages.crypton-x509-validation;
hspec-wai = pkgs-unoptimized.haskellPackages.hspec-wai;
http-client-tls = pkgs-unoptimized.haskellPackages.http-client-tls;
http2 = pkgs-unoptimized.haskellPackages.http2;
pandoc = pkgs-unoptimized.haskellPackages.pandoc;
pandoc-cli = pkgs-unoptimized.haskellPackages.pandoc-cli;
pandoc-lua-engine = pkgs-unoptimized.haskellPackages.pandoc-lua-engine;
pandoc-server = pkgs-unoptimized.haskellPackages.pandoc-server;
servant-server = pkgs-unoptimized.haskellPackages.servant-server;
tls = pkgs-unoptimized.haskellPackages.tls;
wai-app-static = pkgs-unoptimized.haskellPackages.wai-app-static;
wai-extra = pkgs-unoptimized.haskellPackages.wai-extra;
warp = pkgs-unoptimized.haskellPackages.warp;
}
);
})
(final: prev: {
gsl = pkgs-unoptimized.gsl;
redis = pkgs-unoptimized.redis;
valkey = pkgs-unoptimized.valkey;
})
];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
})
(lib.mkIf (!config.me.buildingIso) {
nix.settings.system-features = lib.mkForce [
"gccarch-znver4"
"gccarch-znver5"
"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;
})
];
}

View File

@@ -1,48 +0,0 @@
{
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";
# })
# ];
}

View File

@@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = {
environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
doas iw dev wlan0 set power_save off
'';
};
}

View File

@@ -75,14 +75,9 @@
# 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
]; ];
@@ -91,6 +86,12 @@
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
];
};
}) })
]; ];
} }

View File

@@ -1,105 +0,0 @@
{
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
)
];
})
]
);
}

View File

@@ -56,32 +56,6 @@
# }; # };
}; };
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" ];
} }

View File

@@ -1,27 +0,0 @@
{
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;
}
]
);
}

View File

@@ -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.emacs-pgtk; my_emacs = final.emacs29-pgtk;
}) })
]; ];
}) })
@@ -121,7 +121,6 @@ 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
@@ -130,9 +129,6 @@ 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.nodePackages_latest.prettier # Format yaml, json, and JS
final.terraform-ls
] ]
} }
''; '';

View File

@@ -51,27 +51,17 @@
;; 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
;; This is an emacs built-in but we're pulling the latest version :config
:pin gnu (windmove-default-keybindings))
: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")

View File

@@ -63,9 +63,6 @@
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)

View File

@@ -1,23 +1,16 @@
(use-package org (use-package org
:ensure nil :ensure nil
:commands org-mode :commands org-mode
:bind (:map org-mode-map :bind (
("C-c l" . org-store-link) ("C-c l" . org-store-link)
("C-c a" . org-agenda) ("C-c a" . org-agenda)
("S-<up>" . org-shiftup) ("C--" . org-timestamp-down)
("S-<right>" . org-shiftright) ("C-=" . org-timestamp-up)
("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)

View File

@@ -1,29 +0,0 @@
{
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
];
}
]
);
}

View File

@@ -47,17 +47,17 @@
</alias> </alias>
<!-- Screw it. Force Liberation Mono to be cascadia mono. --> <!-- Screw it. Force Liberation Mono to be source code pro. -->
<!-- <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">

View File

@@ -1,43 +0,0 @@
{
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";
}
];
};
};
}
]
);
}

View File

@@ -3,7 +3,7 @@
name = Tom Alexander name = Tom Alexander
signingkey = D3A179C9A53C0EDE signingkey = D3A179C9A53C0EDE
[push] [push]
default = simple # (default since 2.0) default = simple
[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
@@ -12,42 +12,24 @@
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 # Use meld for `git difftool` and `git mergetool` tool = meld
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 = true

View File

@@ -9,12 +9,7 @@
imports = [ ]; imports = [ ];
options.me = { 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).";
};
}; };
# options.me.graphics_card_type = lib.mkOption { # options.me.graphics_card_type = lib.mkOption {

View File

@@ -1,29 +0,0 @@
{
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
];
}
]
);
}

View File

@@ -37,26 +37,6 @@
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
];
}) })
] ]
); );

View File

@@ -1,49 +0,0 @@
{
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;
# }
# ];
}
]
);
}

View File

@@ -28,21 +28,6 @@ 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";
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/decrypt_k8s_secret --prefix PATH : ${
lib.makeBinPath [
pkgs.kubectl
pkgs.jq
]
}
'';
});
in in
{ {
imports = [ ]; imports = [ ];
@@ -70,8 +55,6 @@ 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) {

View File

@@ -1,7 +0,0 @@
#!/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'

View File

@@ -20,8 +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? Is this needed? 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;
directories = [ directories = [

View File

@@ -17,8 +17,6 @@ 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 = [ ];
@@ -28,7 +26,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 utilities."; description = "Whether we want to install media.";
}; };
}; };
@@ -37,10 +35,6 @@ 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 {
@@ -65,21 +59,6 @@ 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";
};
})
] ]
); );
} }

View File

@@ -32,17 +32,15 @@
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 hanging 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 anging 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 ${config.networking.hostName}.home.arpa 127.0.0.1 odo.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
''; '';
@@ -63,32 +61,10 @@
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
]; ];
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;
};
} }

View File

@@ -1,57 +0,0 @@
# 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 = { };
}
]
);
}

View File

@@ -1,95 +0,0 @@
{
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";
}
];
};
};
home-manager.users.talexander =
{ pkgs, ... }:
{
home.file.".config/PCSX2/inis/PCSX2.ini" = {
source = ./files/PCSX2.ini;
};
};
})
]
);
}

View File

@@ -1,104 +0,0 @@
[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

View File

@@ -1,6 +1,3 @@
# MANUAL: rustup target add x86_64-unknown-linux-musl
# MANUAL: rustup target add wasm32-unknown-unknown
# MANUAL: rustup component add rustc-codegen-cranelift
{ {
config, config,
lib, lib,
@@ -8,21 +5,6 @@
... ...
}: }:
let
cargo_wrapped =
package: prog:
pkgs.writeShellScriptBin "${prog}" ''
export PATH="$PATH:${
lib.makeBinPath [
pkgs.clang
pkgs.pkg-config # Needed for openssl-sys
]
}"
# Needed for openssl-sys
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${pkgs.openssl.dev}/lib/pkgconfig"
exec ${package}/bin/${prog} "''${@}"
'';
in
{ {
imports = [ ]; imports = [ ];
@@ -42,6 +24,7 @@ in
rustup rustup
lldb # for lldb-vscode lldb # for lldb-vscode
musl # for building static binaries musl # for building static binaries
rust-analyzer
cargo-semver-checks cargo-semver-checks
# ? cargo-bloat # ? cargo-bloat
# ? cargo-outdated # ? cargo-outdated
@@ -55,89 +38,17 @@ in
".cargo/config.toml" = { ".cargo/config.toml" = {
source = ./files/cargo_config.toml; source = ./files/cargo_config.toml;
}; };
".rustup/settings.toml" = { # # TODO: Figure out what to do with credentials.
source = ./files/rustup_settings.toml; # ".cargo/credentials.toml" = {
}; # source = ./files/cargo_credentials.toml;
}; # };
};
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".rustup";
user = "talexander";
group = "talexander";
mode = "0755";
}
{
directory = ".cargo/registry";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
}; };
}; };
systemd.services.link-rust-creds = {
# Contains credentials so it cannot be added to the nix store
enable = true;
description = "link-rust-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/rust/cargo_credentials.toml ]; then
install --directory --owner talexander --group talexander --mode 0755 /home/talexander/.cargo
ln -s /persist/manual/rust/cargo_credentials.toml /home/talexander/.cargo/credentials.toml
fi
'';
preStop = ''
rm -f /home/talexander/.cargo/credentials.toml
'';
};
nixpkgs.overlays = [
(final: prev: {
rustup = pkgs.symlinkJoin {
name = "rustup";
paths =
(builtins.map (cargo_wrapped prev.rustup) [
"cargo"
"cargo-clippy"
"cargo-fmt"
"cargo-miri"
"clippy-driver"
"rls"
"rust-analyzer"
"rust-gdb"
"rust-gdbgui"
"rust-lldb"
"rustc"
"rustdoc"
"rustfmt"
"rustup"
])
++ [
prev.rustup
];
buildInputs = [ pkgs.makeWrapper ];
};
})
];
} }
] ]
); );
} }
# TODO: Install clippy, cranelift, rust-src # TODO: Install clippy, cranelift, rust-src
# TODO: Install rust targets x86_64-unknown-linux-musl and wasm32-unknown-unknown

View File

@@ -1,5 +0,0 @@
default_toolchain = "nightly-x86_64-unknown-linux-gnu"
profile = "default"
version = "12"
[overrides]

View File

@@ -1,51 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
exec_shikane = pkgs.writeTextFile {
name = "exec_shikane.conf";
text = ''
exec shikane
'';
};
in
{
imports = [ ];
options.me = {
shikane.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install shikane.";
};
};
config = lib.mkIf config.me.shikane.enable (
lib.mkMerge [
(lib.mkIf config.me.graphical {
environment.systemPackages = with pkgs; [
shikane
];
me.swayIncludes = [
exec_shikane
];
home-manager.users.talexander =
{ pkgs, ... }:
{
home.file = {
".config/shikane/config.toml" = {
source = ./files/config.toml;
};
};
};
})
]
);
}

View File

@@ -1,17 +0,0 @@
[[profile]]
name = "homedesk"
exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""]
[[profile.output]]
enable = false
search = ["m=0x0BCA", "s=", "v=BOE"]
[[profile.output]]
enable = true
search = ["m=DELL U3014", "s=P1V6N35M329L", "v=Dell Inc."]
mode = "2560x1600@59.972Hz"
position = "0,0"
scale = 1.0
transform = "normal"
adaptive_sync = false
exec = ["echo This is output $SHIKANE_OUTPUT_NAME"]

View File

@@ -34,14 +34,6 @@
# }) # })
# ]; # ];
nixpkgs.overlays = [
(final: prev: {
sm64ex = prev.sm64ex.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [ final.libGL ];
});
})
];
# TODO perhaps install ~/.local/share/sm64ex/sm64config.txt # TODO perhaps install ~/.local/share/sm64ex/sm64config.txt
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {

View File

@@ -1,29 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
sops.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install sops.";
};
};
config = lib.mkIf config.me.sops.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
sops # For encrypting kubernetes secrets.
];
}
]
);
}

View File

@@ -19,27 +19,5 @@
".ssh/known_hosts" ".ssh/known_hosts"
]; ];
}; };
users.root = {
home = "/root";
files = [
".ssh/known_hosts"
];
};
};
home-manager.users.talexander =
{ pkgs, ... }:
{
home.file.".ssh/config" = {
source = ./files/ssh_config;
};
};
home-manager.users.root =
{ pkgs, ... }:
{
home.file.".ssh/config" = {
source = ./files/ssh_config_root;
};
}; };
} }

View File

@@ -1,38 +0,0 @@
Host poudriere
ProxyJump talexander@mrmanager
HostName 10.215.1.203
Host controller0
ProxyJump talexander@mrmanager
HostName 10.215.1.204
Host controller1
ProxyJump talexander@mrmanager
HostName 10.215.1.205
Host controller2
ProxyJump talexander@mrmanager
HostName 10.215.1.206
Host worker0
ProxyJump talexander@mrmanager
HostName 10.215.1.207
Host worker1
ProxyJump talexander@mrmanager
HostName 10.215.1.208
Host worker2
ProxyJump talexander@mrmanager
HostName 10.215.1.209
Host brianai
ProxyJump talexander@mrmanager
HostName 10.215.1.215
Host hydra
ProxyJump talexander@mrmanager
HostName 10.215.1.219
Host *
Compression yes

View File

@@ -1,9 +0,0 @@
Host hydra
HostName ns1.fizz.buzz
Port 65122
User nixworker
IdentitiesOnly yes
IdentityFile /persist/manual/ssh/root/keys/id_ed25519
Host *
Compression yes

View File

@@ -1,29 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
steam_run_free.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install steam_run_free.";
};
};
config = lib.mkIf config.me.steam_run_free.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
steam-run-free
];
}
]
);
}

View File

@@ -240,7 +240,7 @@ let
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )"
makoctl mode -s do-not-disturb makoctl set-mode do-not-disturb
swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 2 swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 2
''; '';
@@ -250,7 +250,7 @@ let
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "''${BASH_SOURCE [ 0 ]}" )" && pwd )" DIR="$( cd "$( dirname "''${BASH_SOURCE [ 0 ]}" )" && pwd )"
makoctl mode -s default makoctl set-mode default
swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 1 swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 1
''; '';

View File

@@ -1,29 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
tekton.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install tekton.";
};
};
config = lib.mkIf config.me.tekton.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
tektoncd-cli
];
}
]
);
}

View File

@@ -48,12 +48,6 @@ in
}; };
}; };
} }
(lib.mkIf config.me.kubernetes.enable {
environment.systemPackages = with pkgs; [
tfk8s # Converts k8s yaml manifests to terraform kubernetes_manifest.
k2tf # Converts k8s yaml manifests to terraform real types.
];
})
] ]
); );
} }

View File

@@ -1,29 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
thunderbolt.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install thunderbolt.";
};
};
config = lib.mkIf config.me.thunderbolt.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
bolt # For boltctl
];
}
]
);
}

View File

@@ -2,7 +2,6 @@
config, config,
lib, lib,
pkgs, pkgs,
pkgs-unoptimized,
... ...
}: }:
@@ -24,7 +23,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wabt wabt
wasm-bindgen-cli wasm-bindgen-cli
pkgs-unoptimized.binaryen # for wasm-opt binaryen # for wasm-opt
]; ];
} }
] ]

View File

@@ -53,7 +53,6 @@
} }
tooltip { tooltip {
/* CSS for hover menu */
background-color: #323232; background-color: #323232;
} }
@@ -184,23 +183,7 @@ tooltip {
} }
#tray { #tray {
/* CSS rules for the tray (not the right-click or hover menu) */ /* No styles */
}
/* #tray menu menuitem */
#tray menu {
/* CSS for right click menu */
background: #323232;
padding: 5px;
border: 1px solid white;
}
#tray menu menuitem {
/* CSS for menu items in the right click menu */
}
#tray menu menuitem:hover {
/* CSS for hovering over a right-click menu item. */
background-color: #434343;
} }
#window { #window {

View File

@@ -1,101 +0,0 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1739314552,
"narHash": "sha256-ggVf2BclyIW3jexc/uvgsgJH4e2cuG6Nyg54NeXgbFI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "83bd3a26ac0526ae04fa74df46738bb44b89dcdd",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"locked": {
"lastModified": 1737831083,
"narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739138025,
"narHash": "sha256-M4ilIfGxzbBZuURokv24aqJTbdjPA9K+DtKUzrJaES4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b2243f41e860ac85c0b446eadc6930359b294e79",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"impermanence": "impermanence",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,51 +0,0 @@
# MANUAL: echo 80 | sudo tee /sys/class/hwmon/hwmon3/max_battery_charge_level
{
description = "My system configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixgl.url = "github:nix-community/nixGL";
nixgl.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
};
outputs =
{
nixpkgs,
nixgl,
home-manager,
impermanence,
...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ nixgl.overlay ];
};
in
# pkgs = nixpkgs.legacyPackages.${system};
{
defaultPackage.${system} = home-manager.defaultPackage.${system};
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit nixgl;
inherit home-manager;
};
modules = [
{ nixpkgs.overlays = [ nixgl.overlay ]; }
impermanence.homeManagerModules.impermanence
./hosts/deck
./home.nix
];
};
};
}

View File

@@ -1,62 +0,0 @@
# TODO: Optimize for znver2
{
config,
pkgs,
nixgl,
...
}:
{
imports = [
./roles/2ship2harkinian
./roles/ares
./roles/dolphin
./roles/duckstation
./roles/global_options
./roles/graphics
./roles/pcsx2
./roles/rpcs3
./roles/ryujinx
./roles/shipwright
./roles/sm64ex
./roles/steam_rom_manager
./roles/yuzu
./util/copy_files
./util/persist_symlink
./util/unfree_polyfill
];
home.username = "deck";
home.homeDirectory = "/home/deck";
home.stateVersion = "24.11";
programs.home-manager.enable = true;
# enable flakes
nix = {
package = pkgs.nix;
settings.experimental-features = [
"nix-command"
"flakes"
];
};
# Automatic garbage collection
nix.gc = {
# Runs nix-collect-garbage --delete-older-than 30d
automatic = true;
randomizedDelaySec = "14m";
options = "--delete-older-than 30d";
};
nix.settings.auto-optimise-store = true;
home.packages = with pkgs; [
pkgs.nixgl.nixGLIntel
(pkgs.nixgl.nixGLCommon pkgs.nixgl.nixGLIntel)
pkgs.nixgl.nixVulkanIntel
];
# This would keep build-time dependencies so I can rebuild while offline.
# nix.settings = {
# keep-outputs = true;
# keep-derivations = true;
# };
}

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
TARGET=deck@172.16.16.250
rsync -av --progress --delete --exclude=.git "$DIR/../../" "${TARGET}:~/.config/mynix"
rsync -av --progress --delete --exclude=.git "/persist/manual/manual_add_to_store" "${TARGET}:~/.persist/manual/"
ssh "${TARGET}" 'source /home/deck/.nix-profile/etc/profile.d/nix.sh && for f in ~/.persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done'
ssh "${TARGET}" "source /home/deck/.nix-profile/etc/profile.d/nix.sh && nix run /home/deck/.config/mynix -- switch -b \$(date +%s).hmbackup --flake /home/deck/.config/mynix --max-jobs $JOBS"
ssh "${TARGET}" 'cat .config/mynix/flake.lock' > "$DIR/../../flake.lock"

View File

@@ -1,26 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = {
me.ares.enable = true;
me.dolphin.enable = true;
me.duckstation.enable = true;
me.graphical = true;
me.optimizations.enable = true;
me.pcsx2.enable = true;
me.rpcs3.enable = true;
me.ryujinx.enable = true;
me.ship2harkinian.enable = true;
me.shipwright.enable = true;
me.sm64ex.enable = true;
me.steam_rom_manager.enable = true; # Steam rom manager UI does not render. I think it wants to be in an AppImage.
me.yuzu.enable = true;
};
}

View File

@@ -1,88 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
steam_2s2h = pkgs.writeScriptBin "steam_2s2h" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs._2ship2harkinian}/bin/2s2h "''${@}"
'';
in
{
imports = [ ];
options.me = {
ship2harkinian.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install 2ship2harkinian.";
};
};
config = lib.mkIf config.me.ship2harkinian.enable (
lib.mkMerge [
{
allowedUnfree = [ "2ship2harkinian" ];
}
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
_2ship2harkinian
steam_2s2h
];
home.file.".local/share/2ship/2ship2harkinian.json" = {
source = ./files/2ship2harkinian.json;
};
me.persist.directories = [ ".local/share/2ship/saves" ];
home.persistence."/home/deck/.state" = {
files = [
".local/share/2ship/mm.o2r"
];
};
nixpkgs.overlays = [
(
final: prev:
let
optimizeWithFlags =
pkg: flags:
pkg.overrideAttrs (old: {
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
});
original_package =
if config.me.optimizations.enable then
(optimizeWithFlags prev._2ship2harkinian [
"-march=znver2"
"-mtune=znver2"
])
else
prev._2ship2harkinian;
in
{
_2ship2harkinian = pkgs.buildEnv {
name = prev._2ship2harkinian.name;
paths = [
(config.lib.nixGL.wrap original_package)
];
extraOutputsToInstall = [
"man"
"doc"
"info"
];
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
postBuild = ''
chmod 0555 $out/share/applications/2s2h.desktop
'';
};
}
)
];
})
]
);
}

View File

@@ -1,20 +0,0 @@
{
"CVars": {
"gInterpolationFPS": 60,
"gEnhancements": {
"Graphics": {
"AuthenticLogo": 1
}
},
"gSettings": {
"InternalResolution": 2.0,
"MSAAValue": 2,
"OpenMenuBar": 0
}
},
"Window": {
"Fullscreen": {
"Enabled": true
}
}
}

View File

@@ -1,86 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
steam_ares = pkgs.writeScriptBin "steam_ares" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs.ares}/bin/ares "''${@}"
'';
in
{
imports = [ ];
options.me = {
ares.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install ares.";
};
};
config = lib.mkIf config.me.ares.enable (
lib.mkMerge [
(lib.mkIf config.me.graphical {
nixGL.vulkan.enable = true;
home.packages = with pkgs; [
ares
steam_ares
];
me.persist.directories = [
".local/share/ares/saves"
".local/share/ares/screenshots"
];
home.file.".local/share/ares/settings.bml" = {
source = ./files/settings.bml;
};
nixpkgs.overlays = [
(
final: prev:
let
optimizeWithFlags =
pkg: flags:
pkg.overrideAttrs (old: {
env.NIX_CFLAGS_COMPILE =
(old.env.NIX_CFLAGS_COMPILE or "") + (lib.strings.concatStringsSep " " flags);
});
original_package =
if config.me.optimizations.enable then
(optimizeWithFlags prev.ares [
"-march=znver2"
"-mtune=znver2"
])
else
prev.ares;
in
{
ares = pkgs.buildEnv {
name = prev.ares.name;
paths = [
(config.lib.nixGL.wrap original_package)
];
extraOutputsToInstall = [
"man"
"doc"
"info"
];
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
postBuild = ''
chmod 0555 $out/share/applications/ares.desktop
'';
};
}
)
];
})
]
);
}

View File

@@ -1,418 +0,0 @@
Video
Driver: OpenGL 3.2
Monitor: Primary
Format: ARGB24
Exclusive: false
Blocking: false
PresentSRGB: false
ThreadedRenderer: true
NativeFullScreen: false
Flush: false
Shader: bilinear.slangp
Multiplier: 1
Output: Scale
AspectCorrection: true
AdaptiveSizing: true
AutoCentering: false
Luminance: 1.0
Saturation: 1.0
Gamma: 1.0
ColorBleed: false
ColorEmulation: true
DeepBlackBoost: false
InterframeBlending: true
Overscan: false
PixelAccuracy: false
Quality: SD
Supersampling: false
DisableVideoInterfaceProcessing: false
WeaveDeinterlacing: true
Audio
Driver: PulseAudio Simple
Device: Default
Frequency: 48000
Latency: 0
Exclusive: false
Blocking: false
Dynamic: false
Mute: false
Volume: 1.0
Balance: 0.0
Input
Driver: SDL
Defocus: Pause
Boot
Fast: false
Debugger: false
Prefer: NTSC-U
General
ShowStatusBar: true
Rewind: false
RunAhead: false
AutoSaveMemory: true
HomebrewMode: false
ForceInterpreter: false
Rewind
Length: 100
Frequency: 10
Paths
Home
Firmware
Saves: /home/deck/.local/share/ares/saves/
Screenshots: /home/deck/.local/share/ares/screenshots/
Debugging: /home/deck/.local/share/ares/debug/
ArcadeRoms
SuperFamicom
GameBoy
BSMemory
SufamiTurbo
DebugServer
Port: 9123
Enabled: false
UseIPv4: false
Nintendo64
ExpansionPak: true
Visible: true
Path: /home/deck/.persist/manual/games/nintendo_64/roms/
MegaDrive
TMSS: false
Visible: false
Path
Recent
Game-1
Game-2
Game-3
Game-4
Game-5
Game-6
Game-7
Game-8
Game-9
VirtualPad1
Pad.Up: 0x28de1205/1/1/Lo;;
Pad.Down: 0x28de1205/1/1/Hi;;
Pad.Left: 0x28de1205/1/0/Lo;;
Pad.Right: 0x28de1205/1/0/Hi;;
Select: ;;
Start: 0x28de1205/3/7;;
A..South: 0x28de1205/3/0;;
B..East: ;;
X..West: 0x28de1205/3/1;;
Y..North: ;;
L-Bumper: 0x28de1205/3/4;;
R-Bumper: 0x28de1205/3/5;;
L-Trigger: ;;
R-Trigger: 0x28de1205/0/2/Hi;;
L-Stick..Click: ;;
R-Stick..Click: ;;
L-Up: 0x28de1205/0/1/Lo;;
L-Down: 0x28de1205/0/1/Hi;;
L-Left: 0x28de1205/0/0/Lo;;
L-Right: 0x28de1205/0/0/Hi;;
R-Up: 0x28de1205/0/4/Lo;;
R-Down: 0x28de1205/0/4/Hi;;
R-Left: 0x28de1205/0/3/Lo;;
R-Right: 0x28de1205/0/3/Hi;;
Rumble: 0x28de1205/3/6;;
VirtualMouse1
X: ;;
Y: ;;
Left: ;;
Middle: ;;
Right: ;;
Extra: ;;
VirtualPad2
Pad.Up: ;;
Pad.Down: ;;
Pad.Left: ;;
Pad.Right: ;;
Select: ;;
Start: ;;
A..South: ;;
B..East: ;;
X..West: ;;
Y..North: ;;
L-Bumper: ;;
R-Bumper: ;;
L-Trigger: ;;
R-Trigger: ;;
L-Stick..Click: ;;
R-Stick..Click: ;;
L-Up: ;;
L-Down: ;;
L-Left: ;;
L-Right: ;;
R-Up: ;;
R-Down: ;;
R-Left: ;;
R-Right: ;;
Rumble: ;;
VirtualMouse2
X: ;;
Y: ;;
Left: ;;
Middle: ;;
Right: ;;
Extra: ;;
VirtualPad3
Pad.Up: ;;
Pad.Down: ;;
Pad.Left: ;;
Pad.Right: ;;
Select: ;;
Start: ;;
A..South: ;;
B..East: ;;
X..West: ;;
Y..North: ;;
L-Bumper: ;;
R-Bumper: ;;
L-Trigger: ;;
R-Trigger: ;;
L-Stick..Click: ;;
R-Stick..Click: ;;
L-Up: ;;
L-Down: ;;
L-Left: ;;
L-Right: ;;
R-Up: ;;
R-Down: ;;
R-Left: ;;
R-Right: ;;
Rumble: ;;
VirtualMouse3
X: ;;
Y: ;;
Left: ;;
Middle: ;;
Right: ;;
Extra: ;;
VirtualPad4
Pad.Up: ;;
Pad.Down: ;;
Pad.Left: ;;
Pad.Right: ;;
Select: ;;
Start: ;;
A..South: ;;
B..East: ;;
X..West: ;;
Y..North: ;;
L-Bumper: ;;
R-Bumper: ;;
L-Trigger: ;;
R-Trigger: ;;
L-Stick..Click: ;;
R-Stick..Click: ;;
L-Up: ;;
L-Down: ;;
L-Left: ;;
L-Right: ;;
R-Up: ;;
R-Down: ;;
R-Left: ;;
R-Right: ;;
Rumble: ;;
VirtualMouse4
X: ;;
Y: ;;
Left: ;;
Middle: ;;
Right: ;;
Extra: ;;
VirtualPad5
Pad.Up: ;;
Pad.Down: ;;
Pad.Left: ;;
Pad.Right: ;;
Select: ;;
Start: ;;
A..South: ;;
B..East: ;;
X..West: ;;
Y..North: ;;
L-Bumper: ;;
R-Bumper: ;;
L-Trigger: ;;
R-Trigger: ;;
L-Stick..Click: ;;
R-Stick..Click: ;;
L-Up: ;;
L-Down: ;;
L-Left: ;;
L-Right: ;;
R-Up: ;;
R-Down: ;;
R-Left: ;;
R-Right: ;;
Rumble: ;;
VirtualMouse5
X: ;;
Y: ;;
Left: ;;
Middle: ;;
Right: ;;
Extra: ;;
Hotkey
ToggleFullscreen: ;;
ToggleMouseCapture: ;;
ToggleKeyboardCapture: ;;
FastForward: ;;
ToggleFastForward: ;;
Rewind: ;;
FrameAdvance: ;;
CaptureScreenshot: ;;
SaveState: ;;
LoadState: ;;
DecrementStateSlot: ;;
IncrementStateSlot: ;;
PauseEmulation: ;;
ResetSystem: ;;
ReloadCurrentGame: ;;
QuitEmulator: ;;
MuteAudio: ;;
IncreaseAudio: ;;
DecreaseAudio: ;;
Arcade
Visible: false
Path
Atari2600
Visible: false
Path
WonderSwan
Visible: false
Path
WonderSwanColor
Visible: false
Path
PocketChallengeV2
Visible: false
Path
ColecoVision
Visible: false
Path
Firmware
BIOS.World
MyVision
Visible: false
Path
MSX
Visible: false
Path
Firmware
BIOS.Japan
MSX2
Visible: false
Path
Firmware
MAIN.Japan
SUB.Japan
PCEngine
Visible: false
Path
PCEngineCD
Visible: false
Path
Firmware
System-Card-1.0.Japan
Arcade-Card.Japan
System-Card-3.0.US
Games-Express.Japan
SuperGrafx
Visible: false
Path
SuperGrafxCD
Visible: false
Path
Firmware
Arcade-Card.Japan
Famicom
Visible: false
Path
FamicomDiskSystem
Visible: false
Path
Firmware
BIOS.Japan
SuperFamicom
Visible: true
Path
Nintendo64DD
Visible: false
Path
Firmware
BIOS.Japan
BIOS.US
BIOS.DEV
GameBoy
Visible: true
Path
GameBoyColor
Visible: true
Path
GameBoyAdvance
Visible: true
Path
Firmware
BIOS.World
SG-1000
Visible: false
Path
MasterSystem
Visible: false
Path
Firmware
BIOS.US
BIOS.Japan
BIOS.Europe
GameGear
Visible: false
Path
Firmware
BIOS.World
Mega32X
Visible: false
Path
MegaCD
Visible: false
Path
Firmware
BIOS.US
BIOS.Japan
BIOS.Europe
MegaCD32X
Visible: false
Path
NeoGeoAES
Visible: false
Path
Firmware
BIOS.World
NeoGeoMVS
Visible: false
Path
Firmware
BIOS.World
NeoGeoPocket
Visible: false
Path
Firmware
BIOS.World
NeoGeoPocketColor
Visible: false
Path
Firmware
BIOS.World
PlayStation
Visible: true
Path
Firmware
BIOS.US
BIOS.Japan
BIOS.Europe
ZXSpectrum
Visible: false
Path
ZXSpectrum128
Visible: false
Path

View File

@@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
blank.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install blank.";
};
};
config = lib.mkIf config.me.blank.enable (
lib.mkMerge [
{
home.packages = with pkgs; [
];
}
(lib.mkIf config.me.graphical {
})
]
);
}

View File

@@ -1,103 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
steam_dolphin = pkgs.writeScriptBin "steam_dolphin" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs.dolphin-emu}/bin/dolphin-emu "''${@}"
'';
in
{
imports = [ ];
options.me = {
dolphin.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install dolphin.";
};
};
config = lib.mkIf config.me.dolphin.enable (
lib.mkMerge [
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
dolphin-emu
steam_dolphin
];
home.file.".config/dolphin-emu/Dolphin.ini" = {
source = ./files/Dolphin.ini;
};
home.file.".config/dolphin-emu/GFX.ini" = {
source = ./files/GFX.ini;
};
home.file.".config/dolphin-emu/Profiles/GCPad/deck.ini" = {
source = ./files/deck.ini;
};
home.file.".config/dolphin-emu/GCPadNew.ini" = {
source = ./files/GCPadNew.ini;
};
me.persist.directories = [
".local/share/dolphin-emu/Wii" # The system memory
".local/share/dolphin-emu/Load" # Memory card(s)
".local/share/dolphin-emu/GC" # Gamecube
".local/share/dolphin-emu/ScreenShots" # Screenshots
".local/share/dolphin-emu/GBA/Saves" # GameBoy Advanced
];
me.state.directories = [
".cache/dolphin-emu"
".local/share/dolphin-emu/Shaders"
".local/share/dolphin-emu/StateSaves"
];
nixpkgs.overlays = [
(
final: prev:
let
optimizeWithFlags =
pkg: flags:
pkg.overrideAttrs (old: {
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
});
original_package =
if config.me.optimizations.enable then
(optimizeWithFlags prev.dolphin-emu [
"-march=znver2"
"-mtune=znver2"
])
else
prev.dolphin-emu;
in
{
dolphin-emu = pkgs.buildEnv {
name = prev.dolphin-emu.name;
paths = [
(config.lib.nixGL.wrap original_package)
];
extraOutputsToInstall = [
"man"
"doc"
"info"
];
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
postBuild = ''
chmod 0555 $out/share/applications/dolphin-emu.desktop
'';
};
}
)
];
})
]
);
}

View File

@@ -1,25 +0,0 @@
[Analytics]
Enabled = False
PermissionAsked = True
[Core]
GFXBackend = Vulkan
# GFXBackend = OGL
SlotA = 8 # GCI Folder (each game gets its own file)
SlotB = 255 # None
WiiSDCard = False
[Display]
RenderToMain = True
[General]
ISOPath0 = /home/deck/.persist/manual/games/nintendo_gamecube/roms
ISOPath1 = /home/deck/.persist/manual/games/nintendo_wii/roms
ISOPaths = 2
RecursiveISOPaths = True
[DSP]
Backend = Cubeb
# Backend = Pulse
# Backend = ALSA
[USBPassthrough]
Devices = 057e:0305
# BluetoothPassthrough must be at the end for the pairings to save properly
[BluetoothPassthrough]
Enabled = True

View File

@@ -1,32 +0,0 @@
[GCPad1]
Device = SDL/0/Steam Deck Controller
Buttons/A = `Button S`
Buttons/B = `Button E`
Buttons/X = `Button W`
Buttons/Y = `Button N`
Buttons/Z = `Shoulder R`
Buttons/Start = Start
Main Stick/Up = `Left Y+`
Main Stick/Down = `Left Y-`
Main Stick/Left = `Left X-`
Main Stick/Right = `Left X+`
Main Stick/Modifier = `Thumb L`
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
C-Stick/Up = `Right Y+`
C-Stick/Down = `Right Y-`
C-Stick/Left = `Right X-`
C-Stick/Right = `Right X+`
C-Stick/Modifier = `Thumb R`
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
D-Pad/Up = `Pad N`
D-Pad/Down = `Pad S`
D-Pad/Left = `Pad W`
D-Pad/Right = `Pad E`
Triggers/L-Analog = `Trigger L`
Triggers/R-Analog = `Trigger R`
[GCPad2]
Device = XInput2/0/Virtual core pointer
[GCPad3]
Device = XInput2/0/Virtual core pointer
[GCPad4]
Device = XInput2/0/Virtual core pointer

View File

@@ -1,16 +0,0 @@
# [Enhancements]
#MaxAnisotropy = 4 # 16x Anisotropic texture filtering
# MaxAnisotropy = 2 # 4x Anisotropic texture filtering
#MaxAnisotropy = 1 # 2x Anisotropic texture filtering
#MaxAnisotropy = 0 # default
[Settings]
WaitForShadersBeforeStarting = True
# WaitForShadersBeforeStarting = False
# MSAA = 0x00000004 # 4x MSAA
#MSAA = 0x00000002 # 2x MSAA
#MSAA = 0x00000001 # none
SSAA = False
# InternalResolution = 1 # 2x native
#ShaderCompilationMode = 2 # Hybrid ubershaders
ShaderCompilationMode = 3 # Skip
# ShowGraphs = True

View File

@@ -1,26 +0,0 @@
[Profile]
Device = SDL/0/Steam Deck Controller
Buttons/A = `Button S`
Buttons/B = `Button E`
Buttons/X = `Button W`
Buttons/Y = `Button N`
Buttons/Z = `Shoulder R`
Buttons/Start = Start
Main Stick/Up = `Left Y+`
Main Stick/Down = `Left Y-`
Main Stick/Left = `Left X-`
Main Stick/Right = `Left X+`
Main Stick/Modifier = `Thumb L`
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
C-Stick/Up = `Right Y+`
C-Stick/Down = `Right Y-`
C-Stick/Left = `Right X-`
C-Stick/Right = `Right X+`
C-Stick/Modifier = `Thumb R`
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
Triggers/L-Analog = `Trigger L`
Triggers/R-Analog = `Trigger R`
D-Pad/Up = `Pad N`
D-Pad/Down = `Pad S`
D-Pad/Left = `Pad W`
D-Pad/Right = `Pad E`

View File

@@ -1,90 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
steam_duckstation = pkgs.writeScriptBin "steam_duckstation" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs.duckstation}/bin/duckstation-qt "''${@}"
'';
in
{
imports = [ ];
options.me = {
duckstation.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install duckstation.";
};
};
config = lib.mkIf config.me.duckstation.enable (
lib.mkMerge [
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
duckstation
steam_duckstation
];
home.file.".local/share/duckstation/settings.ini" = {
source = ./files/settings.ini;
};
me.persist.directories = [
".local/share/duckstation/memcards"
".local/share/duckstation/savestates"
];
me.state.directories = [
".local/share/duckstation/cache"
".local/share/duckstation/shaders"
".local/share/duckstation/screenshots"
".local/share/duckstation/videos"
".local/share/duckstation/covers"
];
nixpkgs.overlays = [
(
final: prev:
let
optimizeWithFlags =
pkg: flags:
pkg.overrideAttrs (old: {
env.CXXFLAGS = (old.env.CXXFLAGS or "") + (lib.strings.concatStringsSep " " flags);
});
original_package =
if config.me.optimizations.enable then
(optimizeWithFlags prev.duckstation [
"-march=znver2"
"-mtune=znver2"
])
else
prev.duckstation;
in
{
duckstation = pkgs.buildEnv {
name = prev.duckstation.name;
paths = [
(config.lib.nixGL.wrap original_package)
];
extraOutputsToInstall = [
"man"
"doc"
"info"
];
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
postBuild = ''
chmod 0555 $out/share/applications/org.duckstation.DuckStation.desktop
'';
};
}
)
];
})
]
);
}

View File

@@ -1,368 +0,0 @@
[Main]
SettingsVersion = 3
EmulationSpeed = 1
FastForwardSpeed = 0
TurboSpeed = 0
SyncToHostRefreshRate = false
IncreaseTimerResolution = true
InhibitScreensaver = true
StartPaused = false
StartFullscreen = false
PauseOnFocusLoss = true
PauseOnControllerDisconnection = false
SaveStateOnExit = true
CreateSaveStateBackups = true
SaveStateCompression = ZstDefault
ConfirmPowerOff = false
EnableDiscordPresence = false
LoadDevicesFromSaveStates = false
DisableAllEnhancements = false
RewindEnable = false
RewindFrequency = 10
RewindSaveSlots = 10
RunaheadFrameCount = 0
SetupWizardIncomplete = false
[Console]
Region = Auto
Enable8MBRAM = false
EnableCheats = false
[PINE]
Enabled = false
Slot = 28011
[CPU]
ExecutionMode = Recompiler
OverclockEnable = false
OverclockNumerator = 1
OverclockDenominator = 1
RecompilerMemoryExceptions = false
RecompilerBlockLinking = true
RecompilerICache = false
FastmemMode = MMap
[GPU]
Renderer = Automatic
Adapter =
ResolutionScale = 3
Multisamples = 1
UseDebugDevice = false
DisableShaderCache = false
DisableDualSourceBlend = false
DisableFramebufferFetch = false
DisableTextureBuffers = false
DisableTextureCopyToSelf = false
DisableMemoryImport = false
DisableRasterOrderViews = false
PerSampleShading = false
UseThread = true
ThreadedPresentation = false
UseSoftwareRendererForReadbacks = false
TrueColor = true
Debanding = false
ScaledDithering = true
ForceRoundTextureCoordinates = false
AccurateBlending = false
TextureFilter = Nearest
SpriteTextureFilter =
LineDetectMode = Disabled
DownsampleMode = Disabled
DownsampleScale = 1
WireframeMode = Disabled
DisableInterlacing = true
ForceNTSCTimings = false
WidescreenHack = false
ChromaSmoothing24Bit = false
PGXPEnable = false
PGXPCulling = true
PGXPTextureCorrection = true
PGXPColorCorrection = false
PGXPVertexCache = false
PGXPCPU = false
PGXPPreserveProjFP = false
PGXPTolerance = -1
PGXPDepthBuffer = false
PGXPDisableOn2DPolygons = false
PGXPDepthClearThreshold = 300
[Display]
DeinterlacingMode = Adaptive
CropMode = Overscan
ActiveStartOffset = 0
ActiveEndOffset = 0
LineStartOffset = 0
LineEndOffset = 0
Force4_3For24Bit = false
AspectRatio = Auto (Game Native)
Alignment = Center
Rotation = Normal
Scaling = BilinearSmooth
OptimalFramePacing = false
PreFrameSleep = false
SkipPresentingDuplicateFrames = false
PreFrameSleepBuffer = 2
VSync = true
DisableMailboxPresentation = true
ExclusiveFullscreenControl = Automatic
ScreenshotMode = InternalResolution
ScreenshotFormat = PNG
ScreenshotQuality = 85
CustomAspectRatioNumerator = 0
ShowOSDMessages = true
ShowFPS = false
ShowSpeed = false
ShowResolution = false
ShowLatencyStatistics = false
ShowGPUStatistics = false
ShowCPU = false
ShowGPU = false
ShowFrameTimes = false
ShowStatusIndicators = true
ShowInputs = false
ShowEnhancements = false
OSDScale = 100
StretchVertically = false
[CDROM]
ReadaheadSectors = 8
MechaconVersion = VC1A
RegionCheck = false
LoadImageToRAM = false
LoadImagePatches = false
MuteCDAudio = false
ReadSpeedup = 1
SeekSpeedup = 1
[Audio]
Backend = Cubeb
Driver =
OutputDevice =
StretchMode = TimeStretch
BufferMS = 50
OutputLatencyMS = 20
OutputLatencyMinimal = false
StretchSequenceLengthMS = 30
StretchSeekWindowMS = 20
StretchOverlapMS = 10
StretchUseQuickSeek = false
StretchUseAAFilter = false
OutputVolume = 100
FastForwardVolume = 100
OutputMuted = false
[Hacks]
UseOldMDECRoutines = false
ExportSharedMemory = false
DMAMaxSliceTicks = 1000
DMAHaltTicks = 100
GPUFIFOSize = 16
GPUMaxRunAhead = 128
[PCDrv]
Enabled = false
EnableWrites = false
Root =
[BIOS]
TTYLogging = false
PatchFastBoot = false
SearchDirectory = ../../../.persist/manual/games/sony_ps2/bios
[MemoryCards]
Card1Type = PerGameTitle
Card2Type = None
UsePlaylistTitle = true
Directory = memcards
[ControllerPorts]
MultitapMode = Disabled
PointerXScale = 8
PointerYScale = 8
PointerXInvert = false
PointerYInvert = false
[Cheevos]
Enabled = false
ChallengeMode = false
Notifications = true
LeaderboardNotifications = true
SoundEffects = true
Overlays = true
EncoreMode = false
SpectatorMode = false
UnofficialTestMode = false
UseFirstDiscFromPlaylist = true
UseRAIntegration = false
NotificationsDuration = 5
LeaderboardsDuration = 10
[Logging]
LogLevel = Info
LogFilter =
LogTimestamps = true
LogToConsole = true
LogToDebug = false
LogToWindow = false
LogToFile = false
[Debug]
ShowVRAM = false
DumpCPUToVRAMCopies = false
DumpVRAMToCPUCopies = false
ShowGPUState = false
ShowCDROMState = false
ShowSPUState = false
ShowTimersState = false
ShowMDECState = false
ShowDMAState = false
[TextureReplacements]
EnableVRAMWriteReplacements = false
PreloadTextures = false
DumpVRAMWrites = false
DumpVRAMWriteForceAlphaChannel = true
DumpVRAMWriteWidthThreshold = 128
DumpVRAMWriteHeightThreshold = 128
[MediaCapture]
Backend = FFmpeg
Container = mp4
VideoCapture = true
VideoWidth = 640
VideoHeight = 480
VideoAutoSize = false
VideoBitrate = 6000
VideoCodec =
VideoCodecUseArgs = false
AudioCodecArgs =
AudioCapture = true
AudioBitrate = 128
AudioCodec =
AudioCodecUseArgs = false
[Folders]
Cache = cache
Cheats = cheats
Covers = covers
Dumps = dump
GameIcons = gameicons
GameSettings = gamesettings
InputProfiles = inputprofiles
SaveStates = savestates
Screenshots = screenshots
Shaders = shaders
Textures = textures
UserResources = resources
Videos = videos
[InputSources]
SDL = true
SDLControllerEnhancedMode = false
SDLPS5PlayerLED = false
XInput = false
RawInput = false
[Pad1]
Type = AnalogController
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
R1 = SDL-0/RightShoulder
L2 = SDL-0/+LeftTrigger
R2 = SDL-0/+RightTrigger
L3 = SDL-0/LeftStick
R3 = SDL-0/RightStick
LLeft = SDL-0/-LeftX
LRight = SDL-0/+LeftX
LDown = SDL-0/+LeftY
LUp = SDL-0/-LeftY
RLeft = SDL-0/-RightX
RRight = SDL-0/+RightX
RDown = SDL-0/+RightY
RUp = SDL-0/-RightY
Analog = SDL-0/Guide
SmallMotor = SDL-0/SmallMotor
LargeMotor = SDL-0/LargeMotor
[Pad2]
Type = None
[Pad3]
Type = None
[Pad4]
Type = None
[Pad5]
Type = None
[Pad6]
Type = None
[Pad7]
Type = None
[Pad8]
Type = None
[Hotkeys]
FastForward = Keyboard/Tab
TogglePause = Keyboard/Space
Screenshot = Keyboard/F10
ToggleFullscreen = Keyboard/F11
OpenPauseMenu = Keyboard/Escape
LoadSelectedSaveState = Keyboard/F1
SaveSelectedSaveState = Keyboard/F2
SelectPreviousSaveStateSlot = Keyboard/F3
SelectNextSaveStateSlot = Keyboard/F4
[UI]
UnofficialBuildWarningConfirmed = true
MainWindowGeometry = AdnQywADAAAAAAAAAAAAAAAAAx8AAAKOAAAAAAAAAAAAAAMfAAACjgAAAAAAAAAABQAAAAAAAAAAAAAAAx8AAAKO
MainWindowState = AAAA/wAAAAD9AAAAAAAAAyAAAAJjAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAOAHQAbwBvAGwAQgBhAHIAAAAAAP////8AAAAAAAAAAA==
[AutoUpdater]
CheckAtStartup = false
[GameList]
RecursivePaths = /home/deck/.persist/manual/games/sony_ps1/roms

View File

@@ -1,19 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
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).";
};
};
}

View File

@@ -1,43 +0,0 @@
{
config,
lib,
pkgs,
nixgl,
...
}:
{
imports = [ ];
options.me.graphics_card_type = lib.mkOption {
type = lib.types.nullOr (
lib.types.enum [
"amd"
"intel"
"nvidia"
]
);
default = null;
example = "amd";
description = "What graphics card type is in the computer.";
};
options.me.graphical = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install graphical programs.";
};
config = (
lib.mkMerge [
(lib.mkIf config.me.graphical {
nixGL.packages = nixgl.packages;
# home.packages = with pkgs; [
# mesa-demos # for glxgears
# vulkan-tools # for vkcube
# ];
})
]
);
}

Some files were not shown because too many files have changed in this diff Show More