Move hosts to using inputs

This commit is contained in:
Greg Hellings
2023-06-21 11:06:56 -05:00
parent 99c3efc191
commit ea78d26e8d
2 changed files with 13 additions and 15 deletions
+7 -9
View File
@@ -1,18 +1,16 @@
{
nixpkgs,
inputs,
overlays,
hm,
flake-utils,
...
}:
let
# I'm "greg" everywhere except Darwin where I'm "gregory.hellings"
user = system:
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "gregory.hellings" else "greg" );
( if ( inputs.nixstable.lib.hasSuffix "-darwin" system ) then "gregory.hellings" else "greg" );
home = system: username:
if username == "root" then "/root" else
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "/Users/${username}" else "/home/${username}" );
( if ( inputs.nixstable.lib.hasSuffix "-darwin" system ) then "/Users/${username}" else "/home/${username}" );
mkhome = {
system,
@@ -27,24 +25,24 @@ let
configDir = "${homeDirectory}/.config";
pkgs = import nixpkgs {
pkgs = import inputs.nixstable {
inherit overlays system;
config.allowUnfree = true;
config.xdg.configHome = configDir;
};
in hm.lib.homeManagerConfiguration rec {
in inputs.hm.lib.homeManagerConfiguration rec {
inherit pkgs;
modules = [
(import ./home.nix {
inherit pkgs gui gnome;
inherit inputs pkgs gui gnome;
inherit (pkgs) config lib stdenv;
})
cfg
];
};
in flake-utils.lib.eachDefaultSystem (system: {
in inputs.flake-utils.lib.eachDefaultSystem (system: {
gui = mkhome {
inherit system;
gui = true;
+6 -6
View File
@@ -1,20 +1,20 @@
{ nixstable, nixunstable, overlays, wsl, agenix, ... }:
{ inputs, overlays, ... }:
let
wsl = args: (unstable (args // { extraMods = [ wsl.nixosModules.wsl ]; }));
unstable = args: (machine (args // { channel = nixunstable; }));
wsl = args: (unstable (args // { extraMods = [ inputs.wsl.nixosModules.wsl ]; }));
unstable = args: (machine (args // { channel = inputs.nixunstable; }));
machine = {
system ? "x86_64-linux",
name,
channel ? nixstable,
channel ? inputs.nixstable,
extraMods ? []
}:
let
nixpkgs = channel;
in nixpkgs.lib.nixosSystem {
in inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{ nixpkgs.overlays = overlays; }
agenix.nixosModules.default
inputs.agenix.nixosModules.default
../modules-all
../modules-linux
./${name}