From 73cd8a2ab81b91aaca8095c77de12ea39fbc2fed Mon Sep 17 00:00:00 2001 From: tzlil Date: Thu, 3 Aug 2023 21:37:04 +0300 Subject: fix vm --- hosts/navi/default.nix | 17 +++++++++++++---- hosts/navi/hardware-configuration.nix | 17 +++++++++++------ mixins/sway.nix | 4 ++-- mixins/syncthing.nix | 4 ++-- profiles/impermanence.nix | 2 +- profiles/network.nix | 3 +-- profiles/nix.nix | 2 +- profiles/tzlil.nix | 1 + 8 files changed, 32 insertions(+), 18 deletions(-) diff --git a/hosts/navi/default.nix b/hosts/navi/default.nix index 3424a87..d4d2446 100644 --- a/hosts/navi/default.nix +++ b/hosts/navi/default.nix @@ -47,7 +47,16 @@ algorithm = "zstd"; }; - networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + # systemd.network.networks."10-wlp1s0" = { + # matchConfig.Name = "wlp1s0"; + # networkConfig.DHCP = "yes"; + # }; + + systemd.network.networks."10-eth0" = { + matchConfig.Name = "eth0"; + networkConfig.DHCP = "yes"; + }; # # iwd networking stuffs # networking.networkmanager.enable = lib.mkForce false; @@ -73,9 +82,9 @@ "/etc/NetworkManager/system-connections" "/var/lib/docker" ]; - users.tzlil = { - directories = [".config/SchildiChat" ".local/share/Terraria" ".local/share/Steam"]; - }; + # users.tzlil = { + # directories = [".config/SchildiChat" ".local/share/Terraria" ".local/share/Steam"]; + # }; }; home-manager.users.tzlil = { diff --git a/hosts/navi/hardware-configuration.nix b/hosts/navi/hardware-configuration.nix index f556950..480f255 100644 --- a/hosts/navi/hardware-configuration.nix +++ b/hosts/navi/hardware-configuration.nix @@ -3,7 +3,7 @@ pkgs, lib, config, - # modulesPath, + modulesPath, ... }: let device = "/dev/nvme0n1"; @@ -13,7 +13,7 @@ in { inputs.hardware.nixosModules.common-cpu-intel inputs.hardware.nixosModules.common-gpu-intel - # (modulesPath + "/virtualisation/qemu-vm.nix") + (modulesPath + "/virtualisation/qemu-vm.nix") ]; hardware.firmware = [pkgs.rtw88-firmware]; @@ -26,6 +26,7 @@ in { hardware.bluetooth.enable = true; + fileSystems."/nix/persist".neededForBoot = true; disko.devices = { disk.${baseNameOf device} = { inherit device; @@ -44,9 +45,9 @@ in { }; root = { size = "100%"; - content = { - type = "luks"; - name = "cryptroot"; + # content = { + # type = "luks"; + # name = "cryptroot"; content = { type = "btrfs"; extraArgs = ["-f"]; @@ -55,9 +56,13 @@ in { mountOptions = ["compress=zstd" "noatime"]; mountpoint = "/nix"; }; + "/nix/persist" = { + mountOptions = ["compress=zstd" "noatime"]; + mountpoint = "/nix/persist"; + }; }; }; - }; + # }; }; }; }; diff --git a/mixins/sway.nix b/mixins/sway.nix index 678206d..5fc6558 100644 --- a/mixins/sway.nix +++ b/mixins/sway.nix @@ -173,7 +173,7 @@ in { } ]; - modifier = "Mod4"; + modifier = "Mod1"; left = "h"; down = "n"; up = "e"; @@ -264,7 +264,7 @@ in { # exec ${pkgs.polkit_gnome}/polkit-gnome/polkit-gnome-authentication-agent-1 #set $mod Alt - set $mod Mod4 + set $mod Mod1 set $left h set $down n set $up e diff --git a/mixins/syncthing.nix b/mixins/syncthing.nix index ac9944b..d9d23e7 100644 --- a/mixins/syncthing.nix +++ b/mixins/syncthing.nix @@ -25,8 +25,8 @@ }; environment.persistence."/nix/persist".users.tzlil.directories = [ - "sync" - ".config/syncthing" + # "sync" + # ".config/syncthing" ]; }; } diff --git a/profiles/impermanence.nix b/profiles/impermanence.nix index c222a43..cdbf426 100644 --- a/profiles/impermanence.nix +++ b/profiles/impermanence.nix @@ -13,7 +13,7 @@ in { environment.persistence."/nix/persist" = { hideMounts = true; directories = [ - "/var/log" + # "/var/log" "/var/lib/systemd/coredump" "/tmp" # Make builds not crash by running them on disk instead of RAM (We still clean /tmp on boot) ]; diff --git a/profiles/network.nix b/profiles/network.nix index 461106f..fc4af5c 100644 --- a/profiles/network.nix +++ b/profiles/network.nix @@ -7,6 +7,7 @@ }: { imports = []; config = { + systemd.network.enable = true; networking = { firewall = { enable = true; @@ -15,9 +16,7 @@ checkReversePath = "loose"; }; networkmanager.enable = true; - useDHCP = false; nameservers = ["127.0.0.1" "::1"]; - networkmanager.dns = "none"; extraHosts = '' 100.99.246.128 pc 100.105.242.70 phone diff --git a/profiles/nix.nix b/profiles/nix.nix index 769a06a..6e18dc5 100644 --- a/profiles/nix.nix +++ b/profiles/nix.nix @@ -40,5 +40,5 @@ nixpkgs.config.allowUnfree = true; # save uid/guid - environment.persistence."/nix/persist".directories = ["/var/lib/nixos"]; + # environment.persistence."/nix/persist".directories = ["/var/lib/nixos"]; } diff --git a/profiles/tzlil.nix b/profiles/tzlil.nix index f2e2505..5669b26 100644 --- a/profiles/tzlil.nix +++ b/profiles/tzlil.nix @@ -27,6 +27,7 @@ shell = pkgs.fish; hashedPassword = "$6$FAQYKz3OCtRNOP7h$XsApvP.r./Jv5MRI1idDI9BMnA26xxEvXFlE61Zls.QA3EK2x76XsetdpxSlgViylnRwRuq5XQMc3GeAJ7tum1"; # passwordFile = config.age.secrets.password.path; + createHome = true; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIgPE76xQXx1kpvWavHGNOWHiZSFdGfz/rQlISGrKsDe" ]; -- cgit 1.4.1