working-ish, not all options
This commit is contained in:
51
nixosModules/options.nix
Normal file
51
nixosModules/options.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
options.user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The username for the Home Manager configuration.";
|
||||
};
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
# introduces backwards incompatible changes.
|
||||
#
|
||||
# You should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
options.stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
# default = "25.01";
|
||||
description = "The state version when the configuration was initially created";
|
||||
};
|
||||
|
||||
options.profile = lib.mkOption {
|
||||
type = lib.types.enum [ "personal" "work" ];
|
||||
default = "personal";
|
||||
description = "Profile type for the Home Manager configuration.";
|
||||
};
|
||||
|
||||
options.shell = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable all the zsh stuff";
|
||||
};
|
||||
|
||||
options.ssh = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable SSH configuration";
|
||||
};
|
||||
|
||||
options._1password = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable 1 password stuff";
|
||||
};
|
||||
|
||||
options.extraImports = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.anything;
|
||||
default = [];
|
||||
description = "Additional Home Manager modules to import";
|
||||
};
|
||||
}
|
||||
16
nixosModules/scripts.nix
Normal file
16
nixosModules/scripts.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
hostName = config.networking.hostName;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.writeShellScriptBin "nfs" ''
|
||||
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${hostName} --impure
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "nfsu" ''
|
||||
FLAKE=$(readlink -f /etc/nixos)
|
||||
nix flake update --flake $FLAKE --impure
|
||||
sudo nixos-rebuild switch --flake $FLAKE#${hostName} --impure
|
||||
'')
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user