diff --git a/config/system/persistence.nix b/config/system/persistence.nix index d843f76..e3ce218 100644 --- a/config/system/persistence.nix +++ b/config/system/persistence.nix @@ -9,7 +9,7 @@ "/etc/NetworkManager/system-connections" ]; files = [ - "/etc/machine-id" + # "/etc/machine-id" ]; users.${username} = { directories = [ diff --git a/flake.lock b/flake.lock index 39f6180..a0a2e9c 100644 --- a/flake.lock +++ b/flake.lock @@ -224,6 +224,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1706639736, + "narHash": "sha256-CaG4j9+UwBDfinxxvJMo6yOonSmSo0ZgnbD7aj2Put0=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "cd13c2917eaa68e4c49fea0ff9cada45440d7045", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "nix-colors": { "inputs": { "base16-schemes": "base16-schemes", @@ -368,6 +383,7 @@ "home-manager": "home-manager", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", + "impermanence": "impermanence", "nix-colors": "nix-colors", "nixpkgs": "nixpkgs_2", "nixvim": "nixvim" diff --git a/flake.nix b/flake.nix index 6078fff..71eb21d 100644 --- a/flake.nix +++ b/flake.nix @@ -15,13 +15,14 @@ url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; + impermanence.url = "github:nix-community/impermanence"; }; - outputs = inputs@{ nixpkgs, home-manager, ... }: + outputs = inputs@{ nixpkgs, home-manager, impermanence, ... }: let system = "x86_64-linux"; - username = "zaney"; - hostname = "hyprnix"; + username = builtins.exec "echo $USER"; + hostname = builtins.exec "hostname"; pkgs = import nixpkgs { inherit system; @@ -38,6 +39,7 @@ }; modules = [ ./system.nix + impermanence.nixosModules.impermanence home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit username; inherit inputs; diff --git a/hardware.nix b/hardware.nix index 1c63086..eeece50 100644 --- a/hardware.nix +++ b/hardware.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, username, ... }: { imports = @@ -18,7 +18,7 @@ { device = "none"; fsType = "tmpfs"; - options = [ "defaults" "size=25%" "mode=755" ]; + options = [ "defaults" "size=35%" "mode=755" ]; }; fileSystems."/boot" = @@ -43,6 +43,13 @@ options = [ "bind" ]; }; + fileSystems."/home/${username}/zaneyos" = + { + device = "/nix/persist/etc/nixos/zaneyos"; + fsType = "none"; + options = [ "bind" ]; + }; + fileSystems."/var/log" = { device = "/nix/persist/var/log"; diff --git a/options.nix b/options.nix index 0c55531..3b61f4b 100644 --- a/options.nix +++ b/options.nix @@ -4,7 +4,7 @@ let # YOU MUST CHANGE THIS - userHome = "/home/zaney"; + userHome = builtins.exec "eval echo ~$USER"; in { # User Variables gitUsername = "Tyler Kelley";