Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy_nixos: flake deployment doesn't work in a sub-folder #60

Open
zimbatm opened this issue Sep 8, 2021 · 1 comment
Open

deploy_nixos: flake deployment doesn't work in a sub-folder #60

zimbatm opened this issue Sep 8, 2021 · 1 comment

Comments

@zimbatm
Copy link
Member

zimbatm commented Sep 8, 2021

I just hit an issue where this doesn't work if the flake is in a sub-folder of the repo. Because it tries to instantiate from ./. and that doesn't contain the .git folder.

Originally posted by @zimbatm in #57 (comment)

@zimbatm
Copy link
Member Author

zimbatm commented Sep 8, 2021

Error message:

error: Cannot deploy from an unclean source tree!

The issue comes from this snippet:

'nix-instantiate' '--show-trace' '--expr' $'\n  { system, configuration, hermetic ? false, flake ? false, ... }:\n  let\n    importFromFlake = { nixosConfig }:\n        let\n          flake = (import (\n                    fetchTarball {\n                      url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";\n                      sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }\n                  ) {\n                    src =  ./.;\n                  }).defaultNix;\n        in\n          builtins.getAttr nixosConfig flake.nixosConfigurations;\n    os =\n      if flake\n         then importFromFlake { nixosConfig = configuration; }\n         else if hermetic\n          then import configuration\n          else import <nixpkgs/nixos> { inherit system configuration; };\n  in {\n    inherit (builtins) currentSystem;\n\n    substituters =\n      builtins.concatStringsSep " " os.config.nix.binaryCaches;\n\n    trusted-public-keys =\n      builtins.concatStringsSep " " os.config.nix.binaryCachePublicKeys;\n\n    drv_path = os.config.system.build.toplevel.drvPath;\n    out_path = os.config.system.build.toplevel;\n  }' '--argstr' 'configuration' 'bastion' '--arg' 'flake' 'true' '--argstr' 'system' 'x86_64-linux' '--arg' 'hermetic' 'false' -A out_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant