Compare commits
76 Commits
starship
...
fc47359184
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc47359184 | ||
|
|
812a762652 | ||
|
|
fb785e036b | ||
|
|
cdc7d13225 | ||
|
|
ec4583b79e | ||
|
|
cab8c8d955 | ||
|
|
33f582d17a | ||
|
|
295ac24361 | ||
|
|
42dd67f9da | ||
|
|
c173ea87cf | ||
|
|
33f45c56bf | ||
|
|
83389cb5cf | ||
|
|
4db3ef1ed3 | ||
|
|
fe7a083a7b | ||
|
|
cd0578d0a6 | ||
|
|
f56dcc7c42 | ||
|
|
83de1e3708 | ||
|
|
2b20ab5123 | ||
|
|
3ecb2fc790 | ||
|
|
44a49d7ac7 | ||
|
|
acfc9ac1a4 | ||
|
|
e733dcdcbf | ||
|
|
3099a18424 | ||
|
|
15c209fdd9 | ||
|
|
ee181b535e | ||
|
|
4d0fc61e13 | ||
|
|
2b54630053 | ||
|
|
84bd6be8e6 | ||
|
|
dd96520ad1 | ||
|
|
11a1d61581 | ||
|
|
bab2cfdc7b | ||
|
|
fd0c92f3eb | ||
|
|
6ac33d2538 | ||
|
|
8d4b345414 | ||
|
|
8beaf00693 | ||
|
|
181e650094 | ||
|
|
449f288214 | ||
|
|
f6df27d7a9 | ||
|
|
e3a7a410c4 | ||
|
|
345c62a477 | ||
|
|
e7528765a9 | ||
|
|
54860370c0 | ||
|
|
46b21370bd | ||
|
|
381e3fb591 | ||
|
|
5d4ebf90b3 | ||
|
|
7dcdcc906c | ||
|
|
a4abb96de3 | ||
|
|
5859a06c5d | ||
|
|
02223deb64 | ||
|
|
20e247f8ed | ||
|
|
b0186dc85b | ||
|
|
cac15febfa | ||
|
|
48fa3c7436 | ||
|
|
7dd922c2a2 | ||
|
|
ab6f7dbea5 | ||
|
|
fea86b00b4 | ||
|
|
197b8fcced | ||
|
|
0bec3dbe63 | ||
|
|
53caf8bc81 | ||
|
|
c37d0d9b9e | ||
|
|
a663a90ada | ||
|
|
2d976a1cf3 | ||
|
|
d8e8781287 | ||
|
|
502e18fdec | ||
|
|
24d83e95a5 | ||
|
|
3ed43b1b8a | ||
|
|
64e735abbf | ||
|
|
ed11bf1e65 | ||
|
|
c0afe006b8 | ||
|
|
1fe305576b | ||
|
|
fc400a98db | ||
|
|
4a63e1c23e | ||
|
|
379795f6e8 | ||
|
|
edd3c6a266 | ||
|
|
dd785692ce | ||
|
|
c6ff6a1f24 |
@@ -12,12 +12,6 @@
|
||||
./roles/global_options
|
||||
./util/unfree_polyfill
|
||||
./roles/iso
|
||||
"${
|
||||
builtins.fetchTarball {
|
||||
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.9.0.tar.gz";
|
||||
sha256 = "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388";
|
||||
}
|
||||
}/module.nix"
|
||||
./roles/boot
|
||||
./roles/zfs
|
||||
./roles/network
|
||||
@@ -63,6 +57,15 @@
|
||||
./roles/shipwright
|
||||
./roles/2ship2harkinian
|
||||
./roles/nix_index
|
||||
./roles/flux
|
||||
./roles/tekton
|
||||
./roles/gnuplot
|
||||
./roles/sops
|
||||
./roles/gcloud
|
||||
./roles/steam_run_free
|
||||
./roles/pcsx2
|
||||
./roles/hydra
|
||||
./roles/shikane
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
@@ -111,6 +114,14 @@
|
||||
home.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
home-manager.users.root =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# The state version is required and should stay at the version you
|
||||
# originally installed.
|
||||
home.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
# Automatic garbage collection
|
||||
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
||||
# Runs nix-collect-garbage --delete-older-than 5d
|
||||
@@ -152,6 +163,12 @@
|
||||
ncdu
|
||||
nix-tree
|
||||
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 = {
|
||||
|
||||
50
nix/configuration/flake.lock
generated
50
nix/configuration/flake.lock
generated
@@ -33,6 +33,26 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743598667,
|
||||
"narHash": "sha256-ViE7NoFWytYO2uJONTAX35eGsvTYXNHjWALeHAg8OQY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "329d3d7e8bc63dd30c39e14e6076db590a6eabe6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -135,11 +155,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737762889,
|
||||
"narHash": "sha256-5HGG09bh/Yx0JA8wtBMAzt0HMCL1bYZ93x4IqzVExio=",
|
||||
"lastModified": 1742588233,
|
||||
"narHash": "sha256-Fi5g8H5FXMSRqy+mU6gPG0v+C9pzjYbkkiePtz8+PpA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "daf04c5950b676f47a794300657f1d3d14c1a120",
|
||||
"rev": "296ddc64627f4a6a4eb447852d7346b9dd16197d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -191,11 +211,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1737885589,
|
||||
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
|
||||
"lastModified": 1742422364,
|
||||
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
|
||||
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -237,6 +257,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unoptimized": {
|
||||
"locked": {
|
||||
"lastModified": 1742422364,
|
||||
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
@@ -267,11 +303,13 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"ansible-sshjail": "ansible-sshjail",
|
||||
"disko": "disko",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
"lanzaboote": "lanzaboote",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-b93b4e9b5": "nixpkgs-b93b4e9b5",
|
||||
"nixpkgs-unoptimized": "nixpkgs-unoptimized",
|
||||
"zsh-histdb": "zsh-histdb"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# output: result/iso/nixos.iso
|
||||
|
||||
# Run the ISO image
|
||||
# "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
@@ -12,7 +12,7 @@
|
||||
# -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f ./result/iso/nixos.iso)" \
|
||||
# -cdrom "$(readlink -f ./result/iso/nixos*.iso)" \
|
||||
# -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
|
||||
@@ -32,6 +32,7 @@
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
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.inputs.nixpkgs.follows = "nixpkgs";
|
||||
lanzaboote = {
|
||||
@@ -52,12 +53,17 @@
|
||||
# Optional but recommended to limit the size of your system closure.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unoptimized,
|
||||
nixpkgs-b93b4e9b5,
|
||||
impermanence,
|
||||
home-manager,
|
||||
@@ -73,11 +79,17 @@
|
||||
pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 {
|
||||
inherit system;
|
||||
};
|
||||
pkgs-unoptimized = import nixpkgs-unoptimized {
|
||||
inherit system;
|
||||
hostPlatform.gcc.arch = "default";
|
||||
hostPlatform.gcc.tune = "default";
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
impermanence.nixosModules.impermanence
|
||||
home-manager.nixosModules.home-manager
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
inputs.disko.nixosModules.disko
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
@@ -142,6 +154,30 @@
|
||||
}
|
||||
);
|
||||
};
|
||||
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.makeUsbBootable = true;
|
||||
me.buildingIso = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -149,5 +185,7 @@
|
||||
iso.odo = systems.odo.iso.config.system.build.isoImage;
|
||||
nixosConfigurations.neelix = systems.neelix.main;
|
||||
iso.neelix = systems.neelix.iso.config.system.build.isoImage;
|
||||
nixosConfigurations.hydra = systems.hydra.main;
|
||||
iso.hydra = systems.hydra.iso.config.system.build.isoImage;
|
||||
};
|
||||
}
|
||||
|
||||
56
nix/configuration/hosts/hydra/default.nix
Normal file
56
nix/configuration/hosts/hydra/default.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Testing:
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
# -m 32768 \
|
||||
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
|
||||
# -device nvme,serial=deadbeef,drive=nvm \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
|
||||
# -display vnc=127.0.0.1:0
|
||||
#
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./disk-config.nix
|
||||
./hardware-configuration.nix
|
||||
./optimized_build.nix
|
||||
./vm_disk.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "fbd233d8";
|
||||
|
||||
networking.hostName = "hydra"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = false;
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
me.emacs_flavor = "plainmacs";
|
||||
me.graphical = false;
|
||||
me.hydra.enable = false;
|
||||
me.vm_disk.enable = true;
|
||||
me.wireguard.activated = [ ];
|
||||
me.wireguard.deactivated = [ ];
|
||||
me.zsh.enable = true;
|
||||
|
||||
# Trust this key so nix running as root can ssh into hydra.
|
||||
users.users.talexander.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB/IlYTQ0M5pFN5tdoswh37CDl/gbULI3h+SsKXCansh talexander@odo"
|
||||
];
|
||||
}
|
||||
140
nix/configuration/hosts/hydra/disk-config.nix
Normal file
140
nix/configuration/hosts/hydra/disk-config.nix
Normal file
@@ -0,0 +1,140 @@
|
||||
# Manual Step:
|
||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingIso) {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
# mode = "mirror";
|
||||
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||
options.cachefile = "none";
|
||||
options = {
|
||||
ashift = "12";
|
||||
compatibility = "openzfs-2.2-freebsd";
|
||||
autotrim = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
atime = "off";
|
||||
relatime = "off";
|
||||
xattr = "sa";
|
||||
mountpoint = "none";
|
||||
compression = "lz4";
|
||||
canmount = "off";
|
||||
utf8only = "on";
|
||||
dnodesize = "auto";
|
||||
normalization = "formD";
|
||||
};
|
||||
|
||||
datasets = {
|
||||
"linux/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "none";
|
||||
};
|
||||
"linux/nix/root" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||
};
|
||||
"linux/nix/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/nix";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||
options = {
|
||||
recordsize = "1MiB";
|
||||
compression = "lz4";
|
||||
};
|
||||
};
|
||||
"linux/nix/home" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/home";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/home@blank$' || zfs snapshot zroot/linux/nix/home@blank";
|
||||
};
|
||||
"linux/nix/persist" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/persist";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/persist@blank$' || zfs snapshot zroot/linux/nix/persist@blank";
|
||||
};
|
||||
"linux/nix/state" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/state";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/state@blank$' || zfs snapshot zroot/linux/nix/state@blank";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Make sure all persistent volumes are marked as neededForBoot
|
||||
#
|
||||
# Also mounts /home so it is mounted before the user home directories are created.
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/home".neededForBoot = true;
|
||||
|
||||
fileSystems."/".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/nix".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/persist".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/state".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/home".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
}
|
||||
39
nix/configuration/hosts/hydra/hardware-configuration.nix
Normal file
39
nix/configuration/hosts/hydra/hardware-configuration.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.dhcpcd.enable = lib.mkForce true;
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
networking.interfaces.enp0s2.useDHCP = lib.mkForce true;
|
||||
# systemd.network.enable = true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
73
nix/configuration/hosts/hydra/optimized_build.nix
Normal file
73
nix/configuration/hosts/hydra/optimized_build.nix
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
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_13 [
|
||||
"-march=znver4"
|
||||
"-mtune=znver4"
|
||||
]
|
||||
);
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4;
|
||||
}
|
||||
];
|
||||
}
|
||||
77
nix/configuration/hosts/hydra/vm_disk.nix
Normal file
77
nix/configuration/hosts/hydra/vm_disk.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
vm_disk.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to mount the local disk for persistent storage.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.vm_disk.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# Mount the local disk
|
||||
fileSystems = {
|
||||
"/.disk" = lib.mkForce {
|
||||
device = "/dev/nvme0n1p1";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
"/persist" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/persist";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/persist"
|
||||
];
|
||||
};
|
||||
|
||||
"/state" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/state";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/state"
|
||||
];
|
||||
};
|
||||
|
||||
"/nix/store" = lib.mkForce {
|
||||
fsType = "overlay";
|
||||
device = "overlay";
|
||||
options = [
|
||||
"lowerdir=/nix/.ro-store"
|
||||
"upperdir=/.disk/persist/store"
|
||||
"workdir=/.disk/state/work"
|
||||
];
|
||||
depends = [
|
||||
"/nix/.ro-store"
|
||||
"/.disk/persist/store"
|
||||
"/.disk/state/work"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
# boot.tmp.useTmpfs = true;
|
||||
|
||||
me.bluetooth.enable = true;
|
||||
me.emacs_flavor = "plainmacs";
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./disk-config.nix
|
||||
./optimized_build.nix
|
||||
./distributed_build.nix
|
||||
./power_management.nix
|
||||
./screen_brightness.nix
|
||||
./wifi.nix
|
||||
./framework_module.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
@@ -27,8 +34,15 @@
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
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.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
@@ -38,23 +52,31 @@
|
||||
me.docker.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 = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.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.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
|
||||
36
nix/configuration/hosts/odo/distributed_build.nix
Normal file
36
nix/configuration/hosts/odo/distributed_build.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
nix.distributedBuilds = true;
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "hydra";
|
||||
sshUser = "talexander";
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
# "aarch64-linux"
|
||||
];
|
||||
maxJobs = 1;
|
||||
speedFactor = 2;
|
||||
supportedFeatures = [
|
||||
# "nixos-test"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
# "kvm"
|
||||
"gccarch-znver4"
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
23
nix/configuration/hosts/odo/framework_module.nix
Normal file
23
nix/configuration/hosts/odo/framework_module.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
framework-laptop-kmod
|
||||
];
|
||||
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||
boot.kernelModules = [
|
||||
"cros_ec"
|
||||
"cros_ec_lpcs"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-unoptimized,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -22,16 +23,24 @@
|
||||
"nixos-test"
|
||||
];
|
||||
|
||||
# nixpkgs.hostPlatform = {
|
||||
# gcc.arch = "znver4";
|
||||
# gcc.tune = "znver4";
|
||||
# system = "x86_64-linux";
|
||||
# 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
|
||||
# '';
|
||||
|
||||
nixpkgs.hostPlatform = {
|
||||
gcc.arch = "znver4";
|
||||
gcc.tune = "znver4";
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
self: super:
|
||||
final: prev:
|
||||
let
|
||||
optimizeWithFlags =
|
||||
pkg: flags:
|
||||
@@ -62,19 +71,45 @@
|
||||
HZ_1000 = lib.kernel.no;
|
||||
}
|
||||
(
|
||||
optimizeWithFlags super.linux_6_12 [
|
||||
optimizeWithFlags prev.linux_6_13 [
|
||||
"-march=znver4"
|
||||
"-mtune=znver4"
|
||||
]
|
||||
);
|
||||
# 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;
|
||||
}
|
||||
);
|
||||
})
|
||||
# (final: prev: {
|
||||
# haskell = prev.haskell // {
|
||||
# packageOverrides = final.lib.composeExtensions prev.haskell.packageOverrides (
|
||||
# final': prev': {
|
||||
# crypton = pkgs-unoptimized.haskellPackages.crypton;
|
||||
# }
|
||||
# );
|
||||
# };
|
||||
# })
|
||||
(final: prev: {
|
||||
redis = pkgs-unoptimized.redis;
|
||||
gsl = pkgs-unoptimized.gsl;
|
||||
})
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4;
|
||||
})
|
||||
(lib.mkIf (config.me.buildingIso) {
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_13;
|
||||
boot.supportedFilesystems.zfs = true;
|
||||
})
|
||||
];
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||
doas iw dev wlan0 set power_save off
|
||||
'';
|
||||
# Doesn't seem necessary starting with 6.13
|
||||
# environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||
# doas iw dev wlan0 set power_save off
|
||||
# '';
|
||||
|
||||
# Enable debug logging for ath12k wifi card.
|
||||
boot.kernelParams = [
|
||||
|
||||
@@ -56,6 +56,32 @@
|
||||
# };
|
||||
};
|
||||
|
||||
systemd.services.link-docker-creds = {
|
||||
# Contains credentials so it cannot be added to the nix store
|
||||
enable = true;
|
||||
description = "link-docker-creds";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
# path = with pkgs; [
|
||||
# zfs
|
||||
# ];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
};
|
||||
script = ''
|
||||
if [ -e /persist/manual/docker/config.json ]; then
|
||||
install --directory --owner talexander --group talexander --mode 0700 /home/talexander/.docker
|
||||
ln -s /persist/manual/docker/config.json /home/talexander/.docker/config.json
|
||||
fi
|
||||
'';
|
||||
preStop = ''
|
||||
rm -f /home/talexander/.docker/config.json
|
||||
'';
|
||||
};
|
||||
|
||||
# Needed for non-rootless docker
|
||||
users.users.talexander.extraGroups = [ "docker" ];
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ in
|
||||
(lib.mkIf (config.me.graphical) {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
my_emacs = final.emacs29-pgtk;
|
||||
my_emacs = final.emacs-pgtk;
|
||||
})
|
||||
];
|
||||
})
|
||||
@@ -121,6 +121,7 @@ in
|
||||
dicts: with dicts; [
|
||||
en
|
||||
en-computers
|
||||
# en-science # TODO: Why is en-science non-free?
|
||||
]
|
||||
))
|
||||
final.nixd # nix language server
|
||||
@@ -129,6 +130,9 @@ in
|
||||
final.shellcheck
|
||||
final.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
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
@@ -51,17 +51,27 @@
|
||||
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
||||
(use-package savehist
|
||||
;; This is an emacs built-in but we're pulling the latest version
|
||||
:pin gnu
|
||||
:config
|
||||
(savehist-mode))
|
||||
|
||||
(use-package which-key
|
||||
:pin gnu
|
||||
:diminish
|
||||
:config
|
||||
(which-key-mode))
|
||||
|
||||
(use-package windmove
|
||||
:config
|
||||
(windmove-default-keybindings))
|
||||
;; This is an emacs built-in but we're pulling the latest version
|
||||
:pin gnu
|
||||
:bind
|
||||
(
|
||||
("S-<up>" . windmove-up)
|
||||
("S-<right>" . windmove-right)
|
||||
("S-<down>" . windmove-down)
|
||||
("S-<left>" . windmove-left)
|
||||
)
|
||||
)
|
||||
|
||||
(setq tramp-default-method "ssh")
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
show-trailing-whitespace t
|
||||
;; Remove the line when killing it with ctrl-k
|
||||
kill-whole-line t
|
||||
|
||||
;; Show the current project in the mode line
|
||||
project-mode-line t
|
||||
)
|
||||
|
||||
;; (setq-default fringes-outside-margins t)
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
(use-package org
|
||||
:ensure nil
|
||||
:commands org-mode
|
||||
:bind (
|
||||
:bind (:map org-mode-map
|
||||
("C-c l" . org-store-link)
|
||||
("C-c a" . org-agenda)
|
||||
("C--" . org-timestamp-down)
|
||||
("C-=" . org-timestamp-up)
|
||||
("S-<up>" . org-shiftup)
|
||||
("S-<right>" . org-shiftright)
|
||||
("S-<down>" . org-shiftdown)
|
||||
("S-<left>" . org-shiftleft)
|
||||
)
|
||||
:hook (
|
||||
(org-mode . (lambda ()
|
||||
(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
|
||||
(require 'org-tempo)
|
||||
|
||||
29
nix/configuration/roles/flux/default.nix
Normal file
29
nix/configuration/roles/flux/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
flux.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install flux.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.flux.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
fluxcd
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -47,17 +47,17 @@
|
||||
</alias>
|
||||
|
||||
|
||||
<!-- Screw it. Force Liberation Mono to be source code pro. -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Liberation Mono</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
<!-- Screw it. Force Liberation Mono to be cascadia mono. -->
|
||||
<!-- <match target="pattern"> -->
|
||||
<!-- <test qual="any" name="family"><string>Liberation Mono</string></test> -->
|
||||
<!-- <edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit> -->
|
||||
<!-- </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 -->
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>monospace</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit>
|
||||
</match>
|
||||
<!-- <match target="pattern"> -->
|
||||
<!-- <test qual="any" name="family"><string>monospace</string></test> -->
|
||||
<!-- <edit name="family" mode="assign" binding="same"><string>Cascadia Mono</string></edit> -->
|
||||
<!-- </match> -->
|
||||
|
||||
<!-- Disable ligatures in monospace fonts. -->
|
||||
<match target="font">
|
||||
|
||||
43
nix/configuration/roles/gcloud/default.nix
Normal file
43
nix/configuration/roles/gcloud/default.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
gcloud.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install gcloud.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.gcloud.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
(google-cloud-sdk.withExtraComponents [ google-cloud-sdk.components.gke-gcloud-auth-plugin ])
|
||||
];
|
||||
|
||||
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
{
|
||||
directory = ".config/gcloud";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0700";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
name = Tom Alexander
|
||||
signingkey = D3A179C9A53C0EDE
|
||||
[push]
|
||||
default = simple
|
||||
default = simple # (default since 2.0)
|
||||
[alias]
|
||||
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
|
||||
@@ -12,24 +12,42 @@
|
||||
excludesfile = ~/.gitignore_global
|
||||
[commit]
|
||||
gpgsign = true
|
||||
verbose = true
|
||||
[pull]
|
||||
rebase = true
|
||||
[log]
|
||||
date = local
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
# Use meld for `git difftool` and `git mergetool`
|
||||
[diff]
|
||||
tool = meld
|
||||
tool = meld # Use meld for `git difftool` and `git mergetool`
|
||||
algorithm = histogram
|
||||
colorMoved = plain
|
||||
mnemonicPrefix = true
|
||||
renames = true
|
||||
[difftool]
|
||||
prompt = false
|
||||
[difftool "meld"]
|
||||
cmd = meld "$LOCAL" "$REMOTE"
|
||||
[merge]
|
||||
tool = meld
|
||||
conflictStyle = zdiff3
|
||||
[mergetool "meld"]
|
||||
# Make the middle pane start with partially-merged contents:
|
||||
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
||||
# Make the middle pane start without any merge progress:
|
||||
# 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
|
||||
|
||||
29
nix/configuration/roles/gnuplot/default.nix
Normal file
29
nix/configuration/roles/gnuplot/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
gnuplot.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install gnuplot.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.gnuplot.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnuplot
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -37,6 +37,11 @@
|
||||
xorg.xeyes # to test which windows are using x11
|
||||
];
|
||||
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
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
49
nix/configuration/roles/hydra/default.nix
Normal file
49
nix/configuration/roles/hydra/default.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
hydra.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install hydra.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.hydra.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "http://localhost:3000"; # Externally visible URL
|
||||
notificationSender = "hydra@localhost"; # "From" address for hydra emails.
|
||||
# a standalone Hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
|
||||
buildMachinesFiles = [ ];
|
||||
useSubstitutes = true;
|
||||
};
|
||||
|
||||
# nix.buildMachines = [
|
||||
# {
|
||||
# hostName = "localhost";
|
||||
# protocol = null;
|
||||
# system = "x86_64-linux";
|
||||
# supportedFeatures = [
|
||||
# "kvm"
|
||||
# "nixos-test"
|
||||
# "big-parallel"
|
||||
# "benchmark"
|
||||
# ];
|
||||
# maxJobs = 8;
|
||||
# }
|
||||
# ];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -28,6 +28,21 @@ let
|
||||
alias_klog = pkgs.writeShellScriptBin "klog" ''
|
||||
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
|
||||
{
|
||||
imports = [ ];
|
||||
@@ -55,6 +70,8 @@ in
|
||||
alias_kdel
|
||||
alias_kd
|
||||
alias_klog
|
||||
decrypt_k8s_secret
|
||||
ingress2gateway # Convert ingress yaml to gateway yaml
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
kubectl get secret -o json "${@}" | jq '.data[] |= @base64d | .data'
|
||||
@@ -17,6 +17,8 @@ let
|
||||
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
|
||||
{
|
||||
imports = [ ];
|
||||
@@ -35,6 +37,8 @@ in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
ffmpeg
|
||||
libva-utils # for vainfo
|
||||
vdpauinfo
|
||||
];
|
||||
}
|
||||
(lib.mkIf config.me.graphical {
|
||||
@@ -59,6 +63,21 @@ in
|
||||
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";
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
iwd
|
||||
ldns # for drill
|
||||
arp-scan # To find devices on the network
|
||||
wavemon
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
|
||||
95
nix/configuration/roles/pcsx2/default.nix
Normal file
95
nix/configuration/roles/pcsx2/default.nix
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
104
nix/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
104
nix/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
@@ -0,0 +1,104 @@
|
||||
[UI]
|
||||
SettingsVersion = 1
|
||||
InhibitScreensaver = true
|
||||
ConfirmShutdown = false
|
||||
StartPaused = false
|
||||
PauseOnFocusLoss = true
|
||||
StartFullscreen = true
|
||||
|
||||
|
||||
[Folders]
|
||||
Bios = ../../persist/games/ps2/bios
|
||||
Snapshots = snaps
|
||||
Savestates = sstates
|
||||
MemoryCards = memcards
|
||||
Logs = logs
|
||||
Cheats = cheats
|
||||
Patches = patches
|
||||
UserResources = resources
|
||||
Cache = cache
|
||||
Textures = textures
|
||||
InputProfiles = inputprofiles
|
||||
Videos = videos
|
||||
|
||||
|
||||
[EmuCore/GS]
|
||||
VsyncEnable = true
|
||||
# Internal resolution aspect corrected
|
||||
ScreenshotSize = 1
|
||||
# webp
|
||||
ScreenshotFormat = 2
|
||||
OsdShowFPS = true
|
||||
# Capture video at internal resolution
|
||||
VideoCaptureAutoResolution = true
|
||||
# 2x native resolution
|
||||
upscale_multiplier = 2
|
||||
CaptureContainer = mkv
|
||||
VideoCaptureCodec = av1_vaapi
|
||||
AudioCaptureCodec = flac
|
||||
|
||||
|
||||
[Filenames]
|
||||
BIOS = ps2-0230a-20080220.bin
|
||||
|
||||
[MemoryCards]
|
||||
Slot1_Enable = true
|
||||
Slot1_Filename = Mcd001.ps2
|
||||
Slot2_Enable = true
|
||||
Slot2_Filename = Mcd002.ps2
|
||||
|
||||
|
||||
[InputSources]
|
||||
Keyboard = false
|
||||
Mouse = false
|
||||
SDL = true
|
||||
# Enhanced ps4 and ps5 controller support
|
||||
SDLControllerEnhancedMode = true
|
||||
SDLPS5PlayerLED = true
|
||||
|
||||
|
||||
[Pad1]
|
||||
Type = DualShock2
|
||||
InvertL = 0
|
||||
InvertR = 0
|
||||
Deadzone = 0
|
||||
AxisScale = 1.33
|
||||
LargeMotorScale = 1
|
||||
SmallMotorScale = 1
|
||||
ButtonDeadzone = 0
|
||||
PressureModifier = 0.5
|
||||
Up = SDL-0/DPadUp
|
||||
Right = SDL-0/DPadRight
|
||||
Down = SDL-0/DPadDown
|
||||
Left = SDL-0/DPadLeft
|
||||
Triangle = SDL-0/Y
|
||||
Circle = SDL-0/B
|
||||
Cross = SDL-0/A
|
||||
Square = SDL-0/X
|
||||
Select = SDL-0/Back
|
||||
Start = SDL-0/Start
|
||||
L1 = SDL-0/LeftShoulder
|
||||
L2 = SDL-0/+LeftTrigger
|
||||
R1 = SDL-0/RightShoulder
|
||||
R2 = SDL-0/+RightTrigger
|
||||
L3 = SDL-0/LeftStick
|
||||
R3 = SDL-0/RightStick
|
||||
LUp = SDL-0/-LeftY
|
||||
LRight = SDL-0/+LeftX
|
||||
LDown = SDL-0/+LeftY
|
||||
LLeft = SDL-0/-LeftX
|
||||
RUp = SDL-0/-RightY
|
||||
RRight = SDL-0/+RightX
|
||||
RDown = SDL-0/+RightY
|
||||
RLeft = SDL-0/-RightX
|
||||
Analog = SDL-0/Guide
|
||||
LargeMotor = SDL-0/LargeMotor
|
||||
SmallMotor = SDL-0/SmallMotor
|
||||
|
||||
|
||||
[AutoUpdater]
|
||||
CheckAtStartup = false
|
||||
|
||||
|
||||
[GameList]
|
||||
RecursivePaths = /home/talexander/persist/games/ps2/roms
|
||||
@@ -1,3 +1,6 @@
|
||||
# MANUAL: rustup target add x86_64-unknown-linux-musl
|
||||
# MANUAL: rustup target add wasm32-unknown-unknown
|
||||
# MANUAL: rustup component add rustc-codegen-cranelift
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
@@ -5,6 +8,21 @@
|
||||
...
|
||||
}:
|
||||
|
||||
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 = [ ];
|
||||
|
||||
@@ -24,7 +42,6 @@
|
||||
rustup
|
||||
lldb # for lldb-vscode
|
||||
musl # for building static binaries
|
||||
rust-analyzer
|
||||
cargo-semver-checks
|
||||
# ? cargo-bloat
|
||||
# ? cargo-outdated
|
||||
@@ -38,17 +55,89 @@
|
||||
".cargo/config.toml" = {
|
||||
source = ./files/cargo_config.toml;
|
||||
};
|
||||
# # TODO: Figure out what to do with credentials.
|
||||
# ".cargo/credentials.toml" = {
|
||||
# source = ./files/cargo_credentials.toml;
|
||||
# };
|
||||
".rustup/settings.toml" = {
|
||||
source = ./files/rustup_settings.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 rust targets x86_64-unknown-linux-musl and wasm32-unknown-unknown
|
||||
|
||||
5
nix/configuration/roles/rust/files/rustup_settings.toml
Normal file
5
nix/configuration/roles/rust/files/rustup_settings.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
default_toolchain = "nightly-x86_64-unknown-linux-gnu"
|
||||
profile = "default"
|
||||
version = "12"
|
||||
|
||||
[overrides]
|
||||
51
nix/configuration/roles/shikane/default.nix
Normal file
51
nix/configuration/roles/shikane/default.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
17
nix/configuration/roles/shikane/files/config.toml
Normal file
17
nix/configuration/roles/shikane/files/config.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
[[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"]
|
||||
29
nix/configuration/roles/sops/default.nix
Normal file
29
nix/configuration/roles/sops/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
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.
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -19,5 +19,27 @@
|
||||
".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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
38
nix/configuration/roles/ssh/files/ssh_config
Normal file
38
nix/configuration/roles/ssh/files/ssh_config
Normal file
@@ -0,0 +1,38 @@
|
||||
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
|
||||
9
nix/configuration/roles/ssh/files/ssh_config_root
Normal file
9
nix/configuration/roles/ssh/files/ssh_config_root
Normal file
@@ -0,0 +1,9 @@
|
||||
Host hydra
|
||||
HostName ns1.fizz.buzz
|
||||
Port 65122
|
||||
User talexander
|
||||
IdentitiesOnly yes
|
||||
IdentityFile /persist/manual/ssh/root/keys/id_ed25519
|
||||
|
||||
Host *
|
||||
Compression yes
|
||||
29
nix/configuration/roles/steam_run_free/default.nix
Normal file
29
nix/configuration/roles/steam_run_free/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ let
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
makoctl set-mode do-not-disturb
|
||||
makoctl mode -s do-not-disturb
|
||||
|
||||
swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 2
|
||||
'';
|
||||
@@ -250,7 +250,7 @@ let
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "''${BASH_SOURCE [ 0 ]}" )" && pwd )"
|
||||
|
||||
makoctl set-mode default
|
||||
makoctl mode -s default
|
||||
|
||||
swaymsg output "'Dell Inc. DELL U3014 P1V6N35M329L'" scale 1
|
||||
'';
|
||||
|
||||
29
nix/configuration/roles/tekton/default.nix
Normal file
29
nix/configuration/roles/tekton/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -48,6 +48,12 @@ 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.
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-unoptimized,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
wabt
|
||||
wasm-bindgen-cli
|
||||
binaryen # for wasm-opt
|
||||
pkgs-unoptimized.binaryen # for wasm-opt
|
||||
];
|
||||
}
|
||||
]
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
|
||||
tooltip {
|
||||
/* CSS for hover menu */
|
||||
background-color: #323232;
|
||||
}
|
||||
|
||||
@@ -183,7 +184,23 @@ tooltip {
|
||||
}
|
||||
|
||||
#tray {
|
||||
/* No styles */
|
||||
/* CSS rules for the tray (not the right-click or hover menu) */
|
||||
}
|
||||
|
||||
/* #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 {
|
||||
|
||||
101
nix/steam_deck/configuration/flake.lock
generated
Normal file
101
nix/steam_deck/configuration/flake.lock
generated
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
51
nix/steam_deck/configuration/flake.nix
Normal file
51
nix/steam_deck/configuration/flake.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
# 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
61
nix/steam_deck/configuration/home.nix
Normal file
61
nix/steam_deck/configuration/home.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
# TODO: Optimize for znver2
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
nixgl,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./roles/2ship2harkinian
|
||||
./roles/ares
|
||||
./roles/dolphin
|
||||
./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;
|
||||
# };
|
||||
}
|
||||
25
nix/steam_deck/configuration/hosts/deck/default.nix
Normal file
25
nix/steam_deck/configuration/hosts/deck/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
me.ares.enable = true;
|
||||
me.dolphin.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;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
{
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"CVars": {
|
||||
"gInterpolationFPS": 60,
|
||||
"gEnhancements": {
|
||||
"Graphics": {
|
||||
"AuthenticLogo": 1
|
||||
}
|
||||
},
|
||||
"gSettings": {
|
||||
"InternalResolution": 2.0,
|
||||
"MSAAValue": 2,
|
||||
"OpenMenuBar": 0
|
||||
}
|
||||
},
|
||||
"Window": {
|
||||
"Fullscreen": {
|
||||
"Enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
86
nix/steam_deck/configuration/roles/ares/default.nix
Normal file
86
nix/steam_deck/configuration/roles/ares/default.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
418
nix/steam_deck/configuration/roles/ares/files/settings.bml
Normal file
418
nix/steam_deck/configuration/roles/ares/files/settings.bml
Normal file
@@ -0,0 +1,418 @@
|
||||
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
|
||||
30
nix/steam_deck/configuration/roles/blank/default.nix
Normal file
30
nix/steam_deck/configuration/roles/blank/default.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
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 {
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
103
nix/steam_deck/configuration/roles/dolphin/default.nix
Normal file
103
nix/steam_deck/configuration/roles/dolphin/default.nix
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
25
nix/steam_deck/configuration/roles/dolphin/files/Dolphin.ini
Normal file
25
nix/steam_deck/configuration/roles/dolphin/files/Dolphin.ini
Normal file
@@ -0,0 +1,25 @@
|
||||
[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
|
||||
@@ -0,0 +1,32 @@
|
||||
[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
|
||||
16
nix/steam_deck/configuration/roles/dolphin/files/GFX.ini
Normal file
16
nix/steam_deck/configuration/roles/dolphin/files/GFX.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
# [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
|
||||
26
nix/steam_deck/configuration/roles/dolphin/files/deck.ini
Normal file
26
nix/steam_deck/configuration/roles/dolphin/files/deck.ini
Normal file
@@ -0,0 +1,26 @@
|
||||
[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`
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
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).";
|
||||
};
|
||||
};
|
||||
}
|
||||
43
nix/steam_deck/configuration/roles/graphics/default.nix
Normal file
43
nix/steam_deck/configuration/roles/graphics/default.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
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
|
||||
# ];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
87
nix/steam_deck/configuration/roles/pcsx2/default.nix
Normal file
87
nix/steam_deck/configuration/roles/pcsx2/default.nix
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
steam_pcsx2 = pkgs.writeScriptBin "steam_pcsx2" ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.pcsx2}/bin/pcsx2-qt "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
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 {
|
||||
home.packages = with pkgs; [
|
||||
pcsx2
|
||||
steam_pcsx2
|
||||
];
|
||||
|
||||
home.file.".config/PCSX2/inis/PCSX2.ini" = {
|
||||
source = ./files/PCSX2.ini;
|
||||
};
|
||||
|
||||
me.persist.directories = [ ".config/PCSX2/memcards" ];
|
||||
me.state.directories = [
|
||||
".config/PCSX2/cache"
|
||||
".config/PCSX2/sstates"
|
||||
".config/PCSX2/snaps"
|
||||
".config/PCSX2/covers"
|
||||
".config/PCSX2/videos"
|
||||
];
|
||||
|
||||
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.pcsx2 [
|
||||
"-march=znver2"
|
||||
"-mtune=znver2"
|
||||
])
|
||||
else
|
||||
prev.pcsx2;
|
||||
in
|
||||
{
|
||||
pcsx2 = pkgs.buildEnv {
|
||||
name = prev.pcsx2.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/PCSX2.desktop
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
104
nix/steam_deck/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
104
nix/steam_deck/configuration/roles/pcsx2/files/PCSX2.ini
Normal file
@@ -0,0 +1,104 @@
|
||||
[UI]
|
||||
SettingsVersion = 1
|
||||
InhibitScreensaver = true
|
||||
ConfirmShutdown = false
|
||||
StartPaused = false
|
||||
PauseOnFocusLoss = true
|
||||
StartFullscreen = true
|
||||
|
||||
|
||||
[Folders]
|
||||
Bios = ../../.persist/manual/games/sony_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 = false
|
||||
# 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/deck/.persist/manual/games/sony_ps2/roms
|
||||
86
nix/steam_deck/configuration/roles/rpcs3/default.nix
Normal file
86
nix/steam_deck/configuration/roles/rpcs3/default.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
steam_rpcs3 = pkgs.writeScriptBin "steam_rpcs3" ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.rpcs3}/bin/rpcs3 "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
rpcs3.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install rpcs3.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.rpcs3.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
home.packages = with pkgs; [
|
||||
rpcs3
|
||||
steam_rpcs3
|
||||
];
|
||||
|
||||
# .config/rpcs3/config.yml
|
||||
# .config/rpcs3/GuiConfigs/CurrentSettings.ini
|
||||
|
||||
me.persist.directories = [
|
||||
".config/rpcs3/dev_hdd0"
|
||||
".config/rpcs3/dev_hdd1"
|
||||
".config/rpcs3/savestates"
|
||||
".config/rpcs3/dev_usb000"
|
||||
".config/rpcs3/dev_flash" # Seems to be where the firmware is installed.
|
||||
];
|
||||
me.state.directories = [ ".cache/rpcs3" ];
|
||||
|
||||
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.rpcs3 [
|
||||
"-march=znver2"
|
||||
"-mtune=znver2"
|
||||
])
|
||||
else
|
||||
prev.rpcs3;
|
||||
in
|
||||
{
|
||||
rpcs3 = pkgs.buildEnv {
|
||||
name = prev.rpcs3.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/rpcs3.desktop
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
39
nix/steam_deck/configuration/roles/ryujinx/default.nix
Normal file
39
nix/steam_deck/configuration/roles/ryujinx/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
ryujinx.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install ryujinx.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.ryujinx.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
# This needs to be read-write so we use me.copy.file to copy the file.
|
||||
me.copy.file.".config/Ryujinx/Config.json" = {
|
||||
source = ./files/Config.json;
|
||||
mode = "0644";
|
||||
};
|
||||
|
||||
me.persist.directories = [
|
||||
".config/Ryujinx/bis"
|
||||
".config/Ryujinx/games"
|
||||
".config/Ryujinx/sdcard"
|
||||
".config/Ryujinx/system"
|
||||
];
|
||||
me.state.directories = [ ];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
174
nix/steam_deck/configuration/roles/ryujinx/files/Config.json
Normal file
174
nix/steam_deck/configuration/roles/ryujinx/files/Config.json
Normal file
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"version": 51,
|
||||
"enable_file_log": true,
|
||||
"backend_threading": "Auto",
|
||||
"res_scale": 1,
|
||||
"res_scale_custom": 1,
|
||||
"max_anisotropy": -1,
|
||||
"aspect_ratio": "Fixed16x9",
|
||||
"anti_aliasing": "None",
|
||||
"scaling_filter": "Bilinear",
|
||||
"scaling_filter_level": 80,
|
||||
"graphics_shaders_dump_path": "",
|
||||
"logging_enable_debug": false,
|
||||
"logging_enable_stub": true,
|
||||
"logging_enable_info": true,
|
||||
"logging_enable_warn": true,
|
||||
"logging_enable_error": true,
|
||||
"logging_enable_trace": false,
|
||||
"logging_enable_guest": true,
|
||||
"logging_enable_fs_access_log": false,
|
||||
"logging_filtered_classes": [],
|
||||
"logging_graphics_debug_level": "None",
|
||||
"system_language": "AmericanEnglish",
|
||||
"system_region": "USA",
|
||||
"system_time_zone": "UTC",
|
||||
"system_time_offset": -187,
|
||||
"docked_mode": true,
|
||||
"enable_discord_integration": false,
|
||||
"check_updates_on_start": false,
|
||||
"show_confirm_exit": false,
|
||||
"remember_window_state": true,
|
||||
"enable_hardware_acceleration": true,
|
||||
"hide_cursor": 1,
|
||||
"enable_vsync": true,
|
||||
"enable_shader_cache": true,
|
||||
"enable_texture_recompression": false,
|
||||
"enable_macro_hle": true,
|
||||
"enable_color_space_passthrough": false,
|
||||
"enable_ptc": true,
|
||||
"enable_internet_access": false,
|
||||
"enable_fs_integrity_checks": true,
|
||||
"fs_global_access_log_mode": 0,
|
||||
"audio_backend": "SDL2",
|
||||
"audio_volume": 1,
|
||||
"memory_manager_mode": "HostMappedUnsafe",
|
||||
"expand_ram": false,
|
||||
"ignore_missing_services": false,
|
||||
"gui_columns": {
|
||||
"fav_column": true,
|
||||
"icon_column": true,
|
||||
"app_column": true,
|
||||
"dev_column": true,
|
||||
"version_column": true,
|
||||
"time_played_column": true,
|
||||
"last_played_column": true,
|
||||
"file_ext_column": true,
|
||||
"file_size_column": true,
|
||||
"path_column": true
|
||||
},
|
||||
"column_sort": {
|
||||
"sort_column_id": 0,
|
||||
"sort_ascending": false
|
||||
},
|
||||
"game_dirs": [
|
||||
"/home/deck/.persist/manual/games/nintendo_switch/roms/ryujinx"
|
||||
],
|
||||
"shown_file_types": {
|
||||
"nsp": true,
|
||||
"pfs0": true,
|
||||
"xci": true,
|
||||
"nca": true,
|
||||
"nro": true,
|
||||
"nso": true
|
||||
},
|
||||
"window_startup": {
|
||||
"window_size_width": 1280,
|
||||
"window_size_height": 800,
|
||||
"window_position_x": 0,
|
||||
"window_position_y": 0,
|
||||
"window_maximized": false
|
||||
},
|
||||
"language_code": "en_US",
|
||||
"enable_custom_theme": true,
|
||||
"custom_theme_path": "",
|
||||
"base_style": "Dark",
|
||||
"game_list_view_mode": 0,
|
||||
"show_names": true,
|
||||
"grid_size": 2,
|
||||
"application_sort": 0,
|
||||
"is_ascending_order": true,
|
||||
"start_fullscreen": false,
|
||||
"show_console": true,
|
||||
"enable_keyboard": false,
|
||||
"enable_mouse": false,
|
||||
"hotkeys": {
|
||||
"toggle_vsync": "F1",
|
||||
"screenshot": "F8",
|
||||
"show_ui": "F4",
|
||||
"pause": "F5",
|
||||
"toggle_mute": "F2",
|
||||
"res_scale_up": "Unbound",
|
||||
"res_scale_down": "Unbound",
|
||||
"volume_up": "Unbound",
|
||||
"volume_down": "Unbound"
|
||||
},
|
||||
"keyboard_config": [],
|
||||
"controller_config": [],
|
||||
"input_config": [
|
||||
{
|
||||
"left_joycon_stick": {
|
||||
"joystick": "Left",
|
||||
"invert_stick_x": false,
|
||||
"invert_stick_y": false,
|
||||
"rotate90_cw": false,
|
||||
"stick_button": "LeftStick"
|
||||
},
|
||||
"right_joycon_stick": {
|
||||
"joystick": "Right",
|
||||
"invert_stick_x": false,
|
||||
"invert_stick_y": false,
|
||||
"rotate90_cw": false,
|
||||
"stick_button": "RightStick"
|
||||
},
|
||||
"deadzone_left": 0.1,
|
||||
"deadzone_right": 0.1,
|
||||
"range_left": 1,
|
||||
"range_right": 1,
|
||||
"trigger_threshold": 0.5,
|
||||
"motion": {
|
||||
"motion_backend": "GamepadDriver",
|
||||
"sensitivity": 100,
|
||||
"gyro_deadzone": 1,
|
||||
"enable_motion": true
|
||||
},
|
||||
"rumble": {
|
||||
"strong_rumble": 1,
|
||||
"weak_rumble": 1,
|
||||
"enable_rumble": true
|
||||
},
|
||||
"left_joycon": {
|
||||
"button_minus": "Back",
|
||||
"button_l": "LeftShoulder",
|
||||
"button_zl": "LeftTrigger",
|
||||
"button_sl": "Unbound",
|
||||
"button_sr": "Unbound",
|
||||
"dpad_up": "DpadUp",
|
||||
"dpad_down": "DpadDown",
|
||||
"dpad_left": "DpadLeft",
|
||||
"dpad_right": "DpadRight"
|
||||
},
|
||||
"right_joycon": {
|
||||
"button_plus": "Start",
|
||||
"button_r": "RightShoulder",
|
||||
"button_zr": "RightTrigger",
|
||||
"button_sl": "Unbound",
|
||||
"button_sr": "Unbound",
|
||||
"button_x": "X",
|
||||
"button_b": "B",
|
||||
"button_y": "Y",
|
||||
"button_a": "A"
|
||||
},
|
||||
"version": 1,
|
||||
"backend": "GamepadSDL2",
|
||||
"id": "0-f6790003-28de-0000-ff11-000001000000",
|
||||
"controller_type": "ProController",
|
||||
"player_index": "Player1"
|
||||
}
|
||||
],
|
||||
"graphics_backend": "Vulkan",
|
||||
"preferred_gpu": "0x1002_0x163F",
|
||||
"multiplayer_mode": 0,
|
||||
"multiplayer_lan_interface_id": "0",
|
||||
"use_hypervisor": true
|
||||
}
|
||||
89
nix/steam_deck/configuration/roles/shipwright/default.nix
Normal file
89
nix/steam_deck/configuration/roles/shipwright/default.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
steam_shipwright = pkgs.writeScriptBin "steam_soh" ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.shipwright}/bin/soh "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
shipwright.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install shipwright.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.shipwright.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
allowedUnfree = [ "shipwright" ];
|
||||
}
|
||||
(lib.mkIf config.me.graphical {
|
||||
home.packages = with pkgs; [
|
||||
shipwright
|
||||
steam_shipwright
|
||||
];
|
||||
|
||||
home.file.".local/share/soh/shipofharkinian.json" = {
|
||||
source = ./files/shipofharkinian.json;
|
||||
};
|
||||
|
||||
me.persist.directories = [ ".local/share/soh/Save" ];
|
||||
home.persistence."/home/deck/.state" = {
|
||||
files = [
|
||||
".local/share/soh/oot.otr"
|
||||
];
|
||||
};
|
||||
|
||||
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.shipwright [
|
||||
"-march=znver2"
|
||||
"-mtune=znver2"
|
||||
])
|
||||
else
|
||||
prev.shipwright;
|
||||
in
|
||||
{
|
||||
shipwright = pkgs.buildEnv {
|
||||
name = prev.shipwright.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/soh.desktop
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"CVars": {
|
||||
"gAuthenticLogo": 1,
|
||||
"gInternalResolution": 2.0,
|
||||
"gInterpolationFPS": 60,
|
||||
"gMSAAValue": 2,
|
||||
"gMatchRefreshRate": 1,
|
||||
"gOnFileSelectNameEntry": 0,
|
||||
"gOpenWindows": {
|
||||
"modalWindowEnabled": 1
|
||||
},
|
||||
"gZFightingMode": 0
|
||||
},
|
||||
"ConfigVersion": 2,
|
||||
"Window": {
|
||||
"Fullscreen": {
|
||||
"Enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
109
nix/steam_deck/configuration/roles/sm64ex/default.nix
Normal file
109
nix/steam_deck/configuration/roles/sm64ex/default.nix
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
steam_sm64ex = pkgs.writeScriptBin "steam_sm64ex" ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.sm64ex}/bin/sm64ex "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
sm64ex.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install sm64ex.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.sm64ex.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
allowedUnfree = [ "sm64ex" ];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
sm64ex
|
||||
steam_sm64ex
|
||||
];
|
||||
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# sm4ex = prev.sm64ex.override {
|
||||
# baseRom.name = "SuperMario64.z64";
|
||||
# };
|
||||
# })
|
||||
# ];
|
||||
|
||||
home.file.".local/share/sm64ex/sm64config.txt" = {
|
||||
source = ./files/sm64config.txt;
|
||||
};
|
||||
|
||||
home.persistence."/home/deck/.persist" = {
|
||||
files = [
|
||||
".local/share/sm64ex/sm64_save_file.bin"
|
||||
];
|
||||
};
|
||||
|
||||
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.sm64ex [
|
||||
"-march=znver2"
|
||||
"-mtune=znver2"
|
||||
])
|
||||
else
|
||||
prev.sm64ex;
|
||||
in
|
||||
{
|
||||
sm64ex =
|
||||
let
|
||||
desktop_item = pkgs.makeDesktopItem {
|
||||
name = "sm64ex";
|
||||
desktopName = "Super Mario 64";
|
||||
comment = "A PC Port of Super Mario 64.";
|
||||
categories = [
|
||||
"Game"
|
||||
];
|
||||
icon = "sm64ex";
|
||||
type = "Application";
|
||||
exec = "sm64ex";
|
||||
};
|
||||
in
|
||||
pkgs.buildEnv {
|
||||
name = prev.sm64ex.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 = ''
|
||||
install -m 555 -D "${desktop_item}/share/applications/"* -t $out/share/applications/
|
||||
install -m 444 -D "${./files/icon.png}" $out/share/pixmaps/sm64ex.png
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
fullscreen true
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
stdenv,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
package = (pkgs.callPackage ./package.nix { });
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
steam_rom_manager.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install steam_rom_manager.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.steam_rom_manager.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
home.packages = with pkgs; [
|
||||
package
|
||||
];
|
||||
|
||||
me.persist.directories = [ ".config/steam-rom-manager/userData" ];
|
||||
|
||||
home.persistence."/home/deck/.persist" = {
|
||||
directories = [
|
||||
{
|
||||
directory = ".config/steam-rom-manager/userData";
|
||||
method = "symlink";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# TODO: Install a fully configured /home/deck/.persist/.config/steam-rom-manager/userData/userConfigurations.json (which contains the parser definitions) and /home/deck/.persist/.config/steam-rom-manager/userData/userSettings.json (which contains the applications settings like steam directory).
|
||||
# TODO: Maybe only persist /home/deck/.persist/.config/steam-rom-manager/userData/artworkBackups and /home/deck/.persist/.config/steam-rom-manager/userData/artworkCache.json after the parser config is being installed.
|
||||
|
||||
# home.persistence."/home/deck/.state" = {
|
||||
# files = [
|
||||
# ".config/steam-rom-manager/userData/configPresets.json"
|
||||
# ];
|
||||
# };
|
||||
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
pkgs,
|
||||
makeDesktopItem,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.5.29";
|
||||
icon = pkgs.fetchurl {
|
||||
url = "https://github.com/SteamGridDB/steam-rom-manager/blob/master/src/assets/icons/512x512.png?raw=true";
|
||||
hash = "sha256-Nx29nJ2+44AYrTLP+CNmDJFAf2sjrH7sfYhg9fJx2qo=";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "steam-rom-manager";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/SteamGridDB/steam-rom-manager/releases/download/v${version}/Steam-ROM-Manager-${version}.AppImage";
|
||||
hash = "sha256-6ZJ+MGIgr2osuQuqD6N9NnPiJFNq/HW6ivG8tyXUhvs=";
|
||||
};
|
||||
phases = [
|
||||
"installPhase"
|
||||
];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install --mode=0755 $src $out/bin/steam-rom-manager
|
||||
runHook postInstall
|
||||
'';
|
||||
# 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.
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/{applications,pixmaps}
|
||||
install -m 555 -D "$desktopItem/share/applications/"* -t $out/share/applications/
|
||||
install -m 444 -D "${icon}" $out/share/pixmaps/steamrommanager.png
|
||||
'';
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "steam-rom-manager";
|
||||
desktopName = "Steam Rom Manager";
|
||||
comment = "Manage additional entries in the Steam launcher.";
|
||||
categories = [
|
||||
"Application"
|
||||
"Utility"
|
||||
];
|
||||
icon = "steamrommanager";
|
||||
type = "Application";
|
||||
exec = "steam-rom-manager";
|
||||
};
|
||||
}
|
||||
41
nix/steam_deck/configuration/roles/yuzu/default.nix
Normal file
41
nix/steam_deck/configuration/roles/yuzu/default.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
yuzu.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install yuzu.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.yuzu.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
home.file.".config/yuzu/qt-config.ini" = {
|
||||
source = ./files/qt-config.ini;
|
||||
};
|
||||
home.file.".config/yuzu/input/deck.ini" = {
|
||||
source = ./files/deck.ini;
|
||||
};
|
||||
|
||||
me.persist.directories = [
|
||||
".local/share/yuzu/nand"
|
||||
".local/share/yuzu/sdmc" # SD Card
|
||||
".local/share/yuzu/screenshots"
|
||||
".local/share/yuzu/keys"
|
||||
".config/yuzu/custom" # Per-game configs
|
||||
];
|
||||
me.state.directories = [ ".local/share/yuzu/shader" ];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
55
nix/steam_deck/configuration/roles/yuzu/files/deck.ini
Normal file
55
nix/steam_deck/configuration/roles/yuzu/files/deck.ini
Normal file
@@ -0,0 +1,55 @@
|
||||
[Controls]
|
||||
type\default=true
|
||||
type=0
|
||||
button_a\default=false
|
||||
button_a="pad:0,button:0,port:0,guid:03000000de280000ff11000001000000,engine:sdl"
|
||||
button_b\default=false
|
||||
button_b="pad:0,button:1,port:0,guid:03000000de280000ff11000001000000,engine:sdl"
|
||||
button_x\default=false
|
||||
button_x="pad:0,button:2,port:0,guid:03000000de280000ff11000001000000,engine:sdl"
|
||||
button_y\default=false
|
||||
button_y="pad:0,button:3,port:0,guid:03000000de280000ff11000001000000,engine:sdl"
|
||||
button_lstick\default=false
|
||||
button_lstick="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:9"
|
||||
button_rstick\default=false
|
||||
button_rstick="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:10"
|
||||
button_l\default=false
|
||||
button_l="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:4"
|
||||
button_r\default=false
|
||||
button_r="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:5"
|
||||
button_zl\default=false
|
||||
button_zl="engine:sdl,invert:+,port:0,guid:03000000de280000ff11000001000000,axis:2,threshold:0.500000"
|
||||
button_zr\default=false
|
||||
button_zr="engine:sdl,invert:+,port:0,guid:03000000de280000ff11000001000000,axis:5,threshold:0.500000"
|
||||
button_plus\default=false
|
||||
button_plus="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:7"
|
||||
button_minus\default=false
|
||||
button_minus="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:6"
|
||||
button_dleft\default=false
|
||||
button_dleft="engine:sdl,port:0,guid:03000000de280000ff11000001000000,direction:left,hat:0"
|
||||
button_dup\default=false
|
||||
button_dup="engine:sdl,port:0,guid:03000000de280000ff11000001000000,direction:up,hat:0"
|
||||
button_dright\default=false
|
||||
button_dright="engine:sdl,port:0,guid:03000000de280000ff11000001000000,direction:right,hat:0"
|
||||
button_ddown\default=false
|
||||
button_ddown="engine:sdl,port:0,guid:03000000de280000ff11000001000000,direction:down,hat:0"
|
||||
button_slleft\default=false
|
||||
button_slleft="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:4"
|
||||
button_srleft\default=false
|
||||
button_srleft="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:5"
|
||||
button_home\default=false
|
||||
button_home="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:8"
|
||||
button_screenshot\default=false
|
||||
button_screenshot=[empty]
|
||||
button_slright\default=false
|
||||
button_slright="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:4"
|
||||
button_srright\default=false
|
||||
button_srright="engine:sdl,port:0,guid:03000000de280000ff11000001000000,button:5"
|
||||
lstick\default=false
|
||||
lstick="deadzone:0.150000,engine:sdl,port:0,guid:03000000de280000ff11000001000000,axis_x:0,offset_x:-0.001556,axis_y:1,offset_y:-0.013184,invert_x:+,invert_y:+"
|
||||
rstick\default=false
|
||||
rstick="deadzone:0.150000,engine:sdl,port:0,guid:03000000de280000ff11000001000000,axis_x:3,offset_x:-0.001190,axis_y:4,offset_y:-0.010468,invert_x:+,invert_y:+"
|
||||
motionleft\default=false
|
||||
motionleft=[empty]
|
||||
motionright\default=false
|
||||
motionright=[empty]
|
||||
1442
nix/steam_deck/configuration/roles/yuzu/files/qt-config.ini
Normal file
1442
nix/steam_deck/configuration/roles/yuzu/files/qt-config.ini
Normal file
File diff suppressed because it is too large
Load Diff
101
nix/steam_deck/configuration/util/copy_files/default.nix
Normal file
101
nix/steam_deck/configuration/util/copy_files/default.nix
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
filter
|
||||
attrNames
|
||||
;
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
copy.file = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
defaultText = "me.copy.file.‹name›.enable";
|
||||
example = false;
|
||||
description = "Whether we want to copy this file.";
|
||||
};
|
||||
mode = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "0444";
|
||||
defaultText = "me.copy.file.‹name›.mode";
|
||||
example = "0750";
|
||||
description = "The read, write, execute permission flags.";
|
||||
};
|
||||
source = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
defaultText = "me.copy.file.‹name›.source";
|
||||
example = ./files/foo.txt;
|
||||
description = "The source file to copy into the destination.";
|
||||
};
|
||||
target = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
defaultText = "me.copy.file.‹name›.target";
|
||||
example = ".local/share/foo/bar.txt";
|
||||
description = "The path where the file should be written.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
target = lib.mkDefault name;
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
defaultText = "me.copy.file.‹name›";
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
".config/foo/bar.txt" = {
|
||||
source = ./files/bar.txt
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.me.copy.file != { }) (
|
||||
let
|
||||
cfg = config.me.copy.file;
|
||||
copy_file_targets = filter (target: config.me.copy.file."${target}".enable) (attrNames cfg);
|
||||
in
|
||||
{
|
||||
home.activation = {
|
||||
copyFiles = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
let
|
||||
copy_commands = builtins.map (
|
||||
target:
|
||||
let
|
||||
target_config = config.me.copy.file."${target}";
|
||||
source = lib.strings.escapeShellArg "${target_config.source}";
|
||||
destination = lib.strings.escapeShellArg target;
|
||||
mode = lib.strings.escapeShellArg "${target_config.mode}";
|
||||
in
|
||||
# $DRY_RUN_CMD ${pkgs.toyboy}/bin/install $VERBOSE_ARG -D -m ${mode} ${source} ${destination}
|
||||
''
|
||||
$DRY_RUN_CMD install $VERBOSE_ARG -D --compare -m ${mode} ${source} ${destination}
|
||||
''
|
||||
) copy_file_targets;
|
||||
in
|
||||
(lib.strings.concatStringsSep "\n" copy_commands)
|
||||
);
|
||||
};
|
||||
}
|
||||
))
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
persist.directories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ ".local/share/dolphin-emu/Wii" ];
|
||||
description = "List of folders relative to the home directory to persist.";
|
||||
};
|
||||
state.directories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = [ ".local/share/dolphin-emu/Shaders" ];
|
||||
description = "List of folders relative to the home directory to keep as state.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.me.persist.directories != [ ]) {
|
||||
home.persistence."/home/deck/.persist" = {
|
||||
directories = (
|
||||
builtins.map (entry: {
|
||||
directory = entry;
|
||||
method = "symlink";
|
||||
}) config.me.persist.directories
|
||||
);
|
||||
};
|
||||
|
||||
home.activation = {
|
||||
createPersistDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
let
|
||||
dirlist = lib.strings.escapeShellArgs config.me.persist.directories;
|
||||
in
|
||||
''
|
||||
for dir in ${dirlist} ; do
|
||||
if [[ ! -d "$HOME/.persist/$dir" ]]; then
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.persist/$dir"
|
||||
fi
|
||||
done
|
||||
''
|
||||
);
|
||||
};
|
||||
})
|
||||
(lib.mkIf (config.me.state.directories != [ ]) {
|
||||
home.persistence."/home/deck/.state" = {
|
||||
directories = (
|
||||
builtins.map (entry: {
|
||||
directory = entry;
|
||||
method = "symlink";
|
||||
}) config.me.state.directories
|
||||
);
|
||||
};
|
||||
|
||||
home.activation = {
|
||||
createStateDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
let
|
||||
dirlist = lib.strings.escapeShellArgs config.me.state.directories;
|
||||
in
|
||||
''
|
||||
for dir in ${dirlist} ; do
|
||||
if [[ ! -d "$HOME/.state/$dir" ]]; then
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.state/$dir"
|
||||
fi
|
||||
done
|
||||
''
|
||||
);
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (builtins) elem;
|
||||
inherit (lib) getName mkOption;
|
||||
inherit (lib.types) listOf str;
|
||||
in
|
||||
{
|
||||
# Pending https://github.com/NixOS/nixpkgs/issues/55674
|
||||
options.allowedUnfree = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
config.nixpkgs.config.allowUnfreePredicate = p: elem (getName p) config.allowedUnfree;
|
||||
}
|
||||
Reference in New Issue
Block a user