diff --git a/.github/workflows/treefmt.yaml b/.github/workflows/treefmt.yaml index 7c57e85..e2ed4d4 100644 --- a/.github/workflows/treefmt.yaml +++ b/.github/workflows/treefmt.yaml @@ -37,9 +37,7 @@ jobs: - uses: DeterminateSystems/nix-installer-action@v16 - uses: DeterminateSystems/magic-nix-cache-action@v8 - name: Run treefmt - # todo Use when updated to NixOS 24.11. - # run: nix develop --command treefmt --ci - run: nix develop --command treefmt --fail-on-change --no-cache + run: nix develop --command treefmt --ci - uses: reviewdog/action-suggester@v1 with: fail_on_error: true diff --git a/.github/workflows/update-nix-direnv.yaml b/.github/workflows/update-nix-direnv.yaml index a633c9f..c3b4c2f 100644 --- a/.github/workflows/update-nix-direnv.yaml +++ b/.github/workflows/update-nix-direnv.yaml @@ -17,7 +17,7 @@ jobs: - uses: DeterminateSystems/nix-installer-action@v16 - uses: DeterminateSystems/magic-nix-cache-action@v8 - name: Update nix-direnv to the latest version - run: nix run '.#update-nix-direnv' + run: nix run .#update-nix-direnv - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: diff --git a/.github/workflows/update-nixos-release.yaml b/.github/workflows/update-nixos-release.yaml index 2cf6759..fe9cc3d 100644 --- a/.github/workflows/update-nixos-release.yaml +++ b/.github/workflows/update-nixos-release.yaml @@ -2,7 +2,7 @@ name: Update NixOS Release "on": schedule: - - cron: "0 0 15 5,11 *" + - cron: "0 0 15 6,12 *" workflow_dispatch: permissions: @@ -18,7 +18,7 @@ jobs: - uses: DeterminateSystems/magic-nix-cache-action@v8 - name: Update the NixOS release in flake.nix to the latest run: | - nix run '.#update-nixos-release' + nix run .#update-nixos-release if [[ -n $(git status --porcelain=2) ]]; then nix flake update fi diff --git a/.justfile b/.justfile index 34b82a4..9a151c6 100644 --- a/.justfile +++ b/.justfile @@ -54,4 +54,6 @@ alias u := update alias up := update update: + nix run ".#update-nix-direnv" + nix run ".#update-nixos-release" nix flake update diff --git a/.typos.toml b/.typos.toml index c2fed1e..d3c4037 100644 --- a/.typos.toml +++ b/.typos.toml @@ -9,4 +9,5 @@ extend-ignore-re = [ # HDA = "HDA" [default.extend-words] +ALLO = "ALLO" HDA = "HDA" diff --git a/.vscode/settings.json b/.vscode/settings.json index 92b4e3f..13e5b90 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "adoc", + "alnum", "alsa", "audiobooks", "autoconnect", @@ -10,6 +11,7 @@ "bufcount", "bufsize", "cachix", + "ccache", "channelmix", "Colmena", "Digi", @@ -23,6 +25,7 @@ "ifdef", "ifndef", "Jellyfin", + "jsonfmt", "justfile", "jwillikers", "libpipewire", @@ -32,16 +35,23 @@ "mmcblk", "Mopidy", "mpris", + "nixbld", + "nixfmt", "nixos", "nixpkgs", + "NOPASSWD", "Nushell", + "optimise", "patchset", "PDIF", "Piceiver", "Pipewire", + "pkgs", + "poweroff", "prio", "pulseaudio", "RAOP", + "reviewdog", "RTPRIO", "Rygel", "sampleformat", @@ -52,16 +62,29 @@ "SNAPSERVER", "SNMP", "soundcard", + "statix", + "stdenv", "subwoofer", "Tailscale", + "taplo", + "treefmt", "UGREEN", "upmixing", "upstreamed", + "webp", "Wireplumber", "wpctl", "Xtreme", + "yamlfmt", "zstdcat" ], + "files.watcherExclude": { + ".direnv/**": true, + ".lycheecache": true, + ".pre-commit-config.yaml": true, + "result": true, + "result/**": true + }, "nix.enableLanguageServer": true, "nix.serverPath": "nil" } diff --git a/README.adoc b/README.adoc index cc098bc..735daab 100644 --- a/README.adoc +++ b/README.adoc @@ -187,10 +187,43 @@ git clone git@github.com:jwillikers/piceiver.git cd piceiver ---- +. Configure ccache support for Nix. +These instructions are for non-NixOS. +See the https://nixos.wiki/wiki/CCache[NixOS Wiki CCache page] for details, including how to configure ccache for NixOS. + +.. Create the ccache cache directory. ++ +[,sh] +---- +sudo mkdir --mode=0770 --parents /nix/var/cache/ccache +---- + +.. Set ownership of the ccache cache directory. ++ +[,sh] +---- +sudo chown root:nixbld /nix/var/cache/ccache +---- + +.. Configure the ccache directory as an extra sandbox path for Nix. ++ +./etc/nix/nix.conf +[,ini] +---- +extra-sandbox-paths = /nix/var/cache/ccache +---- + +.. Restart the Nix daemon for the change to take effect. ++ +[,sh] +---- +sudo systemctl restart nix-daemon.service +---- + . Build the SD card image. Prefix the command with `systemd-inhibit` to prevent your computer from sleeping. This will take a long time. -Like, days in my case. +Like, [.line-through]#two days# a day in my case. The default, `basic-sd-image` package, produces a minimal image that requires no extra configuration. There is an alternative package, `full-sd-image`, which is more fully-featured, including more integrations, but requires customization and additional set up. + diff --git a/flake.lock b/flake.lock index 1d5265f..0e51a2b 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -102,16 +102,16 @@ ] }, "locked": { - "lastModified": 1731442571, - "narHash": "sha256-meD7dTSYega5Bn8aotouJr2nKDR8gGdWiYmoxhxM81U=", + "lastModified": 1732220584, + "narHash": "sha256-FfHmMF7JGZonJX6PzR653tPKM5Jl4E6k3Em2FqwiCSg=", "owner": "jwillikers", "repo": "home-manager", - "rev": "bd7a589df55862f7cec373cbe293d93cd524736a", + "rev": "678f9f7ded755ca4b11dc345721dbb46d46c2ce6", "type": "github" }, "original": { "owner": "jwillikers", - "ref": "mopidy-fixes", + "ref": "mopidy-fixes-24.11", "repo": "home-manager", "type": "github" } @@ -157,11 +157,11 @@ ] }, "locked": { - "lastModified": 1731209121, - "narHash": "sha256-BF7FBh1hIYPDihdUlImHGsQzaJZVLLfYqfDx41wjuF0=", + "lastModified": 1731814505, + "narHash": "sha256-l9ryrx1Twh08a+gxrMGM9O/aZKEimZfa6sZVyPCImgI=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "896019f04b22ce5db4c0ee4f89978694f44345c3", + "rev": "bdba246946fb079b87b4cada4df9b1cdf1c06132", "type": "github" }, "original": { @@ -178,7 +178,6 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-unstable": "nixpkgs-unstable", "pre-commit-hooks": [ "pre-commit-hooks" ], @@ -187,11 +186,11 @@ ] }, "locked": { - "lastModified": 1730742759, - "narHash": "sha256-QOhHyeVqUVl1R72O5S81l1MziNJsntqhIDolF/MoBhk=", + "lastModified": 1732024592, + "narHash": "sha256-PdKTsenC0fKBDjG+oKyH5tKK0AcSznpQgI2jCkYkelc=", "owner": "jwillikers", "repo": "nix-update-scripts", - "rev": "c11269c8aede98ee8d5a4fbb65c578506616749b", + "rev": "a5469018108ca16fac1ba9588f54ca403e7e4f53", "type": "github" }, "original": { @@ -202,43 +201,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731239293, - "narHash": "sha256-q2yjIWFFcTzp5REWQUOU9L6kHdCDmFDpqeix86SOvDc=", + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-unstable": { "locked": { - "lastModified": 1730200266, - "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable_2": { - "locked": { - "lastModified": 1731139594, - "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { @@ -260,11 +243,11 @@ ] }, "locked": { - "lastModified": 1731363552, - "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "lastModified": 1732021966, + "narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "rev": "3308484d1a443fc5bc92012435d79e80458fe43c", "type": "github" }, "original": { @@ -289,11 +272,11 @@ "u-boot-src": "u-boot-src" }, "locked": { - "lastModified": 1730778617, - "narHash": "sha256-DzqHK+JpH+uqXIuq7QM+GU5g4Z6H6ne1tVKMqBYj0g4=", + "lastModified": 1731941843, + "narHash": "sha256-/QG4C9WVP79A7jRFC3Ci1q1l6ah7gr3/SF/MWUk/hhM=", "owner": "nix-community", "repo": "raspberry-pi-nix", - "rev": "57e8e8e84221c0f89d50a871ce1705e345fd7912", + "rev": "aaec735faf81ff05356d65c7408136d2c1522d34", "type": "github" }, "original": { @@ -310,7 +293,7 @@ "nix-index-database": "nix-index-database", "nix-update-scripts": "nix-update-scripts", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable_2", + "nixpkgs-unstable": "nixpkgs-unstable", "pre-commit-hooks": "pre-commit-hooks", "raspberry-pi-nix": "raspberry-pi-nix", "treefmt-nix": "treefmt-nix" @@ -440,11 +423,11 @@ ] }, "locked": { - "lastModified": 1730321837, - "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "lastModified": 1732292307, + "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "rev": "705df92694af7093dfbb27109ce16d828a79155f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index fc788af..10f70fb 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ home-manager = { # todo Use upstream when my fixes get merged for cross-compiling Mopidy with plugins. # url = "github:nix-community/home-manager/release-24.05"; - url = "github:jwillikers/home-manager/mopidy-fixes"; + url = "github:jwillikers/home-manager/mopidy-fixes-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; # todo This is probably unnecessary here. @@ -44,7 +44,7 @@ treefmt-nix.follows = "treefmt-nix"; }; }; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; @@ -95,9 +95,9 @@ overlays = import ./overlays { inherit inputs; }; overlaysList = with overlays; [ additions - headless - mopidy-pipewire-gstreamer-plugin - rygel-pipewire-gstreamer-plugin + ccache + modifications + allow-missing-modules realtime unstablePackages unstable-shairport-sync @@ -146,8 +146,7 @@ # todo I should add the overlays as an output, but they must be outside eachDefaultSystem. # inherit overlays; apps = { - inherit (nix-update-scripts.apps.${system}) update-nix-direnv; - inherit (nix-update-scripts.apps.${system}) update-nixos-release; + inherit (nix-update-scripts.apps.${system}) update-nix-direnv update-nixos-release; }; devShells.default = mkShell { inherit (pre-commit) shellHook; @@ -176,6 +175,7 @@ snappellite-sd-image-native = self.nixosConfigurations.snappellite-native.config.system.build.sdImage; }; + # pkgs = pkgsArmCross; } ) // { diff --git a/home-manager/_mixins/services/bluetooth-agent/default.nix b/home-manager/_mixins/services/bluetooth-agent/default.nix index 4f51e6e..d42b07c 100644 --- a/home-manager/_mixins/services/bluetooth-agent/default.nix +++ b/home-manager/_mixins/services/bluetooth-agent/default.nix @@ -23,7 +23,7 @@ lib.mkIf (lib.elem username installFor && role == "piceiver") { ExecStartPre = "${pkgs.bluez}/bin/bluetoothctl discoverable on"; ExecStart = "${pkgs.bluez-tools}/bin/bt-agent --capability=NoInputNoOutput"; RestartSec = 5; - Restart = "always"; + Restart = "on-failure"; KillSignal = "SIGUSR1"; }; Install = { diff --git a/home-manager/_mixins/services/rygel/default.nix b/home-manager/_mixins/services/rygel/default.nix index d3534b3..8f9702d 100644 --- a/home-manager/_mixins/services/rygel/default.nix +++ b/home-manager/_mixins/services/rygel/default.nix @@ -104,8 +104,8 @@ lib.mkIf (lib.elem username installFor && role == "piceiver") { }; Service = { BusName = "org.gnome.Rygel1"; - ExecStart = "${pkgs.gnome.rygel}/bin/rygel"; - Restart = "always"; + ExecStart = "${pkgs.rygel}/bin/rygel"; + Restart = "on-failure"; RestartSec = 10; Type = "dbus"; }; diff --git a/home-manager/_mixins/services/shairport-sync/default.nix b/home-manager/_mixins/services/shairport-sync/default.nix index 814aaba..a2fa23d 100644 --- a/home-manager/_mixins/services/shairport-sync/default.nix +++ b/home-manager/_mixins/services/shairport-sync/default.nix @@ -18,7 +18,7 @@ lib.mkIf (lib.elem username installFor && role == "piceiver") { }; Service = { ExecStart = "${pkgs.nqptp}/bin/nqptp -v"; - Restart = "always"; + Restart = "on-failure"; }; Install = { WantedBy = [ "default.target" ]; @@ -52,7 +52,7 @@ lib.mkIf (lib.elem username installFor && role == "piceiver") { }; Service = { ExecStart = "${pkgs.shairport-sync-airplay-2}/bin/shairport-sync"; - Restart = "always"; + Restart = "on-failure"; RestartSec = 10; }; Install = { @@ -80,7 +80,7 @@ lib.mkIf (lib.elem username installFor && role == "piceiver") { ExecStart = "${pkgs.shairport-sync}/bin/shairport-sync --configfile=${ osConfig.environment.etc."shairport-sync-airplay-1.conf".source }"; - Restart = "always"; + Restart = "on-failure"; RestartSec = 10; }; Install = { diff --git a/home-manager/_mixins/services/snapclient/default.nix b/home-manager/_mixins/services/snapclient/default.nix index e6e75af..475c0a8 100644 --- a/home-manager/_mixins/services/snapclient/default.nix +++ b/home-manager/_mixins/services/snapclient/default.nix @@ -31,7 +31,7 @@ lib.mkIf (lib.elem username installFor) { # The wireplumber-init service ensures the volume is set correctly before playback starts. "wireplumber-init.service" ]; - PartOf = [ "pipewire-pulse.service" ]; + BindsTo = [ "pipewire-pulse.service" ]; Requires = [ "wireplumber-init.service" ]; Wants = [ "pipewire.service" @@ -40,7 +40,7 @@ lib.mkIf (lib.elem username installFor) { }; Service = { ExecStart = "${pkgs.snapcast}/bin/snapclient " + builtins.toString snapcastFlags; - Restart = "always"; + Restart = "on-failure"; RestartSec = 10; }; Install = { diff --git a/nixos/_mixins/features/bluetooth/default.nix b/nixos/_mixins/features/bluetooth/default.nix index 7e36324..3817d5c 100644 --- a/nixos/_mixins/features/bluetooth/default.nix +++ b/nixos/_mixins/features/bluetooth/default.nix @@ -29,7 +29,7 @@ lib.mkIf (role == "piceiver") { hardware = { bluetooth = { enable = true; - package = pkgs.unstable.bluez-experimental; + package = pkgs.bluez-experimental; settings = { General = { DiscoverableTimeout = 300; diff --git a/nixos/_mixins/features/nix/default.nix b/nixos/_mixins/features/nix/default.nix index 33893a3..0c2f8c3 100644 --- a/nixos/_mixins/features/nix/default.nix +++ b/nixos/_mixins/features/nix/default.nix @@ -10,7 +10,14 @@ let in { nix = { + gc = { + automatic = true; + dates = "Mon *-*-* 03:03:00"; + options = "--delete-older-than 30d"; + }; settings = { + accept-flake-config = true; + auto-optimise-store = true; experimental-features = "flakes nix-command"; # Disable global registry flake-registry = ""; diff --git a/nixos/_mixins/services/pipewire/default.nix b/nixos/_mixins/services/pipewire/default.nix index 0084aa2..465115d 100644 --- a/nixos/_mixins/services/pipewire/default.nix +++ b/nixos/_mixins/services/pipewire/default.nix @@ -45,14 +45,12 @@ in }; }; configPackages = lib.optionals (role == "piceiver") [ pkgs.pipewire-config ]; - package = pkgs.unstable.pipewire; pulse.enable = true; socketActivation = false; wireplumber = { configPackages = [ pkgs.wireplumber-optimize-usb-config ] ++ lib.optionals (role == "piceiver") [ pkgs.wireplumber-config ]; - package = pkgs.unstable.wireplumber; }; }; } diff --git a/nixos/_mixins/services/rygel/default.nix b/nixos/_mixins/services/rygel/default.nix index f8e6ad2..93f3e8a 100644 --- a/nixos/_mixins/services/rygel/default.nix +++ b/nixos/_mixins/services/rygel/default.nix @@ -6,10 +6,10 @@ }: lib.mkIf (role == "piceiver") { # todo Make dependencies optional for graphical elements in rygel package? - environment.etc."rygel.conf".source = "${pkgs.gnome.rygel}/etc/rygel.conf"; + environment.etc."rygel.conf".source = "${pkgs.rygel}/etc/rygel.conf"; networking.firewall = { allowedUDPPorts = [ 1900 ]; allowedTCPPorts = [ 1900 ]; }; - services.dbus.packages = [ pkgs.gnome.rygel ]; + services.dbus.packages = [ pkgs.rygel ]; } diff --git a/nixos/_mixins/services/snapserver/default.nix b/nixos/_mixins/services/snapserver/default.nix index 80bac08..f125f68 100644 --- a/nixos/_mixins/services/snapserver/default.nix +++ b/nixos/_mixins/services/snapserver/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, role, ... }: @@ -13,7 +12,7 @@ lib.mkIf (role == "piceiver") { buffer = 300; # Minimum is 20ms, default is 1000ms codec = "pcm"; enable = true; - http.docRoot = pkgs.unstable.snapweb; # todo Remove this in 24.11 where it should be the default. + http.docRoot = null; # pkgs.snapweb fails to cross-compile in 24.11 due to sharp / vips dependencies openFirewall = true; sampleFormat = "48000:16:2"; streams = { diff --git a/nixos/_mixins/services/snmpd/default.nix b/nixos/_mixins/services/snmpd/default.nix index b095265..b559b75 100644 --- a/nixos/_mixins/services/snmpd/default.nix +++ b/nixos/_mixins/services/snmpd/default.nix @@ -11,7 +11,7 @@ serviceConfig = { User = "root"; Group = "root"; - Restart = "always"; + Restart = "on-failure"; ExecStart = "${pkgs.net-snmp}/bin/snmpd -Lf /var/log/snmpd.log -f -c /etc/snmp/snmpd.conf"; }; }; diff --git a/nixos/_mixins/services/tailscale/default.nix b/nixos/_mixins/services/tailscale/default.nix index 3efb573..478cfa7 100644 --- a/nixos/_mixins/services/tailscale/default.nix +++ b/nixos/_mixins/services/tailscale/default.nix @@ -1,10 +1,9 @@ -{ pkgs, username, ... }: +{ username, ... }: { services.tailscale = { enable = true; extraUpFlags = [ "--operator=${username}" ]; extraSetFlags = [ "--operator=${username}" ]; openFirewall = true; - package = pkgs.unstable.tailscale; }; } diff --git a/nixos/default.nix b/nixos/default.nix index 0d6ae4c..bd5099b 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -16,6 +16,7 @@ inputs.home-manager.nixosModules.home-manager inputs.nix-index-database.nixosModules.nix-index inputs.raspberry-pi-nix.nixosModules.raspberry-pi + inputs.raspberry-pi-nix.nixosModules.sd-image # inputs.sops-nix.nixosModules.sops (modulesPath + "/installer/scan/not-detected.nix") ./_mixins/features @@ -78,7 +79,11 @@ # Otherwise, the realtime overlay doesn't take. # Probably because it needs to be evaluated after tho raspberry-pi-nix module. - nixpkgs.overlays = [ overlays.realtime ]; + nixpkgs.overlays = [ + overlays.allow-missing-modules + overlays.ccache + overlays.realtime + ]; programs = { command-not-found.enable = false; @@ -91,6 +96,68 @@ nano.enable = lib.mkDefault false; nix-index-database.comma.enable = true; }; + + security = { + sudo.enable = false; + sudo-rs = { + enable = true; + execWheelOnly = true; + # extraConfig = '' + # %wheel \${config.hostname} = NOPASSWD: /usr/bin/poweroff , /usr/bin/systemctl poweroff , /usr/bin/reboot , /usr/bin/systemctl reboot , /usr/bin/systemctl suspend + # \${username} \${config.hostname} = NOPASSWD: /usr/bin/sudo -H -u core fish -c 'cd; fish' + # ''; + extraRules = [ + { + commands = [ + { + command = "${pkgs.systemd}/bin/systemctl poweroff"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/systemctl reboot"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/systemctl suspend"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/poweroff"; + options = [ "NOPASSWD" ]; + } + { + command = "${pkgs.systemd}/bin/reboot"; + options = [ "NOPASSWD" ]; + } + ]; + # host = "ALL"; + # host = config.networking.fqdn; + users = [ username ]; + # } + # { + # commands = [ + # # todo Test if this works. + # # Need EXEC option? + # # sudo -H -u core fish -c 'cd; fish' + # { + # command = "${pkgs.lib.getExe pkgs.fish} -c 'cd; fish'"; + # options = [ "NOPASSWD" "SETENV" ]; + # } + # { + # command = "${pkgs.lib.getExe pkgs.fish}"; + # options = [ "NOPASSWD" "SETENV" ]; + # } + # ]; + # # host = config.networking.fqdn; + # # host = "ALL"; + # # runAs = "core:core"; + # runAs = "core"; + # users = [username]; + } + ]; + }; + }; + # services = { # todo Fix # > Did not find CMake 'cmake' diff --git a/overlays/default.nix b/overlays/default.nix index d289ab2..f2995a9 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,47 +3,283 @@ # Add custom packages from the pkgs directory additions = final: _prev: import ../pkgs final.pkgs; - # deploy-rs-overlay = inputs.deploy-rs.overlays.default; - # deploy-rs-package = final: prev: { deploy-rs = { inherit (final) deploy-rs; lib = final.deploy-rs.lib; }; }; + ccache = _final: prev: { + ccacheWrapper = prev.ccacheWrapper.override { + extraConfig = '' + # Increase the maximum size of the cache. + export CCACHE_MAXSIZE=75Gi + + # This path must be configured fox Nix and NixOS as an extra sandbox path. + export CCACHE_DIR="/nix/var/cache/ccache" + export CCACHE_UMASK=007 + if [ ! -d "$CCACHE_DIR" ]; then + echo "=====" + echo "Directory '$CCACHE_DIR' does not exist" + echo "Please create it with:" + echo " sudo mkdir --mode=0770 --parents '$CCACHE_DIR'" + echo " sudo chown root:nixbld '$CCACHE_DIR'" + echo "=====" + exit 1 + fi + if [ ! -w "$CCACHE_DIR" ]; then + echo "=====" + echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)" + echo "Please verify its access permissions" + echo "=====" + exit 1 + fi + ''; + }; + }; # Disable unnecessary graphics support. - headless = _final: prev: { + modifications = final: prev: { dbus = prev.dbus.override { x11Support = false; }; + ffmpeg = prev.ffmpeg.override { + ffmpegVariant = "headless"; + }; + # Disable GTK support and add PipeWire GStreamer plugin. + rygel = prev.rygel.overrideAttrs (prevAttrs: { + nativeBuildInputs = (prev.lib.lists.remove prev.wrapGAppsHook3 prevAttrs.nativeBuildInputs) ++ [ + prev.wrapGAppsNoGuiHook + ]; + buildInputs = (prev.lib.lists.remove final.gtk3 prevAttrs.buildInputs) ++ [ + prev.pipewire + prev.gdk-pixbuf + ]; + mesonFlags = prevAttrs.mesonFlags ++ [ + "-Dgtk=disabled" + "-Dx11=disabled" + ]; + patches = prevAttrs.patches or [ ] ++ [ + (prev.fetchpatch2 { + url = "https://gitlab.gnome.org/jwillikers/rygel/-/commit/8c7052ac7d61f190adeb1ef4251e6c7c77993872.patch"; + hash = "sha256-dfsZ0FKYBW8KzpPk/5WfX454BOscCXVkkPBuftVCRoQ="; + }) + ]; + }); # todo Make it possible to disable graphviz support in libcamera. graphviz = prev.graphviz.override { withXorg = false; }; - gst-plugins-base = prev.gst-plugins-base.override { enableX11 = false; }; + gst_all_1 = prev.gst_all_1 // { + gst-plugins-base = prev.gst_all_1.gst-plugins-base.override { + enableX11 = false; + enableWayland = false; + }; + gst-plugins-good = prev.gst_all_1.gst-plugins-good.override { + enableX11 = false; + enableWayland = false; + }; + gst-plugins-rs = prev.gst_all_1.gst-plugins-rs.override { + withGtkPlugins = false; + }; + }; + gtk3 = prev.gtk3.override { + broadwaySupport = false; + cupsSupport = false; + trackerSupport = false; + # todo Why does it break the build when I disable X11 support? + # x11Support = false; + xineramaSupport = false; + # waylandSupport = false; + # }).overrideAttrs (prevAttrs: { + # mesonFlags = prevAttrs.mesonFlags ++ [ "-Dwayland_backend=false" ]; + }; + gtk4 = prev.gtk4.override { + broadwaySupport = false; + cupsSupport = false; + trackerSupport = false; + # x11Support = false; + # todo Fix xinerama support is required when x11Support is enabled. + # xineramaSupport = false; + vulkanSupport = false; + # waylandSupport = false; + # }).overrideAttrs (prevAttrs: { + # mesonFlags = prevAttrs.mesonFlags ++ [ "-Dwayland-backend=false" ]; + }; + # libepoxy = prev.libepoxy.override { + # x11Support = false; + # }; + matio = prev.matio.overrideAttrs (_prevAttrs: { + configureFlags = [ + "ac_cv_va_copy=1" + ]; + }); + # Use a newer version and add PipeWire GStreamer plugin. + mopidy = prev.python3Packages.buildPythonApplication rec { + pname = "mopidy"; + pyproject = true; + version = "4.0.0a1"; + + src = prev.fetchFromGitHub { + owner = "mopidy"; + repo = "mopidy"; + rev = "refs/tags/v${version}"; + hash = "sha256-+YjiAysDVfuEpohcWMU5he8yp1tr/g4aLxqrKuhrjWY="; + }; + + build-system = with prev.python3Packages; [ + setuptools + setuptools-scm + ]; + + nativeBuildInputs = [ prev.wrapGAppsNoGuiHook ]; + + propagatedNativeBuildInputs = [ + prev.gobject-introspection + ]; + + propagatedBuildInputs = [ + prev.gobject-introspection + ]; + + buildInputs = + with final.gst_all_1; + [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gst-plugins-rs + ] + ++ [ + prev.glib-networking + prev.pipewire + ]; + + dependencies = with prev.python3Packages; [ + gst-python + pygobject3 + pykka + requests + setuptools + tornado + ]; + + # There are no tests + doCheck = false; + + meta = { + homepage = "https://www.mopidy.com/"; + description = "Extensible music server that plays music from local disk, Spotify, SoundCloud, and more"; + mainProgram = "mopidy"; + license = with prev.lib.licenses; [ asl20 ]; + maintainers = with prev.lib.maintainers; [ fpletz ]; + hydraPlatforms = [ ]; + }; + }; + nushell = prev.nushell.override { + withDefaultFeatures = false; + }; + openslide = prev.openslide.overrideAttrs (_prevAttrs: { + depsBuildBuild = [ prev.buildPackages.stdenv.cc ]; + }); pipewire = prev.pipewire.override { # todo Add support for disabling x11Support in vulkan-loader package. vulkanSupport = false; x11Support = false; }; + poppler = prev.poppler.overrideAttrs (prevAttrs: { + nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ prev.glib ]; + }); + # NODE_OPTIONS = "--openssl-legacy-provider"; + # nodePackages.sharp = prev.nodePackages.sharp.override (oldAttrs:{ + # nativeBuildInputs = [ + # prev.pkg-config + # ]; + # buildInputs = with prev; [ + # # required by sharp + # # https://sharp.pixelplumbing.com/install + # vips + # final.node-gyp-build + # node-pre-gyp + # ]; + + snapweb = prev.snapweb.overrideAttrs ( + prevAttrs: + let + node-addon-api = prev.stdenvNoCC.mkDerivation rec { + pname = "node-addon-api"; + version = "8.0.0"; + src = prev.fetchFromGitHub { + owner = "nodejs"; + repo = "node-addon-api"; + rev = "v${version}"; + hash = "sha256-k3v8lK7uaEJvcaj1sucTjFZ6+i5A6w/0Uj9rYlPhjCE="; + }; + installPhase = '' + mkdir $out + cp -r *.c *.h *.gyp *.gypi index.js package-support.json package.json tools $out/ + ''; + }; + in + { + makeCacheWritable = true; # sharp tries to build stuff in node_modules + nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ + prev.node-gyp + node-addon-api + prev.python3 + ]; + env.SHARP_FORCE_GLOBAL_LIBVIPS = "true"; + # preBuild = '' + # pushd node_modules/sharp + + # mkdir node_modules + # ln -s ${node-addon-api} node_modules/node-addon-api + + # ${prev.lib.getExe prev.nodejs} install/check + + # rm -r node_modules + + # popd + # rm -r node_modules/@img/sharp* + # ''; + # pkgConfig.sharp = { + # nativeBuildInputs = [ + # prev.pkg-config + # prev.python3 + # prev.node-gyp + # prev.nodePackages.semver + # ]; + # buildInputs = [ prev.vips ]; + # postInstall = '' + # yarn --offline run install + # ''; + # }; + # nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [prev.node-gyp]; + # buildInputs = prevAttrs.buildInputs ++ [prev.nodePackages.sharp]; + # # add newer node-addon-api to build sharp + # # https://github.com/lovell/sharp/issues/3920 + # dependencies = [ + # { + # name = "node-addon-api"; + # packageName = "node-addon-api"; + # version = "7.1.0"; + # src = prev.fetchurl { + # url = "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz"; + # sha512 = "mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g=="; + # }; + # } + # ]; + } + ); # Not sure how to entirely disable openconnect which is pulled in by NetworkManager. # So instead, just disable the GTK dependency that it indirectly pulls in. stoken = prev.stoken.override { withGTK3 = false; }; - }; - - # Expose the PipeWire gstreamer plugin to Mopidy. - mopidy-pipewire-gstreamer-plugin = _final: prev: { - mopidy = prev.mopidy.overrideAttrs (_prevAttrs: { - preFixup = '' - gappsWrapperArgs+=( - # Gstreamer PipeWire plugin - --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "${prev.pipewire}/lib/gstreamer-1.0" - ) - ''; + libxkbcommon = prev.libxkbcommon.overrideAttrs (prevAttrs: { + nativeBuildInputs = prev.lib.lists.remove prev.xorg.xorgserver prevAttrs.nativeBuildInputs; + buildInputs = prev.lib.lists.remove prev.xorg.libxcb prevAttrs.buildInputs; + mesonFlags = prevAttrs.mesonFlags ++ [ "-Denable-x11=false" ]; }); + # vips = prev.vips.overrideAttrs(prevAttrs: { + # nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ prev.cmake ]; + # buildInputs = prev.lib.lists.remove prev.poppler (prev.lib.lists.remove prev.openslide (prev.lib.lists.remove prev.matio prevAttrs.buildInputs)); + # mesonFlags = prevAttrs.mesonFlags ++ [ "-Dmatio=disabled" "-Dopenslide=disabled" "-Dpoppler=disabled" ]; + # }); }; - # Expose the PipeWire gstreamer plugin to Rygel. - rygel-pipewire-gstreamer-plugin = _final: prev: { - gnome.rygel = prev.gnome.rygel.overrideAttrs (_prevAttrs: { - preFixup = '' - gappsWrapperArgs+=( - # Gstreamer PipeWire plugin - --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "${prev.pipewire}/lib/gstreamer-1.0" - ) - ''; - }); + # https://github.com/NixOS/nixpkgs/issues/154163 + allow-missing-modules = _final: prev: { + makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; }); }; # Makes the unstable nixpkgs set accessible through 'pkgs.unstable' @@ -65,118 +301,316 @@ }); }; - # Enable AirPlay 2 support in shairport-sync. + # Add a separate package for shairport-sync with AirPlay 2 support enabled. shairport-sync-airplay2 = _final: prev: { shairport-sync-airplay-2 = prev.shairport-sync.override { enableAirplay2 = true; }; }; - realtime = _final: prev: { - rpi-kernels.v6_6_54.bcm2711 = prev.rpi-kernels.v6_6_54.bcm2711.override (prevKernel: { - modDirVersion = "6.6.54-rt44"; - structuredExtraConfig = - with prev.lib.kernel; - { - # Enable HDA soundcard support - # This is magically enabled already. - # By NixOS most likely, but I'm setting it here just to be clear. - # It isn't enabled by default in Raspberry Pi OS. - SND_HDA_GENERIC = yes; - # SND_HDA_INTEL = yes; - # SND_HDA_PREALLOC_SIZE = 2048; - - # realtime - # PREEMPT_RT was merged in to kernel 6.12. - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix - PREEMPT_RT = yes; - EXPERT = yes; # PREEMPT_RT depends on it (in kernel/Kconfig.preempt) - # Fix error: option not set correctly: PREEMPT_VOLUNTARY (wanted 'y', got 'n'). - PREEMPT_VOLUNTARY = prev.lib.mkForce no; # PREEMPT_RT deselects it. - # Fix error: unused option: RT_GROUP_SCHED. - RT_GROUP_SCHED = prev.lib.mkForce (option no); # Removed by sched-disable-rt-group-sched-on-rt.patch. - VIRTUALIZATION = no; - } - // prevKernel.structuredExtraConfig; - kernelPatches = - let - rt-patch = { - name = "rt"; - patch = prev.fetchurl { - url = "mirror://kernel/linux/kernel/projects/rt/6.6/older/patch-6.6.53-rt44.patch.xz"; - sha256 = "sha256-LydfWRvOAMby42eDo0arQdpPXuA6v7SWIyDh/eHa07s="; - }; - }; - in - [ rt-patch ] ++ prevKernel.kernelPatches; - }); - rpi-kernels.v6_6_54.bcm2712 = prev.rpi-kernels.v6_6_54.bcm2712.override (prevKernel: { - modDirVersion = "6.6.54-rt44"; - structuredExtraConfig = - with prev.lib.kernel; - { - # Enable HDA soundcard support - SND_HDA_GENERIC = yes; - # SND_HDA_INTEL = yes; - # SND_HDA_PREALLOC_SIZE = 2048; - - # realtime - # PREEMPT_RT was merged in to kernel 6.12. - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix - PREEMPT_RT = yes; - EXPERT = yes; # PREEMPT_RT depends on it (in kernel/Kconfig.preempt) - # Fix error: option not set correctly: PREEMPT_VOLUNTARY (wanted 'y', got 'n'). - PREEMPT_VOLUNTARY = prev.lib.mkForce no; # PREEMPT_RT deselects it. - # Fix error: unused option: RT_GROUP_SCHED. - RT_GROUP_SCHED = prev.lib.mkForce (option no); # Removed by sched-disable-rt-group-sched-on-rt.patch. - VIRTUALIZATION = no; - } - // prevKernel.structuredExtraConfig; - kernelPatches = - let - rt-patch = { - name = "rt"; - patch = prev.fetchurl { - url = "mirror://kernel/linux/kernel/projects/rt/6.6/older/patch-6.6.53-rt44.patch.xz"; - sha256 = "sha256-LydfWRvOAMby42eDo0arQdpPXuA6v7SWIyDh/eHa07s="; - }; + realtime = + _final: prev: + let + autoModules = false; + v6_6_54 = { + rt-patch = { + name = "rt"; + patch = prev.fetchurl { + url = "mirror://kernel/linux/kernel/projects/rt/6.6/older/patch-6.6.53-rt44.patch.xz"; + sha256 = "sha256-LydfWRvOAMby42eDo0arQdpPXuA6v7SWIyDh/eHa07s="; }; - in - [ rt-patch ] ++ prevKernel.kernelPatches; - }); - # The realtime patchset fails to apply on kernel 6.10.12. - # I will probably just wait for 6.12. - rpi-kernels.v6_10_12.bcm2712 = prev.rpi-kernels.v6_10_12.bcm2712.override (prevKernel: { - modDirVersion = "6.10.12-rt14"; - structuredExtraConfig = - with prev.lib.kernel; - { - # Enable HDA soundcard support - SND_HDA_GENERIC = yes; - # SND_HDA_INTEL = yes; - # SND_HDA_PREALLOC_SIZE = 2048; - - # realtime - # PREEMPT_RT was merged in to kernel 6.12. - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix - PREEMPT_RT = yes; - EXPERT = yes; # PREEMPT_RT depends on it (in kernel/Kconfig.preempt) - # Fix error: option not set correctly: PREEMPT_VOLUNTARY (wanted 'y', got 'n'). - PREEMPT_VOLUNTARY = prev.lib.mkForce no; # PREEMPT_RT deselects it. - # Fix error: unused option: RT_GROUP_SCHED. - RT_GROUP_SCHED = prev.lib.mkForce (option no); # Removed by sched-disable-rt-group-sched-on-rt.patch. - VIRTUALIZATION = no; - } - // prevKernel.structuredExtraConfig; - kernelPatches = - let - rt-patch = { - name = "rt"; - patch = prev.fetchurl { - url = "mirror://kernel/linux/kernel/projects/rt/6.10/older/patch-6.10.2-rt14.patch.xz"; - sha256 = "sha256-qQ6mXEvk/VQykA322EgG6fWkuaKHTwY/nfZx216N8Jo="; - }; + }; + modDirVersion = "6.6.54-rt44"; + }; + v6_10_12 = { + rt-patch = { + name = "rt"; + patch = prev.fetchurl { + url = "mirror://kernel/linux/kernel/projects/rt/6.10/older/patch-6.10.2-rt14.patch.xz"; + sha256 = "sha256-qQ6mXEvk/VQykA322EgG6fWkuaKHTwY/nfZx216N8Jo="; }; - in - [ rt-patch ] ++ prevKernel.kernelPatches; - }); - }; + }; + modDirVersion = "6.10.12-rt14"; + }; + stdenv = prev.ccacheStdenv; + structuredExtraConfig = with prev.lib.kernel; { + # Audio + # Enable HDA soundcard support for the PCIe soundcard. + # This isn't enabled by default in the Raspberry Pi kernel config. + SND_HDA_GENERIC = yes; + SND_HDA_INTEL = module; + SND_BCM2708_SOC_IQAUDIO_DAC = module; + SND_BCM2708_SOC_IQAUDIO_DIGI = module; + SND_BCM2708_SOC_RPI_DAC = module; + SND_DESIGNWARE_I2S = module; + SND_DESIGNWARE_PCM = yes; + + # realtime + # PREEMPT_RT was merged in to kernel 6.12. + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix + PREEMPT_RT = yes; + EXPERT = yes; # PREEMPT_RT depends on it (in kernel/Kconfig.preempt) + # Fix error: option not set correctly: PREEMPT_VOLUNTARY (wanted 'y', got 'n'). + PREEMPT_VOLUNTARY = prev.lib.mkForce no; # PREEMPT_RT deselects it. + # Fix error: unused option: RT_GROUP_SCHED. + RT_GROUP_SCHED = prev.lib.mkForce (option no); # Removed by sched-disable-rt-group-sched-on-rt.patch. + + # Prune unnecessary drivers to reduce the build time. + + ## Filesystems + CEPH_FS = no; + CIFS = no; + EXFAT_FS = no; + GFS2_FS = no; + HFS_FS = no; + HFSPLUS_FS = no; + JFS_FS = no; + JFFS2_FS = no; + NFS_FS = no; + NFSD = no; + NILFS2_FS = no; + NTFS_FS = no; + NTFS3_FS = no; + OCFS2_FS = no; + REISERFS_FS = no; + SMB_SERVER = no; + SQUASHFS = no; + UBIFS_FS = no; + XFS_FS = no; + + ## Framebuffer + FB_SSD1307 = no; + FB_TFT = no; + + ## HID + HID_A4TECH = no; + HID_ACRUX = no; + HID_APPLE = no; + HID_ASUS = no; + HID_BIGBEN_FF = no; + HID_CHERRY = no; + HID_CHICONY = no; + HID_CYPRESS = no; + HID_DRAGONRISE = no; + HID_EMS_FF = no; + HID_ELECOM = no; + HID_ELO = no; + HID_EZKEY = no; + HID_GEMBIRD = no; + HID_HOLTEK = no; + HID_KEYTOUCH = no; + HID_KYE = no; + HID_UCLOGIC = no; + HID_WALTOP = no; + HID_GYRATION = no; + HID_TWINHAN = no; + HID_KENSINGTON = no; + HID_LCPOWER = no; + HID_MONTEREY = no; + HID_NINTENDO = no; + HID_NTRIG = no; + HID_ORTEK = no; + HID_PANTHERLORD = no; + HID_PETALYNX = no; + HID_PICOLCD = no; + HID_ROCCAT = no; + HID_SONY = no; + HID_SPEEDLINK = no; + HID_STEAM = no; + HID_SUNPLUS = no; + HID_GREENASIA = no; + HID_SMARTJOYPLUS = no; + HID_TOPSEED = no; + HID_THINGM = no; + HID_THRUSTMASTER = no; + HID_WIIMOTE = no; + HID_XINMO = no; + HID_ZEROPLUS = no; + HID_ZYDACRON = no; + + ## Industrial IO + BME680 = no; + CCS811 = no; + SENSIRION_SGP30 = no; + SPS30_I2C = no; + DHT11 = no; + HDC100X = no; + HTU21 = no; + SI7020 = no; + BOSCH_BNO055_I2C = no; + INV_MPU6050_I2C = no; + APDS9960 = no; + BH1750 = no; + TSL4531 = no; + VEML6070 = no; + BMP280 = no; + MS5637 = no; + MAXIM_THERMOCOUPLE = no; + MAX31856 = no; + + ## Input + INPUT_JOYSTICK = no; + INPUT_TOUCHSCREEN = no; + INPUT_AD714X = no; + INPUT_ATI_REMOTE2 = no; + INPUT_KEYSPAN_REMOTE = no; + INPUT_POWERMATE = no; + INPUT_YEALINK = no; + INPUT_CM109 = no; + INPUT_ADXL34X = no; + INPUT_CMA3000 = no; + + ## Microsoft Surface + SURFACE_PLATFORMS = no; + + ## Multifunction + MFD_RASPBERRYPI_POE_HAT = no; + MFD_STMPE = no; + + ## Networking + CAN = no; + + ## PWM + PWM_PCA9685 = no; + + ## RTC + RTC_DRV_ABX80X = no; + RTC_DRV_DS1307 = no; + RTC_DRV_DS1374 = no; + RTC_DRV_DS1672 = no; + RTC_DRV_MAX6900 = no; + RTC_DRV_RS5C372 = no; + RTC_DRV_ISL1208 = no; + RTC_DRV_ISL12022 = no; + RTC_DRV_X1205 = no; + RTC_DRV_PCF8523 = no; + RTC_DRV_PCF85063 = no; + RTC_DRV_PCF85363 = no; + RTC_DRV_PCF8563 = no; + RTC_DRV_PCF8583 = no; + RTC_DRV_M41T80 = no; + RTC_DRV_BQ32K = no; + RTC_DRV_S35390A = no; + RTC_DRV_FM3130 = no; + RTC_DRV_RX8581 = no; + RTC_DRV_RX8025 = no; + RTC_DRV_EM3027 = no; + RTC_DRV_RV3028 = no; + RTC_DRV_RV3032 = no; + RTC_DRV_RV8803 = no; + RTC_DRV_SD3078 = no; + RTC_DRV_M41T93 = no; + RTC_DRV_M41T94 = no; + RTC_DRV_DS1302 = no; + RTC_DRV_DS1305 = no; + RTC_DRV_DS1390 = no; + RTC_DRV_R9701 = no; + RTC_DRV_RX4581 = no; + RTC_DRV_RS5C348 = no; + RTC_DRV_MAX6902 = no; + RTC_DRV_PCF2123 = no; + RTC_DRV_DS3232 = no; + RTC_DRV_PCF2127 = no; + RTC_DRV_RV3029C2 = no; + + ## SOC Soundcards + SND_BCM2708_SOC_CHIPDIP_DAC = no; + SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD = no; + SND_BCM2708_SOC_HIFIBERRY_DAC = no; + SND_BCM2708_SOC_HIFIBERRY_DACPLUS = no; + SND_BCM2708_SOC_HIFIBERRY_DACPLUSHD = no; + SND_BCM2708_SOC_HIFIBERRY_DACPLUSADC = no; + SND_BCM2708_SOC_HIFIBERRY_DACPLUSADCPRO = no; + SND_BCM2708_SOC_HIFIBERRY_DACPLUSDSP = no; + SND_BCM2708_SOC_HIFIBERRY_DIGI = no; + SND_BCM2708_SOC_HIFIBERRY_AMP = no; + SND_BCM2708_SOC_PIFI_40 = no; + SND_BCM2708_SOC_RPI_CIRRUS = no; + SND_BCM2708_SOC_RPI_PROTO = no; + SND_BCM2708_SOC_JUSTBOOM_BOTH = no; + SND_BCM2708_SOC_JUSTBOOM_DAC = no; + SND_BCM2708_SOC_JUSTBOOM_DIGI = no; + SND_BCM2708_SOC_IQAUDIO_CODEC = no; + SND_BCM2708_SOC_I_SABRE_Q2M = no; + SND_BCM2708_SOC_ADAU1977_ADC = no; + SND_AUDIOINJECTOR_PI_SOUNDCARD = no; + SND_AUDIOINJECTOR_OCTO_SOUNDCARD = no; + SND_AUDIOINJECTOR_ISOLATED_SOUNDCARD = no; + SND_AUDIOSENSE_PI = no; + SND_DIGIDAC1_SOUNDCARD = no; + SND_BCM2708_SOC_DIONAUDIO_LOCO = no; + SND_BCM2708_SOC_DIONAUDIO_LOCO_V2 = no; + SND_BCM2708_SOC_ALLO_PIANO_DAC = no; + SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS = no; + SND_BCM2708_SOC_ALLO_BOSS_DAC = no; + SND_BCM2708_SOC_ALLO_BOSS2_DAC = no; + SND_BCM2708_SOC_ALLO_DIGIONE = no; + SND_BCM2708_SOC_ALLO_KATANA_DAC = no; + SND_BCM2708_SOC_FE_PI_AUDIO = no; + SND_PISOUND = no; + SND_RPI_SIMPLE_SOUNDCARD = no; + SND_RPI_WM8804_SOUNDCARD = no; + SND_DACBERRY400 = no; + + ## Touchscreens + DRM_PANEL_RASPBERRYPI_TOUCHSCREEN = no; + DRM_PANEL_WAVESHARE_TOUCHSCREEN = no; + + ## USB + USB_PRINTER = no; + USB_MICROTEK = no; + USB_MDC800 = no; + PRISM2_USB = no; + USB_ACM = no; + USB_ATM = no; + USB_YUREX = no; + USB_ISIGHTFW = no; + USB_IOWARRIOR = no; + USB_TRANCEVIBRATOR = no; + USB_LD = no; + USB_APPLEDISPLAY = no; + USB_IDMOUSE = no; + USB_ADUTUX = no; + USB_LEGOTOWER = no; + USB_CYPRESS_CY7C63 = no; + USB_CYTHERM = no; + USB_VL600 = no; + + ## VHOST + VHOST_NET = no; + VHOST_VSOCK = no; + + ## Disable extra options turned on by the NixOS kernel configuration + + ### Filesystems + F2FS_FS = prev.lib.mkForce no; + + ### Infiniband + INFINIBAND = prev.lib.mkForce no; + + ### Misc + CHROME_PLATFORMS = prev.lib.mkForce no; + TCG_TIS_SPI_CR50 = prev.lib.mkForce no; + }; + in + { + rpi-kernels.v6_6_54.bcm2711 = prev.rpi-kernels.v6_6_54.bcm2711.override (prevKernel: { + inherit autoModules stdenv; + inherit (v6_6_54) modDirVersion; + kernelPatches = [ v6_6_54.rt-patch ] ++ prevKernel.kernelPatches; + structuredExtraConfig = structuredExtraConfig // prevKernel.structuredExtraConfig; + }); + rpi-kernels.v6_6_54.bcm2712 = prev.rpi-kernels.v6_6_54.bcm2712.override (prevKernel: { + inherit autoModules stdenv; + inherit (v6_6_54) modDirVersion; + kernelPatches = [ v6_6_54.rt-patch ] ++ prevKernel.kernelPatches; + structuredExtraConfig = structuredExtraConfig // prevKernel.structuredExtraConfig; + }); + # The realtime patchset fails to apply on kernel 6.10.12. + # I will probably just wait for 6.12. + rpi-kernels.v6_10_12.bcm2712 = prev.rpi-kernels.v6_10_12.bcm2712.override (prevKernel: { + inherit autoModules stdenv; + inherit (v6_10_12) modDirVersion; + structuredExtraConfig = structuredExtraConfig // prevKernel.structuredExtraConfig; + kernelPatches = [ v6_10_12.rt-patch ] ++ prevKernel.kernelPatches; + }); + }; } diff --git a/pre-commit-hooks.nix b/pre-commit-hooks.nix index 129c0be..3edebbd 100644 --- a/pre-commit-hooks.nix +++ b/pre-commit-hooks.nix @@ -23,7 +23,7 @@ # todo Not integrated with Nix? check-format = { enable = true; - entry = "${treefmtEval.config.build.wrapper}/bin/treefmt --fail-on-change"; + entry = "${treefmtEval.config.build.wrapper}/bin/treefmt-nix --fail-on-change"; }; check-json.enable = true; diff --git a/treefmt.nix b/treefmt.nix index a212138..9010951 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -3,7 +3,7 @@ _: { programs = { actionlint.enable = true; jsonfmt.enable = true; - just.enable = true; + # just.enable = true; nixfmt.enable = true; statix.enable = true; taplo.enable = true;