diff --git a/flake.lock b/flake.lock index 8cc9ba3..bfc5b4c 100644 --- a/flake.lock +++ b/flake.lock @@ -215,16 +215,16 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1705968297, - "narHash": "sha256-dGmqJW8v1JPAzv50v2u4MdLrIYLiIXVte4M1wJ0ayyA=", + "lastModified": 1707913978, + "narHash": "sha256-STyfZLkT0Sc6bNkfXVXR8OL0W7LUYHHuw4Bqwhb/Gr0=", "owner": "NixOS", "repo": "nix", - "rev": "08bf2846df34b0db3a25d575e8cb34a9518a9dcc", + "rev": "d857914e1a41670893d6571726588659afe7b1e9", "type": "github" }, "original": { "owner": "NixOS", - "ref": "08bf2846df34b0db3a25d575e8cb34a9518a9dcc", + "ref": "d857914e1a41670893d6571726588659afe7b1e9", "repo": "nix", "type": "github" } @@ -527,16 +527,16 @@ }, "unstable": { "locked": { - "lastModified": 1707689078, - "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", + "lastModified": 1707661179, + "narHash": "sha256-dyJ0nyP+S58WgJVigOboHTE5LR1E7MzJvm3fc9zkza8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", + "rev": "8686026882afa61d77a6fa5b05a25e4769ee09cd", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "8686026882afa61d77a6fa5b05a25e4769ee09cd", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index b5c4db1..8ff3c15 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,8 @@ type = "github"; owner = "NixOS"; repo = "nixpkgs"; - ref = "nixos-unstable"; + #ref = "nixos-unstable"; + ref = "8686026882afa61d77a6fa5b05a25e4769ee09cd"; }; stable = { type = "github"; @@ -24,7 +25,7 @@ type = "github"; owner = "NixOS"; repo = "nix"; - ref = "08bf2846df34b0db3a25d575e8cb34a9518a9dcc"; + ref = "d857914e1a41670893d6571726588659afe7b1e9"; inputs.nixpkgs.follows = "stable"; }; nixos-generators = { diff --git a/hosts/gerg-desktop/services/gitea.nix b/hosts/gerg-desktop/services/gitea.nix index cd7ab00..9f59f6a 100644 --- a/hosts/gerg-desktop/services/gitea.nix +++ b/hosts/gerg-desktop/services/gitea.nix @@ -1,5 +1,5 @@ _: -{config, ... }: +#{ config, ... }: { # users.users = { # ${config.services.gitea.user} = { diff --git a/hosts/gerg-desktop/services/nextcloud.nix b/hosts/gerg-desktop/services/nextcloud.nix index 8cdb476..0090760 100644 --- a/hosts/gerg-desktop/services/nextcloud.nix +++ b/hosts/gerg-desktop/services/nextcloud.nix @@ -17,7 +17,7 @@ _: adminpassFile = config.sops.secrets.nextcloud.path; adminuser = "admin-root"; }; - extraOptions = { + settings = { overwriteprotocol = "https"; default_phone_region = "US"; }; diff --git a/hosts/gerg-desktop/services/nginx.nix b/hosts/gerg-desktop/services/nginx.nix index cc07b8f..5d5d1c0 100644 --- a/hosts/gerg-desktop/services/nginx.nix +++ b/hosts/gerg-desktop/services/nginx.nix @@ -9,12 +9,10 @@ _: "gerg_ssl_key" "gerg_ssl_cert" ] - ( - _: { - owner = config.services.nginx.user; - inherit (config.services.nginx) group; - } - ); + (_: { + owner = config.services.nginx.user; + inherit (config.services.nginx) group; + }); services.nginx = { enable = true; diff --git a/hosts/gerg-desktop/vfio.nix b/hosts/gerg-desktop/vfio.nix index e4c113b..5779723 100644 --- a/hosts/gerg-desktop/vfio.nix +++ b/hosts/gerg-desktop/vfio.nix @@ -80,31 +80,29 @@ in enable = true; qemu = { #don't hook evdev at vm start - package = pkgs.qemu_kvm.overrideAttrs ( - old: { - patches = old.patches ++ [ - (pkgs.writeText "qemu.diff" '' - diff --git a/ui/input-linux.c b/ui/input-linux.c - index e572a2e..a9d76ba 100644 - --- a/ui/input-linux.c - +++ b/ui/input-linux.c - @@ -397,12 +397,6 @@ static void input_linux_complete(UserCreatable *uc, Error **errp) - } + package = pkgs.qemu_kvm.overrideAttrs (old: { + patches = old.patches ++ [ + (pkgs.writeText "qemu.diff" '' + diff --git a/ui/input-linux.c b/ui/input-linux.c + index e572a2e..a9d76ba 100644 + --- a/ui/input-linux.c + +++ b/ui/input-linux.c + @@ -397,12 +397,6 @@ static void input_linux_complete(UserCreatable *uc, Error **errp) + } - qemu_set_fd_handler(il->fd, input_linux_event, NULL, il); - - if (il->keycount) { - - /* delay grab until all keys are released */ - - il->grab_request = true; - - } else { - - input_linux_toggle_grab(il); - - } - QTAILQ_INSERT_TAIL(&inputs, il, next); - il->initialized = true; - return; - '') - ]; - } - ); + qemu_set_fd_handler(il->fd, input_linux_event, NULL, il); + - if (il->keycount) { + - /* delay grab until all keys are released */ + - il->grab_request = true; + - } else { + - input_linux_toggle_grab(il); + - } + QTAILQ_INSERT_TAIL(&inputs, il, next); + il->initialized = true; + return; + '') + ]; + }); runAsRoot = true; ovmf.enable = true; verbatimConfig = '' diff --git a/lib/default.nix b/lib/default.nix index 2a2d7e3..eeba4bb 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -37,38 +37,34 @@ rec { mkModules = path: lib.listToAttrs ( - map - (name: { - name = lib.pipe name [ - toString - (lib.removeSuffix ".nix") - (lib.removePrefix "${toString path}/") - ]; - value = lib.pipe name [ - builtins.readFile - (builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${name}";'')) - (builtins.toFile (builtins.baseNameOf path)) - ]; - }) - (listNixFilesRecursive path) + map (name: { + name = lib.pipe name [ + toString + (lib.removeSuffix ".nix") + (lib.removePrefix "${toString path}/") + ]; + value = lib.pipe name [ + builtins.readFile + (builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${name}";'')) + (builtins.toFile (builtins.baseNameOf path)) + ]; + }) (listNixFilesRecursive path) ); gerg-utils = config: outputs: lib.foldAttrs lib.mergeAttrs { } ( - map - ( - system: - let - pkgs = - if config == { } then - unstable.legacyPackages.${system} - else - import unstable { inherit system config; }; - in - lib.mapAttrs (name: value: if needsSystem name then { ${system} = value pkgs; } else value) outputs - ) - [ "x86_64-linux" ] + map ( + system: + let + pkgs = + if config == { } then + unstable.legacyPackages.${system} + else + import unstable { inherit system config; }; + in + lib.mapAttrs (name: value: if needsSystem name then { ${system} = value pkgs; } else value) outputs + ) [ "x86_64-linux" ] ); mkHosts = @@ -101,12 +97,10 @@ rec { mkDisko = names: lib.listToAttrs ( - map - (name: { - name = "disko-${name}"; - value.disko.devices = import "${self}/disko/${name}.nix" lib; - }) - names + map (name: { + name = "disko-${name}"; + value.disko.devices = import "${self}/disko/${name}.nix" lib; + }) names ); /* / -> packages named by directory diff --git a/modules/nix.nix b/modules/nix.nix index d08301d..49da5fa 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,5 +1,10 @@ inputs: -{ lib, config, ... }: +{ + lib, + config, + pkgs, + ... +}: { # # Flake registry and $NIX_PATH pinning @@ -10,13 +15,10 @@ inputs: (x: x // { nixpkgs.flake = inputs.unstable; }) ]; - environment.etc = - lib.mapAttrs' - (name: value: { - name = "nix/path/${name}"; - value.source = value.flake; - }) - config.nix.registry; + environment.etc = lib.mapAttrs' (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) config.nix.registry; nix.nixPath = [ "/etc/nix/path" ]; # # Ignore global registry @@ -25,7 +27,14 @@ inputs: # # Use nix directly from master # - nix.package = inputs.nix.packages.default; + nix.package = inputs.nix.packages.default.overrideAttrs (old: { + patches = old.patches or [ ] ++ [ + (pkgs.fetchpatch { + url = "https://github.com/NixOS/nix/commit/b6ae3be9c6ec4e9de55479188e76fc330b2304dd.patch"; + hash = "sha256-VyIywGo1ie059wXmGWx+bNeHz9lNk6nlkJ/Qgd1kmzw="; + }) + ]; + }); # # Other nix settings # @@ -56,6 +65,10 @@ inputs: allowed-users = [ "@wheel" ]; use-xdg-base-directories = true; auto-allocate-uids = true; + # + # A option for the custom patch + # + reject-flake-config = true; }; #_file } diff --git a/packages/papermc/package.nix b/packages/papermc/package.nix index 7787278..c0580d6 100644 --- a/packages/papermc/package.nix +++ b/packages/papermc/package.nix @@ -5,50 +5,48 @@ jre, makeBinaryWrapper, }: -stdenvNoCC.mkDerivation ( - finalAttrs: { - pname = "papermc"; +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "papermc"; - version = "1.20.1.83"; + version = "1.20.1.83"; - src = - let - mcVersion = lib.versions.pad 3 finalAttrs.version; - buildNum = builtins.elemAt (lib.splitVersion finalAttrs.version) 3; - in - fetchurl { - url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar"; - hash = "sha256-HQpc3MOXa1wkXqgm9ciQj04FUIyuupnYiu+2RZ/sXE4="; - }; - - installPhase = '' - runHook preInstall - - install -D $src $out/share/papermc/papermc.jar - - makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \ - --append-flags "-jar $out/share/papermc/papermc.jar nogui" - - runHook postInstall - ''; - - nativeBuildInputs = [ makeBinaryWrapper ]; - - dontUnpack = true; - preferLocalBuild = true; - allowSubstitutes = false; - - meta = { - description = "High-performance Minecraft Server"; - homepage = "https://papermc.io/"; - sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; - license = lib.licenses.gpl3Only; - platforms = lib.platforms.unix; - maintainers = with lib.maintainers; [ - aaronjanse - neonfuz - ]; - mainProgram = "minecraft-server"; + src = + let + mcVersion = lib.versions.pad 3 finalAttrs.version; + buildNum = builtins.elemAt (lib.splitVersion finalAttrs.version) 3; + in + fetchurl { + url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar"; + hash = "sha256-HQpc3MOXa1wkXqgm9ciQj04FUIyuupnYiu+2RZ/sXE4="; }; - } -) + + installPhase = '' + runHook preInstall + + install -D $src $out/share/papermc/papermc.jar + + makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \ + --append-flags "-jar $out/share/papermc/papermc.jar nogui" + + runHook postInstall + ''; + + nativeBuildInputs = [ makeBinaryWrapper ]; + + dontUnpack = true; + preferLocalBuild = true; + allowSubstitutes = false; + + meta = { + description = "High-performance Minecraft Server"; + homepage = "https://papermc.io/"; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ + aaronjanse + neonfuz + ]; + mainProgram = "minecraft-server"; + }; +})