Merge branch 'main' of github.com:bloxx12/nichts
This commit is contained in:
commit
90cc4f9ca9
4 changed files with 68 additions and 60 deletions
|
@ -14,7 +14,6 @@
|
|||
|
||||
# Unstable nixpkgs baby!
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
# Lix, a faster nix fork.
|
||||
lix-module = {
|
||||
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
printing.enable = true;
|
||||
};
|
||||
|
||||
meta = {
|
||||
users = ["vali"];
|
||||
# mainUser = "vali";
|
||||
};
|
||||
modules = {
|
||||
system = {
|
||||
hardware = {
|
||||
|
@ -43,6 +47,7 @@
|
|||
eza.enable = true;
|
||||
firefox.enable = true;
|
||||
spotify.enable = true;
|
||||
starship.enable = true;
|
||||
zellij.enable = true;
|
||||
terminals = {
|
||||
foot.enable = true;
|
||||
|
|
|
@ -71,7 +71,9 @@ in {
|
|||
sound = {
|
||||
enable = mkEnableOption "sound related programs and audio-dependent programs";
|
||||
};
|
||||
|
||||
impermanence = {
|
||||
enable = mkEnableOption "Enable Impermanence";
|
||||
};
|
||||
video = {
|
||||
enable = mkEnableOption "video drivers and programs that require a graphical user interface";
|
||||
nvidia = mkEnableOption "Nvidia graphics drivers";
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkForce;
|
||||
inherit (lib) mkIf mkForce;
|
||||
inherit (builtins) map;
|
||||
|
||||
cfg = config.modules.system.impermanence;
|
||||
|
@ -12,69 +12,71 @@ in {
|
|||
imports = [
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
];
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
config = mkIf cfg.enable {
|
||||
users = {
|
||||
cr = {
|
||||
hashedPasswordFile = "/persist/passwords/cr";
|
||||
mutableUsers = false;
|
||||
users = {
|
||||
cr = {
|
||||
hashedPasswordFile = "/persist/passwords/cr";
|
||||
};
|
||||
root.hashedPasswordFile = "/persist/passwords/root";
|
||||
};
|
||||
root.hashedPasswordFile = "/persist/passwords/root";
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
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"
|
||||
environment.persistence."/persist" = {
|
||||
enable = true;
|
||||
hideMounts = true;
|
||||
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"
|
||||
]
|
||||
++ map (
|
||||
dir: ".config/${dir}"
|
||||
) ["nicotine" "Signal" "Nextcloud" "emacs" "doom"]
|
||||
++ map (
|
||||
dir: ".cache/${dir}"
|
||||
) ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "zsh" "nvim"]
|
||||
++ map (
|
||||
dir: ".local/share/${dir}"
|
||||
) ["direnv" "Steam" "TelegramDesktop" "PrismLauncher" "nicotine" "zoxide" ".ssh" ".keepass"];
|
||||
};
|
||||
};
|
||||
|
||||
# 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"
|
||||
];
|
||||
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
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";
|
||||
}
|
||||
];
|
||||
users.cr = {
|
||||
directories =
|
||||
[
|
||||
"cloud"
|
||||
"repos"
|
||||
]
|
||||
++ map (
|
||||
dir: ".config/${dir}"
|
||||
) ["nicotine" "Signal" "Nextcloud" "emacs" "doom"]
|
||||
++ map (
|
||||
dir: ".cache/${dir}"
|
||||
) ["tealdeer" "keepassxc" "nix" "starship" "nix-index" "mozilla" "zsh" "nvim"]
|
||||
++ map (
|
||||
dir: ".local/share/${dir}"
|
||||
) ["direnv" "Steam" "TelegramDesktop" "PrismLauncher" "nicotine" "zoxide" ".ssh" ".keepass"];
|
||||
};
|
||||
};
|
||||
|
||||
# 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";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue