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