Set up more persistent directories
This commit is contained in:
parent
d93cb11e2f
commit
50152c3db8
27
README.md
27
README.md
|
@ -22,20 +22,19 @@ This repo's structure is based on the concept of hosts - individual machines con
|
||||||
|
|
||||||
## File structure
|
## File structure
|
||||||
|
|
||||||
| Location | Description |
|
| Location | Description |
|
||||||
| ---------------------------- | ---------------------------------------------------- |
|
| ---------------------------- | --------------------------------------------------- |
|
||||||
| [common](./common) | Configuration loaded on both nixos and home-manager |
|
| [common](./common) | Configuration loaded on both nixos and home-manager |
|
||||||
| [devshells](./devshells) | Nix shells |
|
| [devshells](./devshells) | Nix shells |
|
||||||
| [docs](./docs) | Additional documentation regarding my setup |
|
| [docs](./docs) | Additional documentation regarding my setup |
|
||||||
| [home](./home) | Home manager configurations |
|
| [home](./home) | Home manager configurations |
|
||||||
| [hosts/nixos](./hosts/nixos) | Nixos configurations |
|
| [hosts/nixos](./hosts/nixos) | Nixos configurations |
|
||||||
| [modules](./modules) | Custom generic/nixos/home-manager modules |
|
| [modules](./modules) | Custom generic/nixos/home-manager modules |
|
||||||
| [overlays](./overlays) | Nix overlays |
|
| [overlays](./overlays) | Nix overlays |
|
||||||
| [pkgs](./pkgs) | Nix packages |
|
| [pkgs](./pkgs) | Nix packages |
|
||||||
| [flake.nix](./flake.nix) | Nix flake entrypoint! |
|
| [flake.nix](./flake.nix) | Nix flake entrypoint! |
|
||||||
| [secrets.nix](./secrets.nix) | Agenix entrypoint |
|
| [secrets.nix](./secrets.nix) | Agenix entrypoint |
|
||||||
| [bootstrap](./bootstrap) | Shell for bootstrapping on non flake-enabled systems |
|
| [stylua.toml](./stylua.toml) | Lua formatter config for the repo |
|
||||||
| [stylua.toml](./stylua.toml) | Lua formatter config for the repo |
|
|
||||||
|
|
||||||
## Points of interest
|
## Points of interest
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
package = pkgs.iosevka;
|
package = pkgs.iosevka;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# monospace = {
|
||||||
|
# name = "Cascadia Code";
|
||||||
|
# package = pkgs.cascadia-code;
|
||||||
|
# };
|
||||||
|
|
||||||
sansSerif = {
|
sansSerif = {
|
||||||
name = "CMUSansSerif";
|
name = "CMUSansSerif";
|
||||||
package = pkgs.cm_unicode;
|
package = pkgs.cm_unicode;
|
||||||
|
|
|
@ -1481,11 +1481,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1700963402,
|
"lastModified": 1702242899,
|
||||||
"narHash": "sha256-JhkanLmYRLekGOysO6JpCWKPlgRoemHPzUrARCGBqYA=",
|
"narHash": "sha256-p2FmwhHlIW3V8YzlRu/bWCiKa2a9fSardt9Eh22JlWE=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "contrib",
|
"repo": "contrib",
|
||||||
"rev": "65e567a81176d39be7ce6513d1af23954f00cbec",
|
"rev": "740dbac96354c076a76b7cf6fe70dad150d21659",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -7,14 +7,5 @@
|
||||||
# Set up my custom imperanence wrapper
|
# Set up my custom imperanence wrapper
|
||||||
satellite.persistence = {
|
satellite.persistence = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# Actual data/media (eg: projects, images, videos, etc)
|
|
||||||
at.data.path = "/persist/data";
|
|
||||||
|
|
||||||
# App state I want to keep
|
|
||||||
at.state.path = "/persist/state";
|
|
||||||
|
|
||||||
# App state which I should be able to delete at any point
|
|
||||||
at.cache.path = "/persist/cache";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.gpg.enable = true;
|
programs.gpg.enable = true;
|
||||||
|
|
||||||
|
satellite.persistence.at.state.apps.gpg.directories = [ ".gnupg" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
programs.intray = {
|
programs.intray = {
|
||||||
enable = true;
|
enable = true;
|
||||||
data-dir = "/persist/state/home/adrielus/Intray";
|
data-dir = "/persist/state/home/adrielus/intray";
|
||||||
cache-dir = "/persist/local/cache/home/adrielus/Intray";
|
cache-dir = "/persist/local/cache/home/adrielus/intray";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
{ config, ... }: {
|
{ config, ... }: {
|
||||||
programs.smos = {
|
programs.smos = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
notify.enable = true;
|
||||||
notify = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
github = {
|
github = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -85,6 +85,7 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
cond = env.vscode.not_active(),
|
cond = env.vscode.not_active(),
|
||||||
|
enabled = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
# TODO(imperanence): handle persistence of things like harpoon, lazy, etc
|
|
||||||
{ pkgs, lib, config, inputs, ... }:
|
{ pkgs, lib, config, inputs, ... }:
|
||||||
let
|
let
|
||||||
# {{{ extraPackages
|
# {{{ extraPackages
|
||||||
|
@ -326,7 +325,7 @@ in
|
||||||
# }}}
|
# }}}
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ visual
|
# {{{ visual
|
||||||
# The line between `ui` and `visual is a bit rought. I currenlty mostly judge
|
# The line between `ui` and `visual` is a bit rought. I currenlty mostly judge
|
||||||
# it by vibe.
|
# it by vibe.
|
||||||
# {{{ indent-blankline
|
# {{{ indent-blankline
|
||||||
satellite.neovim.lazy.indent-blankline = {
|
satellite.neovim.lazy.indent-blankline = {
|
||||||
|
@ -665,4 +664,14 @@ in
|
||||||
# }}}
|
# }}}
|
||||||
# }}}
|
# }}}
|
||||||
# }}}
|
# }}}
|
||||||
|
# {{{ Persistence
|
||||||
|
satellite.persistence.at.state.apps.neovim.directories = [
|
||||||
|
".local/state/nvim"
|
||||||
|
"${config.xdg.dataHome}/nvim"
|
||||||
|
];
|
||||||
|
|
||||||
|
satellite.persistence.at.cache.apps.neovim.directories = [
|
||||||
|
"${config.xdg.cacheHome}/nvim"
|
||||||
|
];
|
||||||
|
# }}}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,19 @@
|
||||||
{ config, ... }: {
|
{ config, ... }: {
|
||||||
|
# {{{ Set up my custom imperanence wrapper
|
||||||
|
satellite.persistence = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Actual data/media (eg: projects, images, videos, etc)
|
||||||
|
at.data.path = "/persist/data";
|
||||||
|
at.data.prefixDirectories = false;
|
||||||
|
|
||||||
|
# App state I want to keep
|
||||||
|
at.state.path = "/persist/state";
|
||||||
|
|
||||||
|
# App state which I should be able to delete on a whim
|
||||||
|
at.cache.path = "/persist/local/cache";
|
||||||
|
};
|
||||||
|
# }}}
|
||||||
# {{{ XDG dirs
|
# {{{ XDG dirs
|
||||||
# The lack of "~/Desktop" and "~/Downloads" is intentional!
|
# The lack of "~/Desktop" and "~/Downloads" is intentional!
|
||||||
satellite.persistence.at.data.apps.main.directories = [
|
satellite.persistence.at.data.apps.main.directories = [
|
||||||
|
|
|
@ -16,9 +16,13 @@
|
||||||
# - look into swaylock or whatever people use
|
# - look into swaylock or whatever people use
|
||||||
# - multiple keyboard layouts
|
# - multiple keyboard layouts
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
NIXOS_OZONES_WL = "1";
|
||||||
|
};
|
||||||
|
|
||||||
home.packages =
|
home.packages =
|
||||||
let
|
let
|
||||||
# {{{ OCR
|
# {{{ OCR script
|
||||||
_ = lib.getExe;
|
_ = lib.getExe;
|
||||||
|
|
||||||
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||||
|
|
|
@ -3,19 +3,4 @@
|
||||||
|
|
||||||
# Arbitrary extra packages
|
# Arbitrary extra packages
|
||||||
home.packages = [ ];
|
home.packages = [ ];
|
||||||
|
|
||||||
# Set up my custom imperanence wrapper
|
|
||||||
satellite.persistence = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Actual data/media (eg: projects, images, videos, etc)
|
|
||||||
at.data.path = "/persist/data";
|
|
||||||
at.data.prefixDirectories = false;
|
|
||||||
|
|
||||||
# App state I want to keep
|
|
||||||
at.state.path = "/persist/state";
|
|
||||||
|
|
||||||
# App state which I should be able to delete at any point
|
|
||||||
at.cache.path = "/persist/local/cache";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,21 +52,6 @@
|
||||||
# Simlink some commonly modified dotfiles outside the store
|
# Simlink some commonly modified dotfiles outside the store
|
||||||
dev.enable = true;
|
dev.enable = true;
|
||||||
|
|
||||||
# Set up my custom imperanence wrapper
|
|
||||||
persistence = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# Actual data/media (eg: projects, images, videos, etc)
|
|
||||||
at.data.path = "/persist/data";
|
|
||||||
at.data.prefixDirectories = false;
|
|
||||||
|
|
||||||
# App state I want to keep
|
|
||||||
at.state.path = "/persist/state";
|
|
||||||
|
|
||||||
# App state which I should be able to delete on a whim
|
|
||||||
at.cache.path = "/persist/local/cache";
|
|
||||||
};
|
|
||||||
|
|
||||||
monitors = [{
|
monitors = [{
|
||||||
name = "eDP-1";
|
name = "eDP-1";
|
||||||
width = 1920;
|
width = 1920;
|
||||||
|
|
|
@ -9,7 +9,6 @@ let
|
||||||
inputs.agenix.nixosModules.default
|
inputs.agenix.nixosModules.default
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
inputs.nur.nixosModules.nur
|
inputs.nur.nixosModules.nur
|
||||||
inputs.impermanence.nixosModule
|
|
||||||
inputs.slambda.nixosModule
|
inputs.slambda.nixosModule
|
||||||
|
|
||||||
# {{{ self management
|
# {{{ self management
|
||||||
|
@ -40,10 +39,6 @@ in
|
||||||
imports = builtins.attrValues outputs.nixosModules ++ imports;
|
imports = builtins.attrValues outputs.nixosModules ++ imports;
|
||||||
|
|
||||||
# {{{ ad-hoc options
|
# {{{ ad-hoc options
|
||||||
# Allow non root users to specify the "allowOther" option.
|
|
||||||
# See [the imperanence readme](https://github.com/nix-community/impermanence#home-manager)
|
|
||||||
programs.fuse.userAllowOther = true;
|
|
||||||
|
|
||||||
# Customize tty colors
|
# Customize tty colors
|
||||||
stylix.targets.console.enable = true;
|
stylix.targets.console.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -1 +1,37 @@
|
||||||
{ }
|
# This file defines the "non-hardware dependent" part of opt-in persistence
|
||||||
|
# It imports impermanence, defines the basic persisted dirs, and ensures each
|
||||||
|
# users' home persist dir exists and has the right permissions
|
||||||
|
#
|
||||||
|
# It works even if / is tmpfs, btrfs snapshot, or even not ephemeral at all.
|
||||||
|
{ lib, inputs, config, ... }: {
|
||||||
|
imports = [ inputs.impermanence.nixosModules.impermanence ];
|
||||||
|
|
||||||
|
environment.persistence."/persist/state".directories = [
|
||||||
|
"/var/lib/systemd"
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/log"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Allow non root users to specify the "allowOther" option.
|
||||||
|
# See [the imperanence readme](https://github.com/nix-community/impermanence#home-manager)
|
||||||
|
programs.fuse.userAllowOther = true;
|
||||||
|
|
||||||
|
# {{{ Create home directories
|
||||||
|
systemd.tmpfiles.rules =
|
||||||
|
let
|
||||||
|
users = lib.filter (v: v != null) [
|
||||||
|
(config.users.users.adrielus or null)
|
||||||
|
(config.users.users.guest or null)
|
||||||
|
];
|
||||||
|
|
||||||
|
mkHomePersistFor = location: lib.forEach users
|
||||||
|
(user: "Q ${location}${user.home} ${user.homeMode} ${user.name} ${user.group} -");
|
||||||
|
in
|
||||||
|
lib.flatten [
|
||||||
|
(mkHomePersistFor "/persist/data")
|
||||||
|
(mkHomePersistFor "/persist/state")
|
||||||
|
(mkHomePersistFor "/persist/local/cache")
|
||||||
|
];
|
||||||
|
# }}}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,32 @@
|
||||||
let
|
let
|
||||||
user = "adrielus";
|
user = "adrielus";
|
||||||
group = "syncthing";
|
group = "syncthing";
|
||||||
|
dataDir = "/persist/data/syncthing";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
inherit user group;
|
inherit user group dataDir;
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
openDefaultPorts = true;
|
openDefaultPorts = true;
|
||||||
|
configDir = "/persist/state/home/adrielus/syncthing/.config/syncthing";
|
||||||
configDir = "/persist/state/home/adrielus/Syncthing/.config/syncthing";
|
|
||||||
dataDir = "/persist/data/syncthing";
|
|
||||||
|
|
||||||
overrideDevices = true;
|
overrideDevices = true;
|
||||||
overrideFolders = true;
|
overrideFolders = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
# {{{ Device ids
|
||||||
devices = {
|
devices = {
|
||||||
enceladus.id = "QWOAERM-V2FNXPI-TB7NFUS-LKW7JTB-IZY4OEZ-FYDPJNP-6IKPW4Y-YREXDQM";
|
enceladus.id = "QWOAERM-V2FNXPI-TB7NFUS-LKW7JTB-IZY4OEZ-FYDPJNP-6IKPW4Y-YREXDQM";
|
||||||
lapetus.id = "VVHM7RC-ZSDOZJI-EGBIJR4-2DOGAXG-OEJZWSH-OYUK5XT-7CDMWSL-3AVM2AZ";
|
lapetus.id = "VVHM7RC-ZSDOZJI-EGBIJR4-2DOGAXG-OEJZWSH-OYUK5XT-7CDMWSL-3AVM2AZ";
|
||||||
tethys.id = "NGHX5G4-IY3ZXL2-NQMMRQV-2GDQLC6-LIDWSNG-DAJUAQH-KBAP64V-55K2LQ6";
|
tethys.id = "NGHX5G4-IY3ZXL2-NQMMRQV-2GDQLC6-LIDWSNG-DAJUAQH-KBAP64V-55K2LQ6";
|
||||||
};
|
};
|
||||||
|
# }}}
|
||||||
|
|
||||||
extraOptions.options.crashReportingEnabled = false;
|
extraOptions.options.crashReportingEnabled = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# I'm not sure this is needed anymore, I just know I got some ownership errors at some point.
|
||||||
|
systemd.tmpfiles.rules = [ "d ${dataDir} - ${user} ${group} -" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
# Set default shell
|
# Set default shell
|
||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
|
|
||||||
|
# Picked up by our persistence module
|
||||||
|
homeMode = "755";
|
||||||
|
|
||||||
# Add user to the following groups
|
# Add user to the following groups
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel" # Access to sudo
|
"wheel" # Access to sudo
|
||||||
|
|
Loading…
Reference in a new issue