variables
This commit is contained in:
@@ -2,12 +2,20 @@
|
||||
{
|
||||
flake.modules.homeManager.rebuild =
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
hostnameCmd = "$(${lib.getExe pkgs.hostname} -s)";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
homeManagerFlakeDir = lib.mkOption {
|
||||
description = "Path to the home-manager flake directory.";
|
||||
type = lib.types.str;
|
||||
default = "${config.xdg.configHome}/home-manager";
|
||||
description = "Path to the home-manager flake directory.";
|
||||
};
|
||||
buildHostname = lib.mkOption {
|
||||
description = "Hostname for the NixOS configuration to use.";
|
||||
type = lib.types.str;
|
||||
default = hostnameCmd;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -27,11 +35,11 @@
|
||||
'')
|
||||
(writeShellScriptBin "flake-parts-check" ''
|
||||
cd ${flakeDir}
|
||||
${nixBin} run ".#write-flake"
|
||||
${nixBin} run "${flakeDir}#write-flake"
|
||||
${nixBin} flake check
|
||||
'')
|
||||
(writeShellScriptBin "nhms" ''
|
||||
HOSTNAME=$(hostname -s)
|
||||
HOSTNAME=${hostnameCmd}
|
||||
echo "Switching to the $HOSTNAME profile"
|
||||
${lib.getExe home-manager} switch --impure --flake ${flakeDir}#$HOSTNAME
|
||||
'')
|
||||
|
||||
Reference in New Issue
Block a user