Move hosts to using inputs
This commit is contained in:
+7
-9
@@ -1,18 +1,16 @@
|
|||||||
{
|
{
|
||||||
nixpkgs,
|
inputs,
|
||||||
overlays,
|
overlays,
|
||||||
hm,
|
|
||||||
flake-utils,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# I'm "greg" everywhere except Darwin where I'm "gregory.hellings"
|
# I'm "greg" everywhere except Darwin where I'm "gregory.hellings"
|
||||||
user = system:
|
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:
|
home = system: username:
|
||||||
if username == "root" then "/root" else
|
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 = {
|
mkhome = {
|
||||||
system,
|
system,
|
||||||
@@ -27,24 +25,24 @@ let
|
|||||||
|
|
||||||
configDir = "${homeDirectory}/.config";
|
configDir = "${homeDirectory}/.config";
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import inputs.nixstable {
|
||||||
inherit overlays system;
|
inherit overlays system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
config.xdg.configHome = configDir;
|
config.xdg.configHome = configDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
in hm.lib.homeManagerConfiguration rec {
|
in inputs.hm.lib.homeManagerConfiguration rec {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
(import ./home.nix {
|
(import ./home.nix {
|
||||||
inherit pkgs gui gnome;
|
inherit inputs pkgs gui gnome;
|
||||||
inherit (pkgs) config lib stdenv;
|
inherit (pkgs) config lib stdenv;
|
||||||
})
|
})
|
||||||
cfg
|
cfg
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
in flake-utils.lib.eachDefaultSystem (system: {
|
in inputs.flake-utils.lib.eachDefaultSystem (system: {
|
||||||
gui = mkhome {
|
gui = mkhome {
|
||||||
inherit system;
|
inherit system;
|
||||||
gui = true;
|
gui = true;
|
||||||
|
|||||||
+6
-6
@@ -1,20 +1,20 @@
|
|||||||
{ nixstable, nixunstable, overlays, wsl, agenix, ... }:
|
{ inputs, overlays, ... }:
|
||||||
let
|
let
|
||||||
wsl = args: (unstable (args // { extraMods = [ wsl.nixosModules.wsl ]; }));
|
wsl = args: (unstable (args // { extraMods = [ inputs.wsl.nixosModules.wsl ]; }));
|
||||||
unstable = args: (machine (args // { channel = nixunstable; }));
|
unstable = args: (machine (args // { channel = inputs.nixunstable; }));
|
||||||
machine = {
|
machine = {
|
||||||
system ? "x86_64-linux",
|
system ? "x86_64-linux",
|
||||||
name,
|
name,
|
||||||
channel ? nixstable,
|
channel ? inputs.nixstable,
|
||||||
extraMods ? []
|
extraMods ? []
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nixpkgs = channel;
|
nixpkgs = channel;
|
||||||
in nixpkgs.lib.nixosSystem {
|
in inputs.nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
{ nixpkgs.overlays = overlays; }
|
{ nixpkgs.overlays = overlays; }
|
||||||
agenix.nixosModules.default
|
inputs.agenix.nixosModules.default
|
||||||
../modules-all
|
../modules-all
|
||||||
../modules-linux
|
../modules-linux
|
||||||
./${name}
|
./${name}
|
||||||
|
|||||||
Reference in New Issue
Block a user