From a8adeadf311cf877d7f53b7e006e247fbda4a4a6 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 2 May 2023 19:01:08 -0700 Subject: profiles: move things around for btrfs --- hosts/aptos/default.nix | 1 - hosts/aptos/hardware.nix | 2 -- hosts/carmel/hardware.nix | 1 - hosts/tahoe/default.nix | 2 +- hosts/tahoe/hardware.nix | 7 ------- modules/system/btrfs/default.nix | 14 -------------- modules/system/default.nix | 1 - profiles/btrfs.nix | 4 ++++ profiles/laptop.nix | 4 ++++ profiles/nas.nix | 14 ++++++++++++++ profiles/server.nix | 2 ++ profiles/workstation.nix | 1 + 12 files changed, 26 insertions(+), 27 deletions(-) delete mode 100644 modules/system/btrfs/default.nix create mode 100644 profiles/btrfs.nix create mode 100644 profiles/nas.nix diff --git a/hosts/aptos/default.nix b/hosts/aptos/default.nix index 3ae3f86..ac71f50 100644 --- a/hosts/aptos/default.nix +++ b/hosts/aptos/default.nix @@ -5,7 +5,6 @@ ./hardware.nix ./networking.nix ./services.nix - "${self}/profiles/workstation.nix" "${self}/profiles/laptop.nix" "${self}/profiles/hardware/xps9300.nix" ]; diff --git a/hosts/aptos/hardware.nix b/hosts/aptos/hardware.nix index d6a2d32..afe3840 100644 --- a/hosts/aptos/hardware.nix +++ b/hosts/aptos/hardware.nix @@ -41,7 +41,5 @@ swapDevices = [{ device = "/dev/disk/by-uuid/24041034-ff39-44bf-a04c-8fd8318b554d"; }]; - my.systems.btrfs.enable = true; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/hosts/carmel/hardware.nix b/hosts/carmel/hardware.nix index 984f571..3293d3a 100644 --- a/hosts/carmel/hardware.nix +++ b/hosts/carmel/hardware.nix @@ -24,5 +24,4 @@ }; swapDevices = [ ]; - powerManagement.cpuFreqGovernor = "schedutil"; } diff --git a/hosts/tahoe/default.nix b/hosts/tahoe/default.nix index e3d95a3..cfa3717 100644 --- a/hosts/tahoe/default.nix +++ b/hosts/tahoe/default.nix @@ -8,7 +8,7 @@ in ./hardware.nix ./networking.nix ./services.nix - "${self}/profiles/server.nix" + "${self}/profiles/nas.nix" "${self}/profiles/hardware/amd.nix" ]; diff --git a/hosts/tahoe/hardware.nix b/hosts/tahoe/hardware.nix index e81fca4..4b5937c 100644 --- a/hosts/tahoe/hardware.nix +++ b/hosts/tahoe/hardware.nix @@ -59,11 +59,4 @@ swapDevices = [{ device = "/dev/disk/by-uuid/0f54b5ab-4fca-4c5a-a9eb-622553145163"; }]; - - my.systems.btrfs.enable = true; - - # high-resolution display - hardware.video.hidpi.enable = lib.mkDefault true; - - powerManagement.cpuFreqGovernor = "schedutil"; } diff --git a/modules/system/btrfs/default.nix b/modules/system/btrfs/default.nix deleted file mode 100644 index 3446b2c..0000000 --- a/modules/system/btrfs/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib, config, ... }: -let - cfg = config.my.systems.btrfs; -in -{ - options.my.systems.btrfs = with lib; { - enable = mkEnableOption "btrfs configuration"; - }; - - config = lib.mkIf cfg.enable - { - services.btrfs.autoScrub.enable = !config.virtualisation.libvirtd.enable; - }; -} diff --git a/modules/system/default.nix b/modules/system/default.nix index 0082c1b..586cae8 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -3,7 +3,6 @@ { imports = [ ./boot - ./btrfs ./users ]; } diff --git a/profiles/btrfs.nix b/profiles/btrfs.nix new file mode 100644 index 0000000..1b87165 --- /dev/null +++ b/profiles/btrfs.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.btrfs.autoScrub.enable = true; +} diff --git a/profiles/laptop.nix b/profiles/laptop.nix index 6b8211a..0d1c95f 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -1,5 +1,9 @@ { pkgs, config, lib, ... }: { + imports = [ + ./workstation.nix + ]; + services.thermald.enable = true; services.tlp.enable = true; services.tlp.settings = { diff --git a/profiles/nas.nix b/profiles/nas.nix new file mode 100644 index 0000000..9c25c22 --- /dev/null +++ b/profiles/nas.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: +{ + imports = [ + ./server.nix + ./btrfs.nix + ]; + + users.groups.nas.gid = 5000; + users.users.nas = { + uid = 5000; + group = "nas"; + isSystemUser = true; + }; +} diff --git a/profiles/server.nix b/profiles/server.nix index 27498d6..5a95dff 100644 --- a/profiles/server.nix +++ b/profiles/server.nix @@ -4,6 +4,8 @@ ./default.nix ]; + powerManagement.cpuFreqGovernor = "schedutil"; + console = { earlySetup = true; font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; diff --git a/profiles/workstation.nix b/profiles/workstation.nix index 151357c..f136c33 100644 --- a/profiles/workstation.nix +++ b/profiles/workstation.nix @@ -3,6 +3,7 @@ imports = [ ./default.nix ./documentation.nix + ./btrfs.nix ]; virtualisation.docker.enable = false; -- cgit 1.4.1