Update justfile to use nixos-rebuild-ng by default
This commit is contained in:
parent
f2a0da8827
commit
879183b13b
5 changed files with 29 additions and 20 deletions
|
@ -1,10 +1,11 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, upkgs, ... }:
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
just
|
||||
python3
|
||||
sops
|
||||
ssh-to-age
|
||||
age
|
||||
packages = [
|
||||
pkgs.just # script runner
|
||||
pkgs.python3 # used throughout a bunch of just recipes
|
||||
pkgs.sops # just sops-rekey
|
||||
pkgs.ssh-to-age # just ssh-to-age
|
||||
pkgs.age # just age-public-key
|
||||
upkgs.nixos-rebuild-ng
|
||||
];
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
};
|
||||
in
|
||||
{
|
||||
"Google".metaData.alias = "@g";
|
||||
"google".metaData.alias = "@g";
|
||||
}
|
||||
// lib.attrsets.mapAttrs (_: mkBasicSearchEngine) (lib.importTOML ./engines.toml);
|
||||
# }}}
|
||||
|
|
|
@ -53,3 +53,4 @@ observenat/!
|
|||
SHA256
|
||||
Fatalis
|
||||
CNAME
|
||||
homotopically
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# This handles audio stuff
|
||||
{
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
|
|
25
justfile
25
justfile
|
@ -5,12 +5,13 @@ default:
|
|||
hostname := `hostname`
|
||||
|
||||
# {{{ Nixos rebuilds
|
||||
[doc("Wrapper around `nixos-rebuild`, taking care of the generic arguments")]
|
||||
[doc("Wrapper around `nixos-rebuild`")]
|
||||
[group("nix")]
|
||||
nixos-rebuild action="switch" host=hostname:
|
||||
nixos-rebuild action="switch" host=hostname ng="1":
|
||||
#!/usr/bin/env python3
|
||||
import subprocess
|
||||
|
||||
ng = "{{ng}}" != "0"
|
||||
host = "{{host}}"
|
||||
users = {
|
||||
'tethys': 'adrielus',
|
||||
|
@ -19,25 +20,31 @@ nixos-rebuild action="switch" host=hostname:
|
|||
}
|
||||
|
||||
args = [
|
||||
"nixos-rebuild",
|
||||
"nixos-rebuild-ng" if ng else "nixos-rebuild",
|
||||
"{{action}}",
|
||||
"--show-trace",
|
||||
"--fast",
|
||||
"--accept-flake-config",
|
||||
"--flake",
|
||||
".#{{host}}"
|
||||
".#{{host}}",
|
||||
"--no-reexec" if ng else "--fast"
|
||||
]
|
||||
|
||||
if "{{host}}" == "{{hostname}}":
|
||||
if host == "{{hostname}}":
|
||||
print("🧬 Switching nixos configuration (locally) for '{{BLUE + host + NORMAL}}'")
|
||||
args = ["sudo", *args]
|
||||
args = [ "sudo", *args ]
|
||||
else:
|
||||
print("🧬 Switching nixos configuration (remotely) for '{{BLUE + host + NORMAL}}'")
|
||||
args.append("--use-remote-sudo")
|
||||
args += ["--target-host", f"{users[host]}@{host}"]
|
||||
args += [ "--target-host", f"{users[host]}@{host}" ]
|
||||
if ng:
|
||||
args += [ "--sudo", "--ask-sudo-password" ]
|
||||
else:
|
||||
args += [ "--use-remote-sudo" ]
|
||||
|
||||
try:
|
||||
subprocess.run(args, check=True)
|
||||
print("🚀 All done!")
|
||||
except KeyboardInterrupt:
|
||||
print("🪓 Command cancelled")
|
||||
# }}}
|
||||
# {{{ Miscellaneous nix commands
|
||||
[doc("Build the custom ISO provided by the flake")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue