From d0c42a5b7f981d6441bf79718cbce53ea3686ed4 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 12 Jan 2022 12:09:58 +0100 Subject: [PATCH] Nix store gc and Emacs as systemd service --- hosts/hs/configuration.nix | 8 ++++++++ hosts/mbp/configuration.nix | 7 +------ hosts/pbp/configuration.nix | 13 +++++++++++-- hosts/pc/configuration.nix | 8 ++++++++ users/profiles/emacs/default.nix | 4 ++++ users/profiles/sway/default.nix | 2 +- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/hosts/hs/configuration.nix b/hosts/hs/configuration.nix index 189aa6b..6a28de3 100644 --- a/hosts/hs/configuration.nix +++ b/hosts/hs/configuration.nix @@ -259,6 +259,14 @@ email = "andrea.ciceri@autistici.org"; }; + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/hosts/mbp/configuration.nix b/hosts/mbp/configuration.nix index 2d44543..d65ec92 100644 --- a/hosts/mbp/configuration.nix +++ b/hosts/mbp/configuration.nix @@ -18,13 +18,8 @@ nix = { package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes flakes ca-references - keep-derivations = true - keep-outputs = true - ''; gc = { - automatic = false; + automatic = true; user = "andreaciceri"; options = "--delete-older-than 3d"; }; diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix index 79d2776..4e15786 100644 --- a/hosts/pbp/configuration.nix +++ b/hosts/pbp/configuration.nix @@ -6,7 +6,7 @@ boot = { initrd.availableKernelModules = [ "usbhid" ]; kernelPackages = pbpKernelLatest; - kernelModules = []; + kernelModules = [ ]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; @@ -45,7 +45,16 @@ }; swapDevices = - [ { device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; } ]; + [{ device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; }]; + + + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index ee0d07b..b57e8f5 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -43,5 +43,13 @@ swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/users/profiles/emacs/default.nix b/users/profiles/emacs/default.nix index 1db6621..be92959 100644 --- a/users/profiles/emacs/default.nix +++ b/users/profiles/emacs/default.nix @@ -11,6 +11,10 @@ package = pkgs.customEmacs; }; + services.emacs = { + enable = true; + }; + # For some reason Hunspell dictionaries paths must be specified on Darwin home.sessionVariables = if pkgs.stdenv.hostPlatform.isDarwin then { diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix index eae5662..88b9dfc 100644 --- a/users/profiles/sway/default.nix +++ b/users/profiles/sway/default.nix @@ -57,7 +57,7 @@ ''; in lib.mkOptionDefault { - "${modifier}+x" = "exec emacs"; + "${modifier}+x" = "exec emacsclient -c"; "${modifier}+b" = "exec firefox"; "${modifier}+s" = "exec ${screenshotScript}"; };