aboutsummaryrefslogtreecommitdiff
path: root/pkgs/yo/nixos.rb
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-03-04 16:49:05 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-03-04 16:49:11 -0600
commit6715a0844777a9b07488afe191458694ae515d67 (patch)
tree66f2d76a904a285df8cfa2d8d06c0b4d4789e892 /pkgs/yo/nixos.rb
parent4cd73433add5fd167e84379b6ae29bba41dac6a9 (diff)
update nixos.rb
Diffstat (limited to 'pkgs/yo/nixos.rb')
-rw-r--r--pkgs/yo/nixos.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/yo/nixos.rb b/pkgs/yo/nixos.rb
index 73a1872..abf7304 100644
--- a/pkgs/yo/nixos.rb
+++ b/pkgs/yo/nixos.rb
@@ -1,18 +1,20 @@
module Nix
- def build_configuration(flake_path:, hostname:)
+ def self.build_configuration(flake_path:, hostname:, use_nom: false)
+ nix_cmd = use_nom ? "nom" : "nix"
+
flake_target = "#{flake_path}#nixosConfigurations.'#{hostname}'.config.system.build.toplevel"
- `nix build --no-link --print-out-paths #{flake_target}`.chomp.tap do
+ `#{nix_cmd} build --no-link --print-out-paths #{flake_target}`.chomp.tap do
raise "Build command failed" unless $?.success?
end
end
- def switch_to_configuration(store_path:, verb:, sudo_cmd: "sudo")
+ def self.switch_to_configuration(store_path:, verb:, sudo_cmd: "sudo")
create_gen_cmd = "nix build --no-link --profile /nix/var/nix/profiles/system #{store_path}"
switch_cmd = "#{store_path}/bin/switch-to-configuration #{verb}"
system("#{sudo_cmd} bash -c '#{create_gen_cmd}; #{switch_cmd}'") or raise "Switch command failed"
end
- def switch_to_configuration_remote(store_path:, ssh_host:, use_magic_rollback: false)
+ def self.switch_to_configuration_remote(store_path:, ssh_host:, use_magic_rollback: false)
system("nix copy --to ssh://#{ssh_host} #{store_path}") or raise "Copy closure command failed"
create_gen_cmd = "nix build --no-link --profile /nix/var/nix/profiles/system #{store_path}"