flake.lock

{ "nodes": { "flake-utils": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "owner": "numtide", "repo": "flake-utils", "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "type": "github" }, "original": { "owner": "numtide", "repo": "flake-utils", "type": "github" } }, "nixpkgs": { "locked": { "lastModified": 1637841632, "narHash": "sha256-QYqiKHdda0EOnLGQCHE+GluD/Lq2EJj4hVTooPM55Ic=", "owner": "NixOS", "repo": "nixpkgs", "rev": "73369f8d0864854d1acfa7f1e6217f7d6b6e3fa1", "type": "github" }, "original": { "id": "nixpkgs", "ref": "nixos-unstable", "type": "indirect" } }, "root": { "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } } }, "root": "root", "version": 7 }

1 min · Wyatt Osterling

flake.nix

{ description = "Collection of utilities meant to be used with my NixOS configuration."; inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; wut = (with pkgs; stdenv.mkDerivation { pname = "wut"; version = "0.0.2"; src = ./.; installPhase = '' mkdir -p $out/bin mv ./wut.rb $out/bin/wut chmod +x $out/bin/wut ''; }); in rec { defaultApp = flake-utils....

1 min · Wyatt Osterling

README.md

# wizardwatch-utils A collection of utilities used in conjunction with my NixOS configuration.

1 min · Wyatt Osterling

wut.rb

#! /usr/bin/env ruby # require_relative "wizardwatch_utils/version" require 'socket' def update(input) hostname = Socket.gethostname if input[1] != hostname puts 'THE HOSTNAME DOES NOT MATCH THE SELECTED CONFIGURATION.' puts 'You entered ' + input[1] + ', the hostname is ' + hostname + '.' end puts 'Are you sure you want to update this computer? yes/no' confirm = $stdin.gets if confirm.chomp == 'yes' puts `sudo nixos-rebuild switch --flake \.\##{hostname}` end end def apply_user(input) puts "Do you want to install (update) user #{input[1]}this computer?...

1 min · Wyatt Osterling

result

0 min · Wyatt Osterling