huge progress dump, impermanence

This commit is contained in:
Charlie Root 2024-09-20 15:45:44 +02:00
commit fce64637c2
13 changed files with 161 additions and 81 deletions

76
flake.lock generated
View file

@ -20,11 +20,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1725753098, "lastModified": 1726665257,
"narHash": "sha256-/NO/h/qD/eJXAQr/fHA4mdDgYsNT9thHQ+oT6KPi2ac=", "narHash": "sha256-rEzEZtd3iyVo5RJ1OGujOlnywNf3gsrOnjAn1NLciD4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "e4a13203112a036fc7f437d391c7810f3dd5ab52", "rev": "752d0fbd141fabb5a1e7f865199b80e6e76f8d8e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -83,11 +83,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1726420326, "lastModified": 1726765163,
"narHash": "sha256-LzYMStC49yhT4rKyG3oA+/rqip0JsEPCPD0AZlWZqcA=", "narHash": "sha256-5aX2+iWFzH9b4yVSGMk2w/tDI0c/cn8f1xW6/kurtPo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "8da0dcb09e0f890d2a9fbc8c6bb947c6867a5b5f", "rev": "a1ca2766ae9535f16bcac91f7001d24a6837178b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -208,11 +208,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1726560853,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -313,11 +313,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1726394915, "lastModified": 1726708551,
"narHash": "sha256-guDSphIBbkUGI9LQDAls4PUDDJFl9URC0EAUKb+sjks=", "narHash": "sha256-2mFUjYNMPftdhR8DNCCsrV6edCOx/bTzlEE3w9gmK8Q=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "5ce77de0dc7106c6f1460d80a3c5a51eaea3108c", "rev": "9f93de5a4b2b52a1a153f4ea5eacfc1a63600496",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -360,11 +360,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726357542, "lastModified": 1726764199,
"narHash": "sha256-p4OrJL2weh0TRtaeu1fmNYP6+TOp/W2qdaIJxxQay4c=", "narHash": "sha256-aiw08ZK7PBVwnOglT0rk+VI3ZqPgbFlOWP7SCFb8sHA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e524c57b1fa55d6ca9d8354c6ce1e538d2a1f47f", "rev": "1f7b8188a9c9c5ba32f9a8351c55f42ecc22b77c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -435,11 +435,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1726421106, "lastModified": 1726761214,
"narHash": "sha256-pVqU8PBLVwJntSRd7BbhddSeeT/UWpARDO50zJSLnP4=", "narHash": "sha256-xaecVNHaxiAXDCUFZzDLMP3jbxpBjQTqT4Bku2z5vGA=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "e87758529e9d2dc70f318346c66a9d895d4503ce", "rev": "9856378384539e35cd943604e6a4d696a9d25447",
"revCount": 5223, "revCount": 5240,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@ -788,11 +788,11 @@
"zig": "zig" "zig": "zig"
}, },
"locked": { "locked": {
"lastModified": 1726250048, "lastModified": 1726482513,
"narHash": "sha256-2Lef4s1k5xBlmJ3ZFy2qS3S00j6oDl8ZXzSaSuAX22k=", "narHash": "sha256-vc8YmzpybRaffbYMBCdCZTJrneyF3ko7D5MPNpAxz2A=",
"owner": "notashelf", "owner": "notashelf",
"repo": "nvf", "repo": "nvf",
"rev": "eb037b7bff62171004e9276d4efb9be7e7ce9d8e", "rev": "cb7ff874e2199ba8a4f87cbaa39bdff0d4d28484",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -870,11 +870,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1726243404, "lastModified": 1726463316,
"narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=", "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059", "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -928,11 +928,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1726320982, "lastModified": 1726447378,
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1008,11 +1008,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1726243404, "lastModified": 1726463316,
"narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=", "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059", "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1024,16 +1024,16 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1725103162, "lastModified": 1726481836,
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", "narHash": "sha256-MWTBH4dd5zIz2iatDb8IkqSjIeFum9jAqkFxgHLdzO4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", "rev": "20f9370d5f588fb8c72e844c54511cab054b5f40",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -2941,11 +2941,11 @@
"nixpkgs": "nixpkgs_7" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1725271838, "lastModified": 1726734507,
"narHash": "sha256-VcqxWT0O/gMaeWTTjf1r4MOyG49NaNxW4GHTO3xuThE=", "narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "9fb342d14b69aefdf46187f6bb80a4a0d97007cd", "rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -73,8 +73,7 @@
other = { other = {
system = { system = {
hostname = "temperance"; hostname = "temperance";
username = "vali"; username = "cr";
gitPath = "/home/vali/projects/nichts";
}; };
home-manager = { home-manager = {

View file

@ -4,5 +4,6 @@ _: {
./programs.nix ./programs.nix
./hardware-configuration.nix ./hardware-configuration.nix
./hardware ./hardware
./filesystem
]; ];
} }

View file

@ -0,0 +1,35 @@
{
config = {
fileSystems = {
"/boot" = {
device = "";
fsType = "vfat";
};
# root on tmpfs
"/" = {
device = "none";
fsType = "tmpfs";
options = ["defaults" "size=25%" "mode=755"];
};
"/nix" = {
device = "";
fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"];
};
"/persist" = {
device = "";
neededForBoot = true;
fsType = "btrfs";
options = ["subvol=persist" "compress=zstd" "noatime"];
};
"/home" = {
device = "";
fsType = "btrfs";
options = ["subvol=home" "compress=zstd" "noatime"];
};
};
swapDevices = [
{device = "";}
];
};
}

View file

@ -3,8 +3,6 @@
alsa-utils alsa-utils
asciinema asciinema
blueman blueman
bluetuith
bluez
cachix cachix
calc calc
calibre calibre
@ -55,6 +53,7 @@
polkit polkit
prismlauncher prismlauncher
pulsemixer pulsemixer
pavucontrol
python3 python3
qbittorrent qbittorrent
r2modman r2modman

View file

@ -32,7 +32,7 @@ in {
]; ];
services.emacs = { services.emacs = {
enable = false; enable = true;
package = custom-emacs; package = custom-emacs;
}; };
}; };

