mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
44 lines
1.6 KiB
Makefile
44 lines
1.6 KiB
Makefile
os host action:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./nix/sources.nix {}; in sources.nixpkgs.outPath" | jq -r .)
|
|
sudo nixos-rebuild {{ action }} \
|
|
-I nixpkgs=${nixpkgs} \
|
|
-I nixos-config=./nix/configurations/{{ host }}.nix \
|
|
--fast \
|
|
--file ./default.nix \
|
|
--attr "nixosConfigurations.{{ host }}"
|
|
|
|
install host:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./nix/sources.nix {}; in sources.nixpkgs.outPath" | jq -r .)
|
|
sudo nixos-install \
|
|
-I nixpkgs=${nixpkgs} \
|
|
-I nixos-config=./nix/configurations/{{ host }}.nix \
|
|
--file ./default.nix \
|
|
--attr "nixosConfigurations.{{ host }}"
|
|
|
|
env name action profilePath="~/.environments":
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# 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 {
|
|
overlays = with (import ../overlays); [
|
|
packages
|
|
];
|
|
};
|
|
in pkgs.callPackage ./nix/environments/{{ name }}.nix {}
|
|
")
|
|
mkdir -p {{ profilePath }}
|
|
nix-env --{{ action }} "$drv" --profile {{ profilePath }}"/{{ name }}"
|
|
|
|
update:
|
|
niv update nixpkgs
|
|
niv update nur
|