From cc29c2fbd3a25360826f3ffd202a5c906cfa37c5 Mon Sep 17 00:00:00 2001 From: maralorn Date: Sun, 5 Dec 2021 05:11:17 +0100 Subject: [PATCH] Update fluffy config --- channels.nix | 1 + home-manager/machines.nix | 10 ++++ nixos/machines/fluffy/configuration.nix | 60 ++++++++++--------- .../fluffy/hardware-configuration.nix | 8 +-- 4 files changed, 46 insertions(+), 33 deletions(-) diff --git a/channels.nix b/channels.nix index b52c17e9..f845a2ad 100644 --- a/channels.nix +++ b/channels.nix @@ -12,5 +12,6 @@ rec { hera = nixos-21-11; apollo = nixos-21-11; zeus = nixos-21-11; + fluffy = nixos-21-11; chor-cloud = hera; } diff --git a/home-manager/machines.nix b/home-manager/machines.nix index 2c396c3b..a0f81b23 100644 --- a/home-manager/machines.nix +++ b/home-manager/machines.nix @@ -133,6 +133,16 @@ in ./roles/state.nix ./roles/trusted-env.nix ]; + fluffy = { + default = makeConfig "hera" ([ + ./roles/on-my-machine.nix + ./roles/accounting.nix + ./roles/mode-switching.nix + ./roles/systemd-exporter.nix + ./roles/headless.nix + ./roles/state.nix + ]); + }; hera = { default = makeConfig "hera" (on-my-machines ++ [ ./roles/fetch-banking-timer.nix diff --git a/nixos/machines/fluffy/configuration.nix b/nixos/machines/fluffy/configuration.nix index 3e4da7d2..b0d716e9 100644 --- a/nixos/machines/fluffy/configuration.nix +++ b/nixos/machines/fluffy/configuration.nix @@ -27,33 +27,33 @@ in btrfsOptions = { options = [ "compress=zstd" "autodefrag" "noatime" ]; }; in { - "/disk" = btrfsOptions; + "/disk" = { neededForBoot = true; } // btrfsOptions; "/nix" = btrfsOptions; }; environment.etc = { - # nixos.source = "/disk/persist/maralorn/git/config"; + nixos.source = "/disk/persist/maralorn/git/config"; machine-id.source = "/disk/persist/machine-id"; }; - #systemd.services."activate-home-manager" = { - # path = [ pkgs.nix pkgs.dbus ]; - # script = '' - # if [[ -e /home/maralorn/.mode ]]; then - # MODE="$(cat /home/maralorn/.mode)" - # else - # MODE="orga" - # fi - # /disk/volatile/maralorn/modes/$MODE/activate - # ''; - # serviceConfig = { - # Type = "oneshot"; - # User = "maralorn"; - # }; - # wantedBy = [ "multi-user.target" ]; - # # Try to avoid race conditions, when the user get’s logged in before activation was completed. - # before = [ "display-manager.service" ]; - #}; + systemd.services."activate-home-manager" = { + path = [ pkgs.nix pkgs.dbus ]; + script = '' + if [[ -e /home/maralorn/.mode ]]; then + MODE="$(cat /home/maralorn/.mode)" + else + MODE="default" + fi + /disk/volatile/maralorn/modes/$MODE/activate + ''; + serviceConfig = { + Type = "oneshot"; + User = "maralorn"; + }; + wantedBy = [ "multi-user.target" ]; + # Try to avoid race conditions, when the user get’s logged in before activation was completed. + before = [ "display-manager.service" ]; + }; systemd.tmpfiles.rules = [ "d /disk/persist/root 700 root root - -" @@ -63,15 +63,18 @@ in "Z /home/maralorn - maralorn users - -" "d /disk/volatile/maralorn 700 maralorn users - -" "d /disk/persist/var/lib/hass - - - - -" - "d /tmp/scans/scans 777 ftp ftp - -" + #"d /tmp/scans/scans 777 ftp ftp - -" "L+ /var/lib/waydroid - - - - /disk/persist/var/lib/waydroid" "L+ /root/.ssh - - - - /disk/persist/root/.ssh" ]; boot = { loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; + grub = { + device = "nodev"; + efiSupport = true; + efiInstallAsRemovable = true; + }; }; initrd = { luks.devices."crypted-nixos" = { @@ -88,7 +91,10 @@ in networking = { hostName = "fluffy"; domain = "lo.m-0.eu"; - interfaces.enp1s0.useDHCP = true; + interfaces.enp1s0 = { + ipv6.addresses = [{ address = "fdc0:1::2"; prefixLength = 64; }]; + useDHCP = true; + }; #wireguard.interfaces = { # m0wire = { # allowedIPsAsRoutes = false; @@ -106,7 +112,7 @@ in # postSetup = # [ "${pkgs.iproute}/bin/ip route add ${prefix}::/96 dev m0wire" ]; # }; - }; + #}; }; programs = { @@ -187,9 +193,6 @@ in #boot.kernel.sysctl."fs.inotify.max_user_watches" = 204800; console.keyMap = "neo"; - - networking.interfaces.enp1s0.useDHCP = true; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave @@ -199,4 +202,3 @@ in system.stateVersion = "21.11"; # Did you read the comment? } - diff --git a/nixos/machines/fluffy/hardware-configuration.nix b/nixos/machines/fluffy/hardware-configuration.nix index 712e7f78..abf23320 100644 --- a/nixos/machines/fluffy/hardware-configuration.nix +++ b/nixos/machines/fluffy/hardware-configuration.nix @@ -13,19 +13,19 @@ }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/43AC-25F1"; + { device = "/dev/disk/by-uuid/C617-5CCC"; fsType = "vfat"; }; fileSystems."/disk" = - { device = "/dev/disk/by-uuid/573176bd-8420-4174-a39c-0387c1ee1ac8"; + { device = "/dev/disk/by-uuid/9acbc122-e818-49fa-bc2e-de7d9f822d5a"; fsType = "btrfs"; }; - boot.initrd.luks.devices."crypted-nixos".device = "/dev/disk/by-uuid/ceb2366c-099a-4ad1-b9b0-1bfa84189a6e"; + boot.initrd.luks.devices."crypted-nixos".device = "/dev/disk/by-uuid/020fde09-f651-45a2-9c6a-9b060edf967d"; fileSystems."/nix" = - { device = "/dev/disk/by-uuid/573176bd-8420-4174-a39c-0387c1ee1ac8"; + { device = "/dev/disk/by-uuid/9acbc122-e818-49fa-bc2e-de7d9f822d5a"; fsType = "btrfs"; options = [ "subvol=nix" ]; };