refactor(flake): modifications for readability
This commit is contained in:
46
flake.nix
46
flake.nix
@@ -19,18 +19,21 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nur = {
|
nur.url = github:nix-community/NUR;
|
||||||
url = github:nix-community/NUR;
|
nethack.url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
|
||||||
};
|
|
||||||
|
|
||||||
nethack = {
|
|
||||||
url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, nixvim, nethack, plasma-manager, nur, ... } @ inputs:
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
nixvim,
|
||||||
|
nethack,
|
||||||
|
plasma-manager,
|
||||||
|
nur,
|
||||||
|
...
|
||||||
|
} @ inputs:
|
||||||
let
|
let
|
||||||
inherit (self) outputs;
|
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
username = "andrey";
|
username = "andrey";
|
||||||
@@ -55,17 +58,28 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extractModule = { homeManagerModules, ... }: homeManagerModules."${lib.head (lib.attrNames homeManagerModules)}";
|
|
||||||
homeManagerModules = map extractModule [ nixvim nethack plasma-manager ];
|
makeHome = hostname:
|
||||||
makeHome = hostname: {
|
let
|
||||||
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration {
|
extractModules = map
|
||||||
|
(module:
|
||||||
|
let hm = module.homeManagerModules;
|
||||||
|
in hm.${lib.head (lib.attrNames hm)});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration
|
||||||
|
{
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
config.allowUnfree = true;
|
|
||||||
overlays = [ nur.overlay ];
|
overlays = [ nur.overlay ];
|
||||||
};
|
};
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
modules = homeManagerModules ++ [
|
modules = (extractModules [
|
||||||
|
nixvim
|
||||||
|
nethack
|
||||||
|
plasma-manager
|
||||||
|
]) ++ [
|
||||||
nur.hmModules.nur
|
nur.hmModules.nur
|
||||||
|
|
||||||
./home/${hostname}.nix
|
./home/${hostname}.nix
|
||||||
|
Reference in New Issue
Block a user