diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 172e35c2..eafecb4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -133,14 +133,14 @@ jobs: nix-shell -A installer.check - name: Build simple flake configuration run: | - nix build ./modules/examples#darwinConfigurations.simple.system --override-input darwin . + nix build ./modules/examples/flake#darwinConfigurations.simple.system --override-input darwin . - name: Activate derivation of simple flake build run: | - ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples#simple --override-input darwin . + ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples/flake#simple --override-input darwin . - name: Rebuild and activate simple flake, but this time using nix-darwins flake interface run: | . /etc/static/bashrc - darwin-rebuild build --flake ./modules/examples#simple --override-input darwin . + darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . - name: Test git submodules run: | . /etc/static/bashrc @@ -155,6 +155,7 @@ jobs: popd cp -a ./modules/examples/. /tmp/test-nix-darwin-submodules + cp -a ./modules/examples/flake/flake.nix /tmp/test-nix-darwin-submodules pushd /tmp/test-nix-darwin-submodules /usr/bin/sed -i.bak \ @@ -214,14 +215,14 @@ jobs: nix-shell -A installer.check - name: Build simple flake configuration run: | - nix build ./modules/examples#darwinConfigurations.simple.system --override-input darwin . + nix build ./modules/examples/flake#darwinConfigurations.simple.system --override-input darwin . - name: Activate derivation of simple flake build run: | - ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples#simple --override-input darwin . + ./result/sw/bin/darwin-rebuild switch --flake ./modules/examples/flake#simple --override-input darwin . - name: Rebuild and activate simple flake, but this time using nix-darwins flake interface run: | . /etc/static/bashrc - darwin-rebuild build --flake ./modules/examples#simple --override-input darwin . + darwin-rebuild build --flake ./modules/examples/flake#simple --override-input darwin . - name: Test git submodules run: | . /etc/static/bashrc @@ -236,6 +237,7 @@ jobs: popd cp -a ./modules/examples/. /tmp/test-nix-darwin-submodules + cp -a ./modules/examples/flake/flake.nix /tmp/test-nix-darwin-submodules pushd /tmp/test-nix-darwin-submodules /usr/bin/sed -i.bak \ diff --git a/flake.nix b/flake.nix index caad8757..3ce6db13 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,11 @@ darwinModules.ofborg = ./modules/examples/ofborg.nix; darwinModules.simple = ./modules/examples/simple.nix; + templates.default = { + path = ./modules/examples/flake; + description = "nix flake init -t nix-darwin"; + }; + checks.x86_64-darwin.simple = (self.lib.darwinSystem { system = "x86_64-darwin"; modules = [ self.darwinModules.simple ]; diff --git a/modules/examples/flake.nix b/modules/examples/flake/flake.nix similarity index 100% rename from modules/examples/flake.nix rename to modules/examples/flake/flake.nix