From c77266c71634dc59dc036bfd274e239f0343b238 Mon Sep 17 00:00:00 2001 From: Xory Date: Mon, 27 Oct 2025 12:21:58 +0200 Subject: [PATCH 1/2] exp: impermanence on voidspear --- flake.lock | 15 ++++--- flake.nix | 6 ++- hosts/voidspear/configuration.nix | 68 +++++++++++++++++++------------ hosts/voidspear/home.nix | 5 +-- 4 files changed, 54 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index 986171c..5debf7a 100644 --- a/flake.lock +++ b/flake.lock @@ -7,32 +7,31 @@ ] }, "locked": { - "lastModified": 1756245065, - "narHash": "sha256-aAZNbGcWrVRZgWgkQbkabSGcDVRDMgON4BipMy69gvI=", + "lastModified": 1761266473, + "narHash": "sha256-QxCyKWBmuzI+eMhYV1JmbZsiUnBNATRP1EW34OBt5Vg=", "owner": "nix-community", "repo": "home-manager", - "rev": "54b2879ce622d44415e727905925e21b8f833a98", + "rev": "5c71d4a730bd3c972befff343bb074421e345937", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1756217674, - "narHash": "sha256-TH1SfSP523QI7kcPiNtMAEuwZR3Jdz0MCDXPs7TS8uo=", + "lastModified": 1761114652, + "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4e7667a90c167f7a81d906e5a75cba4ad8bee620", + "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-25.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 3976ceb..434043c 100644 --- a/flake.nix +++ b/flake.nix @@ -5,10 +5,11 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable/"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + impermanence.url = "github:nix-community/impermanence"; }; outputs = - { self, nixpkgs, home-manager, ... } @ inputs: + { self, nixpkgs, impermanence, home-manager, ... } @ inputs: let system = "x86_64-linux"; username = "xory"; @@ -17,8 +18,9 @@ nixpkgs.lib.nixosSystem { inherit system; modules = [ - ./hosts/${hostName}/configuration.nix + ./hosts/${hostName}/configuration.nix ./hosts/${hostName}/hardware-configuration.nix + impermanence.nixosModules.impermanence home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/hosts/voidspear/configuration.nix b/hosts/voidspear/configuration.nix index a3090e4..068dbf1 100644 --- a/hosts/voidspear/configuration.nix +++ b/hosts/voidspear/configuration.nix @@ -18,25 +18,10 @@ boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = "voidspear"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Enable networking networking.networkmanager.enable = true; - # ZeroTier - services.zerotierone.enable = true; - services.zerotierone.joinNetworks = [ "b3ce837c63" "363c67c55a726a89" ]; - - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - libGL - SDL2 - ]; - # Set your time zone. time.timeZone = "Europe/Athens"; @@ -55,6 +40,48 @@ LC_TIME = "en_GB.UTF-8"; }; + # Impermanence + fileSystems."/persist" = { + device = "/dev/disk/by-uuid/1578f380-e588-419b-ace0-f63e6a48ca39"; + fsType = "ext4"; + }; + + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/home" + "/var/log" + "/var/lib/bluetooth" + "/etc/NetworkManager/system-connections" + "/var/lib/nixos" + "/home" + ]; + files = [ + "/etc/machine-id" + ]; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + programs.zsh.enable = true; # home-manager already installs this but nixos complains w/o it + users.users.xory = { + isNormalUser = true; + description = "xory"; + extraGroups = [ "networkmanager" "wheel" "docker" "libvirt" "dialout" ]; + shell = pkgs.zsh; + initialHashedPassword = "$6$JXLpG5JYMJgZndm9$0sC8uPJ99cYL.hNv3DFQ20ky8tiZoxioe9GlMEanTwAD99LJ175/bHtN6Bm6bYsQG1BVGRdmphnXEcWS9ApoK0"; + }; + + # ZeroTier + services.zerotierone.enable = true; + services.zerotierone.joinNetworks = [ "b3ce837c63" "363c67c55a726a89" ]; + + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + libGL + SDL2 + ]; + + # Enable the X11 windowing system. # You can disable this if you're only using the Wayland session. services.xserver.enable = true; @@ -103,17 +130,6 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - programs.zsh.enable = true; # home-manager already installs this but nixos complains w/o it - users.users.xory = { - isNormalUser = true; - description = "xory"; - extraGroups = [ "networkmanager" "wheel" "docker" "libvirt" "dialout" ]; - packages = with pkgs; [ - # thunderbird - ]; - shell = pkgs.zsh; - }; services.ollama.enable = true; services.ollama.acceleration = "cuda"; diff --git a/hosts/voidspear/home.nix b/hosts/voidspear/home.nix index 0a0f4be..e7110b9 100644 --- a/hosts/voidspear/home.nix +++ b/hosts/voidspear/home.nix @@ -20,10 +20,7 @@ ffmpeg yt-dlp prismlauncher - (discord.override { - withOpenASAR = true; - withVencord = true; - }) + vesktop keepassxc obs-studio mpv From 20dee8e3076221d509102411ebd79b48c6513eb1 Mon Sep 17 00:00:00 2001 From: Xory Date: Mon, 27 Oct 2025 13:06:50 +0200 Subject: [PATCH 2/2] just came out of git hell and seemingly fixed machine-id, i think this is it? --- flake.lock | 16 ++++++++++++++++ hosts/voidspear/configuration.nix | 10 ++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 5debf7a..b7ad26e 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,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": 1761114652, @@ -39,6 +54,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "impermanence": "impermanence", "nixpkgs": "nixpkgs" } } diff --git a/hosts/voidspear/configuration.nix b/hosts/voidspear/configuration.nix index 068dbf1..c18b301 100644 --- a/hosts/voidspear/configuration.nix +++ b/hosts/voidspear/configuration.nix @@ -44,6 +44,7 @@ fileSystems."/persist" = { device = "/dev/disk/by-uuid/1578f380-e588-419b-ace0-f63e6a48ca39"; fsType = "ext4"; + neededForBoot = true; }; environment.persistence."/persist" = { @@ -54,13 +55,14 @@ "/var/lib/bluetooth" "/etc/NetworkManager/system-connections" "/var/lib/nixos" - "/home" - ]; - files = [ - "/etc/machine-id" ]; }; + environment.etc."machine-id" = { + source = "/persist/etc/machine-id"; + mode = "0444"; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. programs.zsh.enable = true; # home-manager already installs this but nixos complains w/o it users.users.xory = {