working-ish, not all options
This commit is contained in:
16
flake.nix
16
flake.nix
@@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
homeManagerModules.default = { ... }: {
|
homeManagerModules.default = { ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./options.nix
|
./nixosModules/options.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
inputs._1password-shell-plugins.hmModules.default
|
inputs._1password-shell-plugins.hmModules.default
|
||||||
@@ -31,7 +31,8 @@
|
|||||||
|
|
||||||
nixosModules.default = { config, ... }: {
|
nixosModules.default = { config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./options.nix
|
./nixosModules/options.nix
|
||||||
|
./nixosModules/scripts.nix
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -41,12 +42,11 @@
|
|||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
users.${config.user} = {
|
users.${config.user} = {
|
||||||
imports = [
|
imports = [
|
||||||
self.homeManagerModules.default
|
self.homeManagerModules.default {
|
||||||
{ _module.args = { nixosConfig = config; }; }
|
user = config.user;
|
||||||
# self.homeManagerModules.default {
|
stateVersion = config.stateVersion;
|
||||||
# stateVersion = config.stateVersion;
|
}
|
||||||
# }
|
] ++ config.extraImports;
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,4 +42,10 @@
|
|||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable 1 password stuff";
|
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