From ea78d26e8d8a6e43b701121f93c59695d29194e3 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 21 Jun 2023 10:58:40 -0500 Subject: [PATCH] Move hosts to using inputs --- home/default.nix | 16 +++++++--------- hosts/default.nix | 12 ++++++------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/home/default.nix b/home/default.nix index a35dc81..a2c9bc9 100644 --- a/home/default.nix +++ b/home/default.nix @@ -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; diff --git a/hosts/default.nix b/hosts/default.nix index 7f55841..9ce016d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -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}