mirror of
https://github.com/nmasur/dotfiles
synced 2025-06-01 22:15:52 +00:00
zellij to trigger nix rebuild of hm and nixos or darwin
This commit is contained in:
parent
f2e09c9adc
commit
23f46e51e6
@ -21,6 +21,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = "lookingglass";
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -23,6 +23,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -19,6 +19,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -19,6 +19,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -23,6 +23,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -21,6 +21,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -23,6 +23,7 @@ rec {
|
|||||||
nmasur.settings = {
|
nmasur.settings = {
|
||||||
username = nmasur.settings.username;
|
username = nmasur.settings.username;
|
||||||
fullName = nmasur.settings.fullName;
|
fullName = nmasur.settings.fullName;
|
||||||
|
host = networking.hostName;
|
||||||
};
|
};
|
||||||
nmasur.profiles = {
|
nmasur.profiles = {
|
||||||
common.enable = true;
|
common.enable = true;
|
||||||
|
@ -21,6 +21,12 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf (cfg.enable) {
|
config = lib.mkIf (cfg.enable) {
|
||||||
|
|
||||||
|
# These are useful for triggering from zellij (rather than running directly in the shell)
|
||||||
|
nmasur.presets.programs.nixpkgs.commands.rebuildNixos = pkgs.writeShellScriptBin "rebuild-darwin" ''
|
||||||
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
||||||
|
darwin-rebuild switch --flake "${config.nmasur.presets.programs.dotfiles.path}#${config.nmasur.settings.host}"
|
||||||
|
'';
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAbbrs = lib.mkIf config.nmasur.presets.programs.dotfiles.enable {
|
shellAbbrs = lib.mkIf config.nmasur.presets.programs.dotfiles.enable {
|
||||||
nr = {
|
nr = {
|
||||||
|
@ -11,10 +11,34 @@ in
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.nixpkgs.enable = lib.mkEnableOption "Nixpkgs presets";
|
options.nmasur.presets.programs.nixpkgs = {
|
||||||
|
enable = lib.mkEnableOption "Nixpkgs presets";
|
||||||
|
commands = {
|
||||||
|
# These are useful for triggering from zellij (rather than running directly in the shell)
|
||||||
|
rebuildHome = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.writeShellScriptBin "rebuild-home" ''
|
||||||
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
||||||
|
${lib.getExe pkgs.home-manager} switch --flake "${config.nmasur.presets.programs.dotfiles.path}#${config.nmasur.settings.host}"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
rebuildNixos = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.writeShellScriptBin "rebuild-nixos" ''
|
||||||
|
git -C ${config.nmasur.presets.programs.dotfiles.path} add --intent-to-add --all
|
||||||
|
doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
cfg.commands.rebuildHome
|
||||||
|
cfg.commands.rebuildNixos
|
||||||
|
];
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
n = "nix";
|
n = "nix";
|
||||||
|
@ -121,14 +121,32 @@ in
|
|||||||
close_on_exit = true;
|
close_on_exit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"bind \"Alt Shift h\"" = {
|
||||||
|
Run = {
|
||||||
|
_args = [
|
||||||
|
(lib.getExe config.nmasur.presets.programs.nixpkgs.commands.rebuildHome)
|
||||||
|
];
|
||||||
|
# close_on_exit = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"bind \"Alt Shift r\"" = {
|
||||||
|
Run = {
|
||||||
|
_args = [
|
||||||
|
(lib.getExe config.nmasur.presets.programs.nixpkgs.commands.rebuildNixos)
|
||||||
|
];
|
||||||
|
# close_on_exit = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
"bind \"Alt Shift w\"" = {
|
"bind \"Alt Shift w\"" = {
|
||||||
Run = {
|
Run = {
|
||||||
_args = [
|
_args = [
|
||||||
"${pkgs.fish}/bin/fish"
|
(lib.getExe pkgs.gh)
|
||||||
"-c"
|
"run"
|
||||||
"gh-run"
|
"watch"
|
||||||
];
|
];
|
||||||
close_on_exit = true;
|
# direction = "Right";
|
||||||
|
# close_on_exit = false;
|
||||||
|
# start_suspended = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"bind \"Super Shift ]\"" = {
|
"bind \"Super Shift ]\"" = {
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Human readable name of the user";
|
description = "Human readable name of the user";
|
||||||
};
|
};
|
||||||
|
host = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Name of the host of this deployment";
|
||||||
|
};
|
||||||
hostnames = lib.mkOption {
|
hostnames = lib.mkOption {
|
||||||
type = lib.types.attrsOf lib.types.str;
|
type = lib.types.attrsOf lib.types.str;
|
||||||
description = "Map of service names to FQDNs";
|
description = "Map of service names to FQDNs";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user