hashtag erasing my darlings

This commit is contained in:
TheCrazyInsanity
2025-12-16 12:30:30 -05:00
parent edfc6cffdd
commit fd2389fed1
2 changed files with 118 additions and 39 deletions

View File

@@ -11,49 +11,55 @@
# to avoid problems caused by different versions of nixpkgs. # to avoid problems caused by different versions of nixpkgs.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
impermanence.url = "github:nix-community/impermanence";
}; };
outputs = { outputs =
self, {
nixpkgs, self,
home-manager, nixpkgs,
}@inputs: let home-manager,
inherit (self) outputs; impermanence,
nix.registry.nixos.flake = inputs.self; }@inputs:
environment.etc."nix/inputs/nixpkgs".source = nixpkgs.outPath; let
nix.nixPath = ["nixpkgs=${nixpkgs.outPath}"]; inherit (self) outputs;
in{ nix.registry.nixos.flake = inputs.self;
nixosConfigurations = { environment.etc."nix/inputs/nixpkgs".source = nixpkgs.outPath;
homepc = nixpkgs.lib.nixosSystem { nix.nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
specialArgs = {inherit inputs outputs;}; in
system = "x86_64-linux"; {
modules = [ nixosConfigurations = {
./machines/homepc/configuration.nix homepc = nixpkgs.lib.nixosSystem {
home-manager.nixosModules.home-manager specialArgs = { inherit inputs outputs; };
{ system = "x86_64-linux";
home-manager.extraSpecialArgs = {inherit inputs outputs;}; modules = [
home-manager.useGlobalPkgs = true; ./machines/homepc/configuration.nix
home-manager.useUserPackages = true; home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = { inherit inputs outputs; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.laythe = import ./machines/homepc/home.nix; home-manager.users.laythe = import ./machines/homepc/home.nix;
} }
]; ];
}; };
workstation = nixpkgs.lib.nixosSystem { workstation = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = { inherit inputs outputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./machines/workstation/configuration.nix ./machines/workstation/configuration.nix
home-manager.nixosModules.home-manager impermanence.nixosModules.impermanence
{ home-manager.nixosModules.home-manager
home-manager.extraSpecialArgs = {inherit inputs outputs;}; {
home-manager.useGlobalPkgs = true; home-manager.extraSpecialArgs = { inherit inputs outputs; };
home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.laythe = import ./machines/homepc/home.nix; home-manager.users.laythe = import ./machines/homepc/home.nix;
} }
]; ];
};
}; };
}; };
};
} }

View File

@@ -0,0 +1,73 @@
{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;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
{
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 = [
"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"
];
};
};
}
}