View file

@ -7,7 +7,7 @@
}: let }: let
cfg = config.modules.system.programs.editors.helix; cfg = config.modules.system.programs.editors.helix;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
inherit (lib) mkIf; inherit (lib) mkIf getExe;
in { in {
imports = [./languages.nix]; imports = [./languages.nix];
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -39,7 +39,7 @@ in {
}; };
}; };
keys.normal = { keys.normal = {
C-g = [":new" ":insert-output ${pkgs.gitui}" ":buffer-close!" ":redraw"]; C-g = [":new" ":insert-output ${getExe pkgs.lazygit}" ":buffer-close!" ":redraw"];
esc = ["collapse_selection" "keep_primary_selection"]; esc = ["collapse_selection" "keep_primary_selection"];
A-H = "goto_previous_buffer"; A-H = "goto_previous_buffer";
A-L = "goto_next_buffer"; A-L = "goto_next_buffer";

View file

@ -7,6 +7,5 @@ _: {
./dunst.nix ./dunst.nix
./mpd.nix ./mpd.nix
./firewall.nix ./firewall.nix
./vpn.nix
]; ];
} }

View file

@ -1,12 +0,0 @@
{pkgs, ...}: {
services.openvpn.servers = {
# air = {
# config = ''
# config /home/vali/Documents/AirVPN_Netherlands_UDP-443-Entry3.ovpn
# script-security 2
# up ${pkgs.update-systemd-resolved}/libexec/openvpn/update-systemd-resolved
# down ${pkgs.update-systemd-resolved}/libexec/openvpn/update-systemd-resolved
# '';
# };
};
}

View file

