From ec939ca6ac7ee736b6c6959b411a8338d57f5b3b Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 20 Jul 2023 23:38:26 -0400 Subject: [PATCH] chore: don't use channels for testing (#3) --- .github/workflows/test.yml | 2 +- flake.nix | 14 ++++++++++++-- test.nix | 7 ------- 3 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 test.nix diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfc65d1..399c09f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,4 +38,4 @@ jobs: token: ${{ secrets.ATTIC_TOKEN }} - name: Build Nix Package - run: nix build -f test.nix -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz --show-trace + run: nix build --impure --show-trace -L .#test diff --git a/flake.nix b/flake.nix index d49e135..988133f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = ""; + description = "Github Action for caching Nix derivations with attic"; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; @@ -26,6 +26,16 @@ }; }); - formatter = forEachSystem (p: p.nixpkgs-fmt); + formatter = forEachSystem (p: p.alejandra); + + packages = forEachSystem (p: let + time = toString builtins.currentTime; + test = p.runCommand "test-${time}" {} '' + echo ${time} > $out + ''; + in { + inherit test; + default = test; + }); }; } diff --git a/test.nix b/test.nix deleted file mode 100644 index 409ef43..0000000 --- a/test.nix +++ /dev/null @@ -1,7 +0,0 @@ -let - pkgs = import { }; - time = with builtins; toString currentTime; -in -pkgs.runCommand "${time}-test" { } '' - echo "${time}" > $out -''