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 -''