From 1f0a61f56ed9b970d94e73049dd52bd4dcc6cf93 Mon Sep 17 00:00:00 2001 From: TheCrazyInsanity Date: Tue, 16 Dec 2025 12:55:40 -0500 Subject: [PATCH] lowkey kirking it --- flake.lock | 16 ++++ flake.nix | 2 + global/default.nix | 53 ++++++++--- global/eraseyourdarlings.nix | 126 ++++++++++++------------- machines/workstation/configuration.nix | 37 ++++---- 5 files changed, 140 insertions(+), 94 deletions(-) diff --git a/flake.lock b/flake.lock index 27ebc41..8dfe8a8 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1737831083, + "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1764950072, @@ -40,6 +55,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "impermanence": "impermanence", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 3f6768e..ff4e681 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; impermanence.url = "github:nix-community/impermanence"; + # nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.6.0"; }; outputs = @@ -20,6 +21,7 @@ nixpkgs, home-manager, impermanence, + # nix-flatpak, }@inputs: let inherit (self) outputs; diff --git a/global/default.nix b/global/default.nix index 11ac1cd..39f4411 100644 --- a/global/default.nix +++ b/global/default.nix @@ -1,16 +1,23 @@ # This is for global config I DEFINITELY want on all machines, this should only include basic utilities and be relatively small. # There is no order for where things are in this, it's a little messy. -{pkgs, ...}: +{ pkgs, nix-flatpak, ... }: { + imports = [ + # nix-flatpak.nixosModules.nix-flatpak + ]; + # Lix - nixpkgs.overlays = [ (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena; - }) ]; + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; nix.package = pkgs.lixPackageSets.stable.lix; # 🇺🇸 @@ -55,10 +62,27 @@ users.users.laythe = { isNormalUser = true; description = "laythe"; - extraGroups = [ "networkmanager" "wheel" "docker" "adbusers" "jackaudio" "podman" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + "adbusers" + "jackaudio" + "podman" + ]; #To make podman work - subUidRanges = [{ startUid = 100000; count = 65536; }]; - subGidRanges = [{ startGid = 100000; count = 65536; }]; + subUidRanges = [ + { + startUid = 100000; + count = 65536; + } + ]; + subGidRanges = [ + { + startGid = 100000; + count = 65536; + } + ]; }; programs.appimage = { @@ -126,5 +150,8 @@ package = pkgs.usbmuxd2; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; -} \ No newline at end of file + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +} diff --git a/global/eraseyourdarlings.nix b/global/eraseyourdarlings.nix index 8a67cda..c5f354a 100644 --- a/global/eraseyourdarlings.nix +++ b/global/eraseyourdarlings.nix @@ -1,73 +1,73 @@ -{lib, ...}: +{ lib, ... }: { boot.initrd.postResumeCommands = lib.mkAfter '' rm -rf /bin /etc /lib64 /srv /sys /tmp /usr /var - '' - - { - environment.persistence."/persistent" = { - enable = true; # NB: Defaults to true, not needed - hideMounts = true; + ''; + # impermanence + environment.persistence."/persistent" = { + enable = true; # NB: Defaults to true, not needed + hideMounts = true; + directories = [ + "/var/log" + "/var/lib/bluetooth" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + "/etc/NetworkManager/system-connections" + "/etc/nixos" + "/var/lib/flatpak" + { + directory = "/var/lib/colord"; + user = "colord"; + group = "colord"; + mode = "u=rwx,g=rx,o="; + } + ]; + files = [ + "/etc/machine-id" + { + file = "/var/keys/secret_file"; + parentDirectory = { + mode = "u=rwx,g=,o="; + }; + } + ]; + users.laythe = { directories = [ - "/var/log" - "/var/lib/bluetooth" - "/var/lib/nixos" - "/var/lib/systemd/coredump" - "/etc/NetworkManager/system-connections" + "Downloads" + "Music" + "Pictures" + "Documents" + "Videos" + "nixos-configv3" { - directory = "/var/lib/colord"; - user = "colord"; - group = "colord"; - mode = "u=rwx,g=rx,o="; + directory = ".local/share/Steam"; + mode = "0777"; } + { + directory = ".local/share/flatpak"; + mode = "0700"; + } + { + directory = ".gnupg"; + mode = "0700"; + } + { + directory = ".ssh"; + mode = "0700"; + } + { + directory = ".nixops"; + mode = "0700"; + } + { + directory = ".local/share/keyrings"; + mode = "0700"; + } + ".local/share/direnv" ]; files = [ - "/etc/machine-id" - { - file = "/var/keys/secret_file"; - parentDirectory = { - mode = "u=rwx,g=,o="; - }; - } + ".screenrc" ]; - users.laythe = { - directories = [ - "Downloads" - "Music" - "Pictures" - "Documents" - "Videos" - "VirtualBox VMs" - { - directory = ".local/share/Steam"; - mode = "0777" - } - { - directory = ".local/share/flatpak"; - mode = "0700" - } - { - directory = ".gnupg"; - mode = "0700"; - } - { - directory = ".ssh"; - mode = "0700"; - } - { - directory = ".nixops"; - mode = "0700"; - } - { - directory = ".local/share/keyrings"; - mode = "0700"; - } - ".local/share/direnv" - ]; - files = [ - ".screenrc" - ]; - }; }; - } -} \ No newline at end of file + }; +} diff --git a/machines/workstation/configuration.nix b/machines/workstation/configuration.nix index 9b4b2cb..2366997 100644 --- a/machines/workstation/configuration.nix +++ b/machines/workstation/configuration.nix @@ -2,21 +2,26 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ../../global/default.nix - # ../../modules/communication/default.nix - # ../../modules/creative/default.nix - ../../modules/development/default.nix - # ../../modules/fabrication/default.nix - ../../modules/gaming/default.nix - ../../modules/kde/default.nix - ../../modules/virtualization/default.nix - # ../../modules/vr/default.nix - ]; + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ../../global/default.nix + # ../../modules/communication/default.nix + # ../../modules/creative/default.nix + ../../modules/development/default.nix + # ../../modules/fabrication/default.nix + ../../modules/gaming/default.nix + ../../modules/kde/default.nix + ../../modules/virtualization/default.nix + # ../../modules/vr/default.nix + ../../global/eraseyourdarlings.nix + ]; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -51,9 +56,6 @@ # services.xserver.enable = true; # On anything else modern this should be false. - - - # Configure keymap in X11 # services.xserver.xkb.layout = "us"; # services.xserver.xkb.options = "eurosign:e,caps:escape"; @@ -134,4 +136,3 @@ system.stateVersion = "25.11"; # Did you read the comment? } -