mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
refactor: move impermanence config to application definition where possible
This commit is contained in:
parent
8990a63a1e
commit
69b0166a6b
8 changed files with 62 additions and 54 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
nixosConfig,
|
|
||||||
lib,
|
lib,
|
||||||
|
nixosConfig,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) optionals;
|
inherit (lib) optionals;
|
||||||
|
@ -20,17 +20,6 @@ in {
|
||||||
".cache/nix" # nix eval cache
|
".cache/nix" # nix eval cache
|
||||||
".cache/nix-index"
|
".cache/nix-index"
|
||||||
]
|
]
|
||||||
++ optionals config.programs.firefox.enable [
|
|
||||||
".cache/mozilla"
|
|
||||||
]
|
|
||||||
++ optionals config.programs.direnv.enable [
|
|
||||||
".local/share/direnv"
|
|
||||||
]
|
|
||||||
++ optionals config.programs.neovim.enable [
|
|
||||||
".local/share/nvim"
|
|
||||||
".local/state/nvim"
|
|
||||||
".cache/nvim"
|
|
||||||
]
|
|
||||||
++ optionals nixosConfig.hardware.nvidia.modesetting.enable [
|
++ optionals nixosConfig.hardware.nvidia.modesetting.enable [
|
||||||
".cache/nvidia" # GLCache
|
".cache/nvidia" # GLCache
|
||||||
]
|
]
|
||||||
|
@ -42,9 +31,7 @@ in {
|
||||||
[
|
[
|
||||||
".local/share/nix" # Repl history
|
".local/share/nix" # Repl history
|
||||||
]
|
]
|
||||||
++ optionals config.programs.firefox.enable [
|
# TODO away once atuin is gone
|
||||||
".mozilla"
|
|
||||||
]
|
|
||||||
++ optionals config.programs.atuin.enable [
|
++ optionals config.programs.atuin.enable [
|
||||||
".local/share/atuin"
|
".local/share/atuin"
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,4 +6,10 @@
|
||||||
vimdiffAlias = true;
|
vimdiffAlias = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.persistence."/state".directories = [
|
||||||
|
".local/share/nvim"
|
||||||
|
".local/state/nvim"
|
||||||
|
".cache/nvim"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ in {
|
||||||
home-manager.users.${myuser} = {
|
home-manager.users.${myuser} = {
|
||||||
imports = [
|
imports = [
|
||||||
../common
|
../common
|
||||||
|
./dev
|
||||||
./graphical
|
./graphical
|
||||||
./neovim
|
./neovim
|
||||||
|
|
||||||
./git.nix
|
./git.nix
|
||||||
./dev.nix
|
|
||||||
./gpg.nix
|
./gpg.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
home = {
|
|
||||||
extraOutputsToInstall = ["doc" "devdoc"];
|
|
||||||
file.gdbinit = {
|
|
||||||
target = ".gdbinit";
|
|
||||||
text = ''
|
|
||||||
set auto-load safe-path /
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
packages = with pkgs; [
|
|
||||||
git-lfs
|
|
||||||
d2
|
|
||||||
cloc
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
|
|
||||||
# Store layout configs in an XDG directory and not in a .direnv local directory
|
|
||||||
stdlib = ''
|
|
||||||
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
|
||||||
declare -A direnv_layout_dirs
|
|
||||||
direnv_layout_dir() {
|
|
||||||
echo "''${direnv_layout_dirs[$PWD]:=$(
|
|
||||||
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
|
||||||
echo -n "$PWD" | shasum | cut -d ' ' -f 1
|
|
||||||
)}"
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
nix-index.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
17
users/myuser/dev/default.nix
Normal file
17
users/myuser/dev/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
imports = [
|
||||||
|
./direnv.nix
|
||||||
|
./gdb.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home = {
|
||||||
|
extraOutputsToInstall = ["doc" "devdoc"];
|
||||||
|
packages = with pkgs; [
|
||||||
|
git-lfs
|
||||||
|
d2
|
||||||
|
cloc
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nix-index.enable = true;
|
||||||
|
}
|
22
users/myuser/dev/direnv.nix
Normal file
22
users/myuser/dev/direnv.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
programs.direnv = {
|
||||||
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
|
||||||
|
# Store layout configs in an XDG directory and not in a .direnv local directory
|
||||||
|
stdlib = ''
|
||||||
|
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
||||||
|
declare -A direnv_layout_dirs
|
||||||
|
direnv_layout_dir() {
|
||||||
|
echo "''${direnv_layout_dirs[$PWD]:=$(
|
||||||
|
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
||||||
|
echo -n "$PWD" | shasum | cut -d ' ' -f 1
|
||||||
|
)}"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
home.persistence."/state".directories = [
|
||||||
|
".local/share/direnv"
|
||||||
|
];
|
||||||
|
}
|
8
users/myuser/dev/gdb.nix
Normal file
8
users/myuser/dev/gdb.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
home.file.gdbinit = {
|
||||||
|
target = ".gdbinit";
|
||||||
|
text = ''
|
||||||
|
set auto-load safe-path /
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -150,7 +150,7 @@ in {
|
||||||
"dom.push.connection.enabled" = false;
|
"dom.push.connection.enabled" = false;
|
||||||
"dom.battery.enabled" = false; # you don't need to see my battery...
|
"dom.battery.enabled" = false; # you don't need to see my battery...
|
||||||
"dom.event.clipboardevents.enabled" = false; # the clipboard is mine, no info leak, except when i want to paste
|
"dom.event.clipboardevents.enabled" = false; # the clipboard is mine, no info leak, except when i want to paste
|
||||||
"dom.event.contextmenu.enabled" = false; # no disabling right-clicking..
|
# "dom.event.contextmenu.enabled" = false; # no disabling right-clicking..
|
||||||
};
|
};
|
||||||
|
|
||||||
search = {
|
search = {
|
||||||
|
@ -258,9 +258,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
home.persistence."/state".directories = [
|
home.persistence."/state".directories = [
|
||||||
|
".cache/mozilla"
|
||||||
"Downloads"
|
"Downloads"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.persistence."/persist".directories = [
|
||||||
|
".mozilla"
|
||||||
|
];
|
||||||
|
|
||||||
xdg.mimeApps.defaultApplications = {
|
xdg.mimeApps.defaultApplications = {
|
||||||
"text/html" = ["firefox.desktop"];
|
"text/html" = ["firefox.desktop"];
|
||||||
"text/xml" = ["firefox.desktop"];
|
"text/xml" = ["firefox.desktop"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue