Try to use impermanence

This commit is contained in:
2023-03-06 13:20:05 +09:00
parent 9b75d47387
commit c96a8b6b93
6 changed files with 65 additions and 3 deletions

16
flake.lock generated
View File

@@ -129,6 +129,21 @@
"type": "github"
}
},
"impermanence": {
"locked": {
"lastModified": 1675359654,
"narHash": "sha256-FPxzuvJkcO49g4zkWLSeuZkln54bLoTtrggZDJBH90I=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "6138eb8e737bffabd4c8fc78ae015d4fd6a7e2fd",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"jq": {
"flake": false,
"locked": {
@@ -290,6 +305,7 @@
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"impermanence": "impermanence",
"jq": "jq",
"neovim-nightly": "neovim-nightly",
"nix-colors": "nix-colors",

View File

@@ -7,6 +7,10 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland/v0.22.0beta";
inputs.nixpkgs.follows = "nixpkgs";

View File

@@ -15,6 +15,12 @@
boot.extraModulePackages = [];
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "size=4G" "mode=755" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/e8f1fdc5-c5fc-4468-b92a-63b7b4093345";
fsType = "ext4";
};

View File

@@ -5,6 +5,7 @@ in {
config = lib.mkIf cfg.enable {
services.flatpak.enable = true;
hardware.steam-hardware.enable = true;
hardware.opengl.driSupport32Bit = true;
environment.systemPackages = with pkgs; [
wineWowPackages.stable

View File

@@ -1,25 +1,60 @@
{
lib,
config,
impermanence,
...
}: let
cfg = config.nixconf;
in {
imports = [ impermanence.nixosModules.impermanence ];
options.nixconf = {enable = lib.mkEnableOption "nix";};
config = lib.mkIf cfg.enable {
nix = {
settings.auto-optimise-store = true;
settings = {
auto-optimise-store = true;
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true;
environment.persistence."/nix/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/lib/docker"
"/etc/NetworkManager/system-connections"
];
files = [
"/etc/machine-id"
];
users.zoriya = {
directories = [
"downloads"
"stuff"
"projects"
{ directory = ".gnupg"; mode = "0700"; }
{ directory = ".ssh"; mode = "0700"; }
".local/share/direnv"
".local/share/flatpak"
".local/share/atuin"
".config/google-chrome"
];
files = [ ];
};
};
};
}

View File

@@ -22,7 +22,7 @@ in {
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
#wireplumber.enable = true;
wireplumber.enable = true;
};
# Autostart hyprland and display lockscreen as greeter