mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
env: add simple env to test out buildEnv and profiles
This commit is contained in:
parent
a37ac14681
commit
6b71947f89
2 changed files with 23 additions and 0 deletions
12
Justfile
12
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
|
||||
|
|
|
|||
11
nix/environments/nix.nix
Normal file
11
nix/environments/nix.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
buildEnv,
|
||||
#
|
||||
nixfmt-rfc-style,
|
||||
}:
|
||||
buildEnv {
|
||||
name = "nix";
|
||||
paths = [
|
||||
nixfmt-rfc-style
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue