From 41f62a389045d63fd2269736ec1ae45c003003e0 Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Fri, 5 Jan 2024 22:07:32 +0000 Subject: [PATCH] Update hypnos config --- flake.nix | 8 +++++++- hosts/hypnos/default.nix | 2 +- hosts/hypnos/disko-config.nix | 21 ++++++++++++--------- hosts/hypnos/hardware-configuration.nix | 2 +- modules/desktop/gnome.nix | 3 +++ modules/networking/wireless.nix | 1 + 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 4ede44b..76fdf85 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,10 @@ nixpkgs.url = "nixpkgs/nixos-23.11"; agenix.url = "github:ryantm/agenix"; deploy-rs.url = "github:serokell/deploy-rs"; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -24,7 +28,7 @@ }; }; - outputs = inputs @ { self, nixpkgs, agenix, deploy-rs, home-manager, nixos-hardware, secrets, ... }: + outputs = inputs @ { self, nixpkgs, agenix, deploy-rs, disko, home-manager, nixos-hardware, secrets, ... }: let nixpkgsForSystem = system: inputs.nixpkgs; overlays = [ @@ -33,6 +37,7 @@ ]; commonModules = [ agenix.nixosModules.age + disko.nixosModules.disko home-manager.nixosModule ./modules ]; @@ -66,6 +71,7 @@ atlas = nixosSystem { system = "x86_64-linux"; name = "atlas"; }; eos = nixosSystem { system = "x86_64-linux"; name = "eos"; }; helios = nixosSystem { system = "x86_64-linux"; name = "helios"; }; + hypnos = nixosSystem { system = "x86_64-linux"; name = "hypnos"; }; odyssey = nixosSystem { system = "x86_64-linux"; name = "odyssey"; }; pi = nixosSystem { system = "aarch64-linux"; name = "pi"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; }; }; diff --git a/hosts/hypnos/default.nix b/hosts/hypnos/default.nix index b396c26..3fcada0 100644 --- a/hosts/hypnos/default.nix +++ b/hosts/hypnos/default.nix @@ -3,6 +3,7 @@ { imports = [ ./hardware-configuration.nix + ./disko-config.nix ../desktop.nix ]; @@ -14,7 +15,6 @@ networking = { hostName = "hypnos"; hostId = "cf791898"; - networkmanager.enable = true; }; nix = { diff --git a/hosts/hypnos/disko-config.nix b/hosts/hypnos/disko-config.nix index 29eeb2d..04bdf63 100644 --- a/hosts/hypnos/disko-config.nix +++ b/hosts/hypnos/disko-config.nix @@ -1,3 +1,4 @@ +{ lib, ... }: { disko.devices = { disk = { @@ -39,15 +40,16 @@ dnodesize = "auto"; xattr = "sa"; }; - mountpoint = "/"; postCreateHook = "zfs snapshot rpool@blank"; datasets = { local = { + type = "zfs_fs"; options = { mountpoint = "none"; }; }; "local/nix" = { + type = "zfs_fs"; mountpoint = "/nix"; options = { atime = "off"; @@ -55,6 +57,7 @@ }; }; "local/tmp" = { + type = "zfs_fs"; mountpoint = "/tmp"; options = { setuid = "off"; @@ -63,24 +66,21 @@ }; }; system = { + type = "zfs_fs"; + mountpoint = "/"; options = { - mountpoint = "none"; - encryption = "aes-256-gcm"; - keyformat = "passphrase"; - keylocation = "file:///tmp/secret.key"; + mountpoint = "legacy"; }; - # use this to read the key during boot - postCreateHook = '' - zfs set keylocation="prompt" "rpool/$name"; - ''; }; "system/var" = { + type = "zfs_fs"; mountpoint = "/var"; options = { mountpoint = "legacy"; }; }; "system/var/tmp" = { + type = "zfs_fs"; mountpoint = "/var/tmp"; options = { devices = "off"; @@ -88,6 +88,7 @@ }; }; "system/var/log" = { + type = "zfs_fs"; mountpoint = "/var/log"; options = { compression = "on"; @@ -96,6 +97,7 @@ }; }; user = { + type = "zfs_fs"; options = { mountpoint = "none"; encryption = "aes-256-gcm"; @@ -108,6 +110,7 @@ ''; }; "user/home" = { + type = "zfs_fs"; mountpoint = "/home"; options = { setuid = "off"; diff --git a/hosts/hypnos/hardware-configuration.nix b/hosts/hypnos/hardware-configuration.nix index e1dcf2f..396f6e9 100644 --- a/hosts/hypnos/hardware-configuration.nix +++ b/hosts/hypnos/hardware-configuration.nix @@ -6,7 +6,7 @@ ]; boot = { - initrd.availableKernelModules = [ "xhci_pci" "achi" "usbhid" "usb_storage" "sd_mod" ]; + initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; initrd.kernelModules = [ ]; kernelModules = [ "kvm-intel" "wl" ]; extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix index b20faac..ec1c871 100644 --- a/modules/desktop/gnome.nix +++ b/modules/desktop/gnome.nix @@ -102,6 +102,9 @@ in { picture-uri = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-l.jpg"; picture-uri-dark = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-d.jpg"; }; + "org/gnome/peripherals/touchpad" = { + tap-to-click = true; + }; "org/gtk/settings/file-chooser" = { show-hidden = true; sort-directories-first = true; diff --git a/modules/networking/wireless.nix b/modules/networking/wireless.nix index 8f7ac8c..3284bde 100644 --- a/modules/networking/wireless.nix +++ b/modules/networking/wireless.nix @@ -23,6 +23,7 @@ in { }; networking = { + networkmanager.unmanaged = [ "*" ]; wireless = { enable = true; interfaces = cfg.interfaces;