@ -16,6 +16,7 @@ in {
home-manager.users.${username}.home.packages = with pkgs; [ home-manager.users.${username}.home.packages = with pkgs; [
bluetuith bluetuith
bluez
]; ];
}; };
} }

View file

@ -125,8 +125,7 @@
"https://cache.nixos.org" # funny binary cache "https://cache.nixos.org" # funny binary cache
"https://nix-community.cachix.org" # nix-community cache "https://nix-community.cachix.org" # nix-community cache
"https://hyprland.cachix.org" # hyprland "https://hyprland.cachix.org" # hyprland
"https://nixpkgs-unfree.cachix.org" # unfree-package cache # "https://nixpkgs-unfree.cachix.org" # unfree-package cache
"https://neovim-flake.cachix.org" # a cache for nvf
"https://helix.cachix.org" # a chache for helix "https://helix.cachix.org" # a chache for helix
]; ];

View file

@ -4,29 +4,77 @@
lib, lib,
... ...
}: let }: let
inherit (lib) optionalString mkIf mkForce; inherit (lib) mkForce;
inherit (builtins) map;
cfg = config.modules.system.impermanence; cfg = config.modules.system.impermanence;
in { in {
# config = mkIf false { imports = [
# imports = [ inputs.impermanence.nixosModules.impermanence
# inputs.impermanence.nixosModules.impermanence ];
# ]; users = {
# environment.persistence."/persist" = { mutableUsers = true;
# directories = [ # users = {
# "/etc/nixos" # cr = {
# "/etc/nix" # initialHashedPassword = "";
# "/etc/NetworkManager/system-connections" # hashedPasswordFile = "/persist/passwords/cr";
# "/var/db/sudo" # };
# "/var/lib/bluetooth" # root.hashedPasswordFile = "/persist/passwords/root";
# "/var/lib/nixos" # };
# "/var/lib/pipewire" };
# "/var/lib/systemd/coredump"
# ];
# files = [ environment.persistence."/persist" = {
# "/etc/machine-id" directories = [
# ]; "/etc/nixos"
# }; "/etc/nix"
# }; "/etc/NetworkManager/system-connections"
"/var/db/sudo"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/pipewire"
"/var/lib/systemd/coredump"
];
files = [
"/etc/machine-id"
];
users.cr = {
directories =
[
"cloud"
"repos"
".config/nicotine"
]
++ map (
dir: ".config/${dir}"
) ["nicotine" "Signal"]
++ map (
dir: ".cache/${dir}"
) ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "zsh" "nvim"]
++ map (
dir: ".local/share/${dir}"
) ["direnv" "TelegramDesktop" "PrismLauncher" "nicotine" "zoxide"];
};
};
# for some reason *this* is what makes networkmanager not get screwed completely instead of the impermanence module
systemd.tmpfiles.rules = [
"L /var/lib/NetworkManager/secret_key - - - - /persist/var/lib/NetworkManager/secret_key"
"L /var/lib/NetworkManager/seen-bssids - - - - /persist/var/lib/NetworkManager/seen-bssids"
"L /var/lib/NetworkManager/timestamps - - - - /persist/var/lib/NetworkManager/timestamps"
];
# services.openssh.hostKeys = mkForce [
# {
# bits = 4096;
# path = "/persist/etc/ssh/ssh_host_rsa_key";
# type = "rsa";
# }
# {
# bits = 4096;
# path = "/persist/etc/ssh/ssh_host_ed25519_key";
# type = "ed25519";
# }
# ];
} }

View file

@ -1,6 +1,17 @@
let starship_installed = not (which starship | is-empty) let starship_installed = not (which starship | is-empty)
let direnv_installed = not (which direnv | is-empty)
$env.config = { $env.config = {
show_banner: false show_banner: false
hooks: {
pre_prompt: [{ ||
if $direnv_installed {
direnv export json | from json | default {} | load-env
} else { return }
}]
}
} }