system: add snapper for home and subvol for nix
This commit is contained in:
		
							parent
							
								
									2fc7225354
								
							
						
					
					
						commit
						115b139f1c
					
				@ -65,6 +65,7 @@
 | 
				
			|||||||
    source-code-pro
 | 
					    source-code-pro
 | 
				
			||||||
    jetbrains-mono
 | 
					    jetbrains-mono
 | 
				
			||||||
    font-awesome                            # Icons
 | 
					    font-awesome                            # Icons
 | 
				
			||||||
 | 
					    hack-font
 | 
				
			||||||
    corefonts                               # MS
 | 
					    corefonts                               # MS
 | 
				
			||||||
    (nerdfonts.override {                   # Nerdfont Icons override
 | 
					    (nerdfonts.override {                   # Nerdfont Icons override
 | 
				
			||||||
      fonts = [
 | 
					      fonts = [
 | 
				
			||||||
@ -133,6 +134,15 @@
 | 
				
			|||||||
                                            # com.obsproject.Studio
 | 
					                                            # com.obsproject.Studio
 | 
				
			||||||
                                            # com.parsecgaming.parsec
 | 
					                                            # com.parsecgaming.parsec
 | 
				
			||||||
                                            # com.usebottles.bottles
 | 
					                                            # com.usebottles.bottles
 | 
				
			||||||
 | 
					    snapper.configs = {
 | 
				
			||||||
 | 
					        home = {
 | 
				
			||||||
 | 
					          subvolume = "/home";
 | 
				
			||||||
 | 
					          extraConfig = ''
 | 
				
			||||||
 | 
					              TIMELINE_CREATE=yes
 | 
				
			||||||
 | 
					              TIMELINE_CLEANUP=yes
 | 
				
			||||||
 | 
					          '';
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #xdg.portal = {                            # Required for flatpak
 | 
					  #xdg.portal = {                            # Required for flatpak
 | 
				
			||||||
@ -167,10 +177,10 @@
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  system = {                                # NixOS settings
 | 
					  system = {                                # NixOS settings
 | 
				
			||||||
    autoUpgrade = {                         # Allow auto update
 | 
					#    autoUpgrade = {                         # Allow auto update
 | 
				
			||||||
      enable = true;
 | 
					#      enable = true;
 | 
				
			||||||
      channel = "https://nixos.org/channels/nixos-unstable";
 | 
					#      channel = "https://nixos.org/channels/nixos-unstable";
 | 
				
			||||||
    };
 | 
					#    };
 | 
				
			||||||
    stateVersion = "22.05";
 | 
					    stateVersion = "22.05";
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -25,19 +25,31 @@
 | 
				
			|||||||
  fileSystems."/" =
 | 
					  fileSystems."/" =
 | 
				
			||||||
    { device = "/dev/disk/by-label/NIXROOT";
 | 
					    { device = "/dev/disk/by-label/NIXROOT";
 | 
				
			||||||
      fsType = "btrfs";
 | 
					      fsType = "btrfs";
 | 
				
			||||||
      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@" ];
 | 
					      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/home" =
 | 
					  fileSystems."/home" =
 | 
				
			||||||
    { device = "/dev/disk/by-label/NIXROOT";
 | 
					    { device = "/dev/disk/by-label/NIXROOT";
 | 
				
			||||||
      fsType = "btrfs";
 | 
					      fsType = "btrfs";
 | 
				
			||||||
      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home" ];
 | 
					      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fileSystems."/home/.snapshots" =
 | 
				
			||||||
 | 
					    { device = "/dev/disk/by-label/NIXROOT";
 | 
				
			||||||
 | 
					      fsType = "btrfs";
 | 
				
			||||||
 | 
					      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/srv" =
 | 
					  fileSystems."/srv" =
 | 
				
			||||||
    { device = "/dev/disk/by-label/NIXROOT";
 | 
					    { device = "/dev/disk/by-label/NIXROOT";
 | 
				
			||||||
      fsType = "btrfs";
 | 
					      fsType = "btrfs";
 | 
				
			||||||
      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv" ];
 | 
					      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fileSystems."/nix" =
 | 
				
			||||||
 | 
					    { device = "/dev/disk/by-label/NIXROOT";
 | 
				
			||||||
 | 
					      fsType = "btrfs";
 | 
				
			||||||
 | 
					      options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/boot" =
 | 
					  fileSystems."/boot" =
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user