working-ish, not all options

This commit is contained in:
John Lancaster
2025-07-01 23:16:12 -05:00
parent 9b4f75126e
commit 8b48ed06e2
3 changed files with 30 additions and 8 deletions

View File

@@ -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;
};
};
};

View File

@@ -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
View 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
'')
];
}