clean up flake inputs and allow standalone home-manager

closes #11
This commit is contained in:
Noah Masur 2022-10-30 20:14:41 -04:00
parent b15cd8c0b6
commit 2d10939285
8 changed files with 47 additions and 18 deletions

View File

@ -61,27 +61,31 @@
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in { in rec {
nixosConfigurations = with inputs; { nixosConfigurations = {
desktop = import ./hosts/desktop { desktop = import ./hosts/desktop { inherit inputs globals; };
inherit nixpkgs home-manager nur globals wallpapers; wsl = import ./hosts/wsl { inherit inputs globals; };
}; oracle = import ./hosts/oracle { inherit inputs globals; };
wsl = import ./hosts/wsl { inherit nixpkgs wsl home-manager globals; };
oracle =
import ./hosts/oracle { inherit nixpkgs home-manager globals; };
}; };
darwinConfigurations = with inputs; { darwinConfigurations = {
macbook = import ./hosts/macbook { macbook = import ./hosts/macbook { inherit inputs globals; };
inherit nixpkgs darwin home-manager nur globals; };
};
# For quickly applying local settings with:
# home-manager switch --flake .#desktop
homeConfigurations = {
desktop =
nixosConfigurations.desktop.config.home-manager.users.${globals.user}.home;
macbook =
darwinConfigurations.macbook.config.home-manager.users."Noah.Masur".home;
}; };
# Package servers into images with a generator # Package servers into images with a generator
packages.x86_64-linux = with inputs; { packages.x86_64-linux = with inputs; {
aws = import ./hosts/aws { aws = import ./hosts/aws {
inherit nixpkgs nixos-generators home-manager globals; inherit inputs globals;
system = "x86_64-linux"; system = "x86_64-linux";
}; };
}; };

View File

@ -1,4 +1,6 @@
{ nixpkgs, system, nixos-generators, home-manager, globals, ... }: { inputs, globals, ... }:
with inputs;
nixos-generators.nixosGenerate { nixos-generators.nixosGenerate {
inherit system; inherit system;

View File

@ -1,4 +1,6 @@
{ nixpkgs, home-manager, nur, globals, wallpapers, ... }: { inputs, globals, ... }:
with inputs;
# System configuration for my desktop # System configuration for my desktop
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {

View File

@ -1,4 +1,6 @@
{ nixpkgs, darwin, home-manager, nur, globals, ... }: { inputs, globals, ... }:
with inputs;
# System configuration for my work MacBook # System configuration for my work MacBook
darwin.lib.darwinSystem { darwin.lib.darwinSystem {

View File

@ -1,4 +1,6 @@
{ nixpkgs, home-manager, globals, ... }: { inputs, globals, ... }:
with inputs;
# System configuration for an Oracle free server # System configuration for an Oracle free server

View File

@ -1,4 +1,6 @@
{ nixpkgs, wsl, home-manager, globals, ... }: { inputs, globals, ... }:
with inputs;
# System configuration for WSL # System configuration for WSL
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {

View File

@ -18,6 +18,13 @@
commandline --function execute commandline --function execute
''; '';
}; };
rebuild-home = lib.mkForce {
body = ''
git -C ${config.dotfilesPath} add --intent-to-add --all
commandline -r ${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName}";
commandline --function execute
'';
};
}; };
}; };

View File

@ -12,6 +12,7 @@
nixh = "man home-configuration.nix"; nixh = "man home-configuration.nix";
nr = "rebuild-nixos"; nr = "rebuild-nixos";
nro = "rebuild-nixos offline"; nro = "rebuild-nixos offline";
hm = "rebuild-home";
}; };
functions = { functions = {
nix-shell-run = { nix-shell-run = {
@ -43,6 +44,13 @@
commandline --function execute commandline --function execute
''; '';
}; };
rebuild-home = {
body = ''
git -C ${config.dotfilesPath} add --intent-to-add --all
commandline -r "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName}";
commandline --function execute
'';
};
}; };
}; };