chore: reworked extraLib

This commit is contained in:
Patrick Großmann 2023-08-26 19:38:32 +09:00
parent 34c1e952c5
commit 21c5f9d77e
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 19 additions and 18 deletions

View file

@ -79,8 +79,6 @@
stateVersion = "23.05";
extraLib = import ./nix/lib.nix inputs;
hosts = {
patricknix = {
type = "nixos";
@ -97,6 +95,7 @@
}
// flake-utils.lib.eachDefaultSystem (system: rec {
pkgs = import nixpkgs {
overlays = [(import nix/lib.nix inputs)];
inherit system;
# TODO fix this to only allow specific unfree packages
config.allowUnfree = true;

View file

@ -3,7 +3,7 @@
hyprland,
stateVersion,
config,
extraLib,
pkgs,
...
}: {
home-manager = {
@ -18,7 +18,6 @@
hyprland.homeManagerModules.default
];
extraSpecialArgs = {
inherit extraLib;
nixosConfig = config;
};
};

View file

@ -21,8 +21,8 @@ in {
inherit (nodeMeta) system;
pkgs = self.pkgs.${nodeMeta.system};
specialArgs = {
inherit (nixpkgs) lib;
inherit (self) nodes stateVersion extraLib;
inherit (self.pkgs.${nodeMeta.system}) lib;
inherit (self) nodes stateVersion;
inherit
inputs
nodeName

View file

@ -2,7 +2,10 @@
self,
nixpkgs,
...
}: {
}: self: super: {
lib =
super.lib
// {
# some programs( such as steam do not work with bindmounts
# additionally symlinks are a lot faster than bindmounts
# ~ 2x faster in my tests
@ -10,4 +13,5 @@
directory = x;
method = "symlink";
});
};
}

View file

@ -3,7 +3,6 @@
config,
lib,
nixosConfig,
extraLib,
...
}: {
home.persistence."/state/${config.home.homeDirectory}" = with lib.lists; {
@ -16,7 +15,7 @@
optionals config.programs.firefox.enable [
".mozilla"
]
++ extraLib.impermanence.makeSymlinks (
++ pkgs.lib.impermanence.makeSymlinks (
optionals config.programs.atuin.enable [
".local/share/atuin"
]

View file

@ -1,12 +1,12 @@
{
config,
extraLib,
pkgs,
...
}: {
home = {
persistence."/state/${config.home.homeDirectory}" = {
allowOther = true;
directories = extraLib.impermanence.makeSymlinks [
directories = pkgs.lib.impermanence.makeSymlinks [
"repos"
"Downloads"