mirror of
https://github.com/ItsDrike/nixdots
synced 2025-01-23 20:34:34 +00:00
Compare commits
6 commits
4e2a6e7757
...
904b64c6f4
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | 904b64c6f4 | ||
ItsDrike | 4ceafed0d0 | ||
ItsDrike | affd57d3cc | ||
ItsDrike | 9dd5d40494 | ||
ItsDrike | 6a16de8d16 | ||
ItsDrike | ad1a4bae0c |
|
@ -29,8 +29,10 @@ in
|
||||||
# These imports will be scoped under this key so all settings
|
# These imports will be scoped under this key so all settings
|
||||||
# in them will be added to `home-manager.users.${username}`..
|
# in them will be added to `home-manager.users.${username}`..
|
||||||
imports = [
|
imports = [
|
||||||
|
./misc
|
||||||
./packages
|
./packages
|
||||||
./programs
|
./programs
|
||||||
|
./impermanence
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
29
home/impermanence/default.nix
Normal file
29
home/impermanence/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
osConfig,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = osConfig.myOptions.system.impermanence.home;
|
||||||
|
in {
|
||||||
|
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.persistence."${cfg.persistentMountPoint}" = {
|
||||||
|
directories = [
|
||||||
|
".cache/nix"
|
||||||
|
".cache/nix-index"
|
||||||
|
] ++ cfg.extraDirectories;
|
||||||
|
|
||||||
|
files = [
|
||||||
|
|
||||||
|
] ++ cfg.extraFiles;
|
||||||
|
|
||||||
|
# Allow other users (such as root), to access files through the bind
|
||||||
|
# mounted directories listed in `directories`. Useful for `sudo` operations,
|
||||||
|
# Docker, etc. Requires NixOS configuration programs.fuse.userAllowOther = true;
|
||||||
|
allowOther = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
10
home/misc/dconf.nix
Normal file
10
home/misc/dconf.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
dconf.settings = {
|
||||||
|
# This is like a system-wide dark mode swithc that some apps respect
|
||||||
|
# Equivalent of the following dconf command:
|
||||||
|
# `conf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"`
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
color-scheme = "prefer-dark";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
5
home/misc/default.nix
Normal file
5
home/misc/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./dconf.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -37,7 +37,47 @@
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
|
|
||||||
# TODO: Impermanence
|
impermanence = {
|
||||||
|
root = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Some people use /nix/persist/system for this, leaving persistent files in /nix subvolume
|
||||||
|
# I much prefer using a standalone subvolume for this though.
|
||||||
|
persistentMountPoint = "/persist";
|
||||||
|
|
||||||
|
extraDirectories = [
|
||||||
|
"/var/log"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
enable = true;
|
||||||
|
persistentMountPoint = "/persist/home";
|
||||||
|
extraDirectories = [
|
||||||
|
"Downloads"
|
||||||
|
"Personal"
|
||||||
|
"Media"
|
||||||
|
"dots"
|
||||||
|
|
||||||
|
".local/share/gnupg"
|
||||||
|
".local/share/wakatime"
|
||||||
|
".local/share/nvim"
|
||||||
|
".local/state/nvim"
|
||||||
|
".local/share/zsh"
|
||||||
|
".local/cargo"
|
||||||
|
".local/go"
|
||||||
|
];
|
||||||
|
extraFiles = [
|
||||||
|
".config/git/git-credentials"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure automatic root subvolume wiping on boot from initrd
|
||||||
|
autoWipeBtrfs = {
|
||||||
|
enable = true;
|
||||||
|
devices."/dev/disk/by-label/NIXOS-FS".subvolumes = [ "root" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
device = {
|
device = {
|
||||||
|
|
|
@ -34,12 +34,6 @@
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" =
|
|
||||||
{ device = "/dev/disk/by-label/NIXOS-FS";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "subvol=home" "noatime" "compress=zstd:3" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/data" =
|
fileSystems."/data" =
|
||||||
{ device = "/dev/disk/by-label/NIXOS-FS";
|
{ device = "/dev/disk/by-label/NIXOS-FS";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
|
|
|
@ -34,6 +34,47 @@ in
|
||||||
Path to a persistent directory (usually a mount point to a
|
Path to a persistent directory (usually a mount point to a
|
||||||
standalone partition / subvolume), which will hold the persistent
|
standalone partition / subvolume), which will hold the persistent
|
||||||
system state files.
|
system state files.
|
||||||
|
|
||||||
|
This should point to the entire persistent partition, this setup
|
||||||
|
then expects this directory to contain `passwords` and `system` subdirectories.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
the Impermanence module for persisting important state directories.
|
||||||
|
|
||||||
|
This requires home-manager.
|
||||||
|
'';
|
||||||
|
|
||||||
|
extraFiles = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
example = literalExpression ''[".zshrc"]'';
|
||||||
|
description = ''
|
||||||
|
Additional files in home to link to persistent storage.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraDirectories = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
example = literalExpression ''["Downloads"]'';
|
||||||
|
description = ''
|
||||||
|
Additional directories in home to link to persistent storage.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
persistentMountPoint = mkOption {
|
||||||
|
default = "/persist/home";
|
||||||
|
description = ''
|
||||||
|
Path to a persistent directory (usually a mount point to a
|
||||||
|
standalone partition / subvolume), which will hold the persistent
|
||||||
|
system state files.
|
||||||
|
|
||||||
|
This does not expect any subdirectories, all of the persistent home files
|
||||||
|
will be put directly in here. The user should be the owner of this direcotry.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,6 +16,9 @@ in {
|
||||||
|
|
||||||
# gnome's keyring manager
|
# gnome's keyring manager
|
||||||
seahorse.enable = true;
|
seahorse.enable = true;
|
||||||
|
|
||||||
|
# registry for linux (thanks to Gnome)
|
||||||
|
dconf.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ in
|
||||||
"/etc/nixos" # NixOS configuration source
|
"/etc/nixos" # NixOS configuration source
|
||||||
"/etc/NetworkManager/system-connections" # saved network connections
|
"/etc/NetworkManager/system-connections" # saved network connections
|
||||||
"/var/db/sudo" # keeps track of who got the sudo lecture already
|
"/var/db/sudo" # keeps track of who got the sudo lecture already
|
||||||
|
# "/var/log" # I sometimes use a subvolume for this, added manually if not
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/bluetooth"
|
||||||
"/var/lib/systemd/coredump" # captured coredumps
|
"/var/lib/systemd/coredump" # captured coredumps
|
||||||
] ++ cfg.extraDirectories;
|
] ++ cfg.extraDirectories;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue