chore: improved folder setup, added modules and lib
This commit is contained in:
parent
2df11205d8
commit
f0248e4142
|
@ -78,6 +78,8 @@
|
|||
|
||||
stateVersion = "23.05";
|
||||
|
||||
extraLib = import ./nix/lib.nix inputs;
|
||||
|
||||
hosts = {
|
||||
patricknix = {
|
||||
type = "nixos";
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
../../../users/root
|
||||
|
||||
../../../nix/secrets.nix
|
||||
../../../modules/secrets.nix
|
||||
];
|
||||
age.identityPaths = ["/state/etc/ssh/ssh_host_ed25519_key"];
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
hyprland,
|
||||
stateVersion,
|
||||
config,
|
||||
extraLib,
|
||||
...
|
||||
}: {
|
||||
home-manager = {
|
||||
|
@ -17,6 +18,7 @@
|
|||
hyprland.homeManagerModules.default
|
||||
];
|
||||
extraSpecialArgs = {
|
||||
inherit extraLib;
|
||||
nixosConfig = config;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -22,12 +22,15 @@ in {
|
|||
pkgs = self.pkgs.${nodeMeta.system};
|
||||
specialArgs = {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (self) nodes stateVersion;
|
||||
inherit inputs;
|
||||
inherit nodeName;
|
||||
inherit nodeMeta;
|
||||
inherit (self) nodes stateVersion extraLib;
|
||||
inherit
|
||||
inputs
|
||||
nodeName
|
||||
nodePath
|
||||
;
|
||||
|
||||
inherit hyprland;
|
||||
inherit nodePath;
|
||||
|
||||
nixos-hardware = nixos-hardware.nixosModules;
|
||||
impermanence = impermanence.nixosModules;
|
||||
};
|
||||
|
|
13
nix/lib.nix
Normal file
13
nix/lib.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: {
|
||||
# some programs( such as steam do not work with bindmounts
|
||||
# additionally symlinks are a lot faster than bindmounts
|
||||
# ~ 2x faster in my tests
|
||||
impermanence.makeSymlinks = builtins.map (x: {
|
||||
directory = x;
|
||||
method = "symlink";
|
||||
});
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
config,
|
||||
lib,
|
||||
nixosConfig,
|
||||
extraLib,
|
||||
...
|
||||
}: {
|
||||
home.persistence."/state/${config.home.homeDirectory}" = with lib.lists; {
|
||||
|
@ -9,22 +10,12 @@
|
|||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
directories = let
|
||||
# some programs( such as steam do not work with bindmounts
|
||||
# additionally symlinks are a lot faster than bindmounts
|
||||
# ~ 2x faster in my tests
|
||||
makeSymLinks = x:
|
||||
builtins.map (x: {
|
||||
directory = x;
|
||||
method = "symlink";
|
||||
})
|
||||
x;
|
||||
in
|
||||
directories =
|
||||
# firefox cannot be a symlink as home manager refuses put files outside your $HOME
|
||||
optionals config.programs.firefox.enable [
|
||||
".mozilla"
|
||||
]
|
||||
++ makeSymLinks (
|
||||
++ extraLib.impermanence.makeSymlinks (
|
||||
optionals config.programs.atuin.enable [
|
||||
".local/share/atuin"
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue