CI/Nix: simplify cache config
This commit is contained in:
parent
5f0575737f
commit
526aa1d020
7 changed files with 20 additions and 51 deletions
16
.github/workflows/nix-test.yml
vendored
16
.github/workflows/nix-test.yml
vendored
|
|
@ -20,25 +20,13 @@ jobs:
|
|||
- name: Restore and save Nix store
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# restore and save a cache using this key
|
||||
primary-key: nix-${{ runner.os }}
|
||||
# restore and save a cache using this key (per job)
|
||||
primary-key: nix-${{ runner.os }}-${{ github.job }}
|
||||
# if there's no cache hit, restore a cache by this prefix
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}
|
||||
# collect garbage until the Nix store size (in bytes) is at most this number
|
||||
# before trying to save a new cache
|
||||
# 1G = 1073741824
|
||||
gc-max-store-size-linux: 5G
|
||||
# do purge caches
|
||||
purge: true
|
||||
# purge all versions of the cache
|
||||
purge-prefixes: nix-${{ runner.os }}
|
||||
# created more than this number of seconds ago
|
||||
purge-created: 0
|
||||
# or, last accessed more than this number of seconds ago
|
||||
# relative to the start of the `Post Restore and save Nix store` phase
|
||||
purge-last-accessed: 0
|
||||
# except any version with the key that is the same as the `primary-key`
|
||||
purge-primary-key: never
|
||||
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
|
|
|
|||
20
.github/workflows/nix-update-inputs.yml
vendored
20
.github/workflows/nix-update-inputs.yml
vendored
|
|
@ -27,25 +27,13 @@ jobs:
|
|||
- name: Restore and save Nix store
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# restore and save a cache using this key
|
||||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
||||
# restore and save a cache using this key (per job)
|
||||
primary-key: nix-${{ runner.os }}-${{ github.job }}
|
||||
# if there's no cache hit, restore a cache by this prefix
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}
|
||||
# collect garbage until the Nix store size (in bytes) is at most this number
|
||||
# before trying to save a new cache
|
||||
# 1G = 1073741824
|
||||
gc-max-store-size-linux: 1G
|
||||
# do purge caches
|
||||
purge: true
|
||||
# purge all versions of the cache
|
||||
purge-prefixes: nix-${{ runner.os }}-
|
||||
# created more than this number of seconds ago
|
||||
purge-created: 0
|
||||
# or, last accessed more than this number of seconds ago
|
||||
# relative to the start of the `Post Restore and save Nix store` phase
|
||||
purge-last-accessed: 0
|
||||
# except any version with the key that is the same as the `primary-key`
|
||||
purge-primary-key: never
|
||||
gc-max-store-size-linux: 5G
|
||||
|
||||
- name: Update inputs
|
||||
run: nix/update-inputs.sh
|
||||
|
|
|
|||
16
.github/workflows/nix.yml
vendored
16
.github/workflows/nix.yml
vendored
|
|
@ -25,25 +25,13 @@ jobs:
|
|||
- name: Restore and save Nix store
|
||||
uses: nix-community/cache-nix-action@v6
|
||||
with:
|
||||
# restore and save a cache using this key
|
||||
primary-key: nix-${{ runner.os }}
|
||||
# restore and save a cache using this key (per job)
|
||||
primary-key: nix-${{ runner.os }}-${{ github.job }}
|
||||
# if there's no cache hit, restore a cache by this prefix
|
||||
restore-prefixes-first-match: nix-${{ runner.os }}
|
||||
# collect garbage until the Nix store size (in bytes) is at most this number
|
||||
# before trying to save a new cache
|
||||
# 1G = 1073741824
|
||||
gc-max-store-size-linux: 5G
|
||||
# do purge caches
|
||||
purge: true
|
||||
# purge all versions of the cache
|
||||
purge-prefixes: nix-${{ runner.os }}
|
||||
# created more than this number of seconds ago
|
||||
purge-created: 0
|
||||
# or, last accessed more than this number of seconds ago
|
||||
# relative to the start of the `Post Restore and save Nix store` phase
|
||||
purge-last-accessed: 0
|
||||
# except any version with the key that is the same as the `primary-key`
|
||||
purge-primary-key: never
|
||||
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@
|
|||
(pkgsFor.${system})
|
||||
# hyprland-packages
|
||||
hyprland
|
||||
hyprland-with-hyprtester
|
||||
hyprland-unwrapped
|
||||
# hyprland-extras
|
||||
xdg-desktop-portal-hyprland
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@
|
|||
commit,
|
||||
revCount,
|
||||
date,
|
||||
withHyprtester ? false,
|
||||
# deprecated flags
|
||||
enableNvidiaPatches ? false,
|
||||
nvidiaPatches ? false,
|
||||
hidpiXWayland ? false,
|
||||
legacyRenderer ? false,
|
||||
withHyprtester ? false,
|
||||
}: let
|
||||
inherit (builtins) foldl' readFile;
|
||||
inherit (lib.asserts) assertMsg;
|
||||
|
|
@ -70,6 +70,7 @@ in
|
|||
assert assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
|
||||
assert assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hypr.land/Configuring/XWayland";
|
||||
assert assertMsg (!legacyRenderer) "The option `legacyRenderer` has been removed. Legacy renderer is no longer supported.";
|
||||
assert assertMsg (!withHyprtester) "The option `withHyprtester` has been removed. Hyprtester is always built now.";
|
||||
customStdenv.mkDerivation (finalAttrs: {
|
||||
pname = "hyprland${optionalString debug "-debug"}";
|
||||
inherit version;
|
||||
|
|
@ -85,6 +86,7 @@ in
|
|||
../assets/install
|
||||
../hyprctl
|
||||
../hyprland.pc.in
|
||||
../hyprtester
|
||||
../LICENSE
|
||||
../protocols
|
||||
../src
|
||||
|
|
@ -94,7 +96,6 @@ in
|
|||
(fs.fileFilter (file: file.hasExt "conf" || file.hasExt "desktop") ../example)
|
||||
(fs.fileFilter (file: file.hasExt "sh") ../scripts)
|
||||
(fs.fileFilter (file: file.name == "CMakeLists.txt") ../.)
|
||||
(optional withHyprtester ../hyprtester)
|
||||
]));
|
||||
};
|
||||
|
||||
|
|
@ -189,7 +190,7 @@ in
|
|||
"NO_UWSM" = true;
|
||||
"NO_HYPRPM" = true;
|
||||
"TRACY_ENABLE" = false;
|
||||
"BUILD_HYPRTESTER" = withHyprtester;
|
||||
"BUILD_HYPRTESTER" = true;
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
|
|
@ -208,7 +209,7 @@ in
|
|||
pkgconf
|
||||
]}
|
||||
''}
|
||||
'' + optionalString withHyprtester ''
|
||||
|
||||
install hyprtester/pointer-warp -t $out/bin
|
||||
install hyprtester/pointer-scroll -t $out/bin
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -43,7 +43,12 @@ in {
|
|||
};
|
||||
hyprland-unwrapped = final.hyprland.override {wrapRuntimeDeps = false;};
|
||||
|
||||
hyprland-with-hyprtester = final.hyprland.override {withHyprtester = true;};
|
||||
hyprland-with-hyprtester =
|
||||
builtins.trace ''
|
||||
hyprland-with-hyprtester was removed. Please use the hyprland package.
|
||||
Hyprtester is always built now.
|
||||
''
|
||||
final.hyprland;
|
||||
|
||||
# deprecated packages
|
||||
hyprland-legacy-renderer =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
inputs: pkgs: let
|
||||
flake = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
hyprland = flake.hyprland-with-hyprtester;
|
||||
hyprland = flake.hyprland;
|
||||
in {
|
||||
tests = pkgs.testers.runNixOSTest {
|
||||
name = "hyprland-tests";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue