diff --git a/Justfile b/Justfile index 2f004b75..916b8f43 100644 --- a/Justfile +++ b/Justfile @@ -17,6 +17,18 @@ install host: --file ./default.nix \ --attr "nixosConfigurations.{{ host }}" +env name action profilePath="~/.environments": + #!/usr/bin/env bash + # 1) realize the buildEnv derivation + # 2) set the environment to it + drv=$(nix-build -E " + let sources = import ./nix/sources.nix {}; + pkgs = import sources.nixpkgs {}; + in pkgs.callPackage ./nix/environments/{{ name }}.nix {} + ") + mkdir -p {{ profilePath }} + nix-env --{{ action }} "$drv" --profile {{ profilePath }}"/{{ name }}" + update: niv update nixpkgs niv update nur diff --git a/nix/environments/nix.nix b/nix/environments/nix.nix new file mode 100644 index 00000000..c14a07ed --- /dev/null +++ b/nix/environments/nix.nix @@ -0,0 +1,11 @@ +{ + buildEnv, + # + nixfmt-rfc-style, +}: +buildEnv { + name = "nix"; + paths = [ + nixfmt-rfc-style + ]; +}