acpid: inc/dec brightness by 1 instead of 10
[julm/julm-nix.git] / nixos / profiles / system.nix
index e17a18291294c7e60351481fba4d870bbc42805d..e4b7424c6f4108cb02aca2671983d9212835cad3 100644 (file)
@@ -3,6 +3,7 @@ with lib;
 {
   boot.tmp.cleanOnBoot = mkDefault true;
   boot.tmp.useTmpfs = mkDefault true;
+
   services.logrotate.enable = true;
   # NOTE: mostly useless on a server, and CPU intensive.
   documentation = {
@@ -14,6 +15,7 @@ with lib;
     nixos.enable = mkDefault false;
   };
   programs.vim.defaultEditor = mkDefault true;
+  programs.vim.enable = mkDefault true;
   environment.variables = {
     EDITOR = "vim";
     NIXPKGS_CONFIG = mkForce "";
@@ -28,7 +30,7 @@ with lib;
       ../../home-manager/options.nix
       ../../home-manager/profiles/essential.nix
     ];
-    services.gpg-agent.pinentryFlavor = "curses";
+    services.gpg-agent.pinentryPackage = pkgs.pinentry-curses;
   };
   nix = {
     settings.auto-optimise-store = mkDefault true;
@@ -36,9 +38,21 @@ with lib;
     gc.dates = mkDefault "weekly";
     gc.options = mkDefault "--delete-older-than 7d";
     nixPath = mkForce [ ];
+    # Pin the rev to the revision of the public Nixpkgs that the system was built from.
+    # This is the version which will be locked by flakes using flake:nixpkgs
     #registry.nixpkgs = mkDefault { flake = inputs.nixpkgs; };
-    package = pkgs.nixFlakes;
-    settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
+    registry.nixpkgs = {
+      from = { id = "nixpkgs"; type = "indirect"; };
+      to = {
+        owner = "NixOS";
+        repo = "nixpkgs";
+        inherit (inputs.nixpkgs) rev;
+        # May be overriden by nixos/modules/installer/cd-dvd/channel.nix
+        type = mkDefault "github";
+      };
+    };
+    package = pkgs.nixVersions.stable;
+    settings.experimental-features = [ "nix-command" "flakes" ];
   };
   security.lockKernelModules = false;
   services.journald = {
@@ -49,13 +63,18 @@ with lib;
       SystemMaxUse=100M
     '';
   };
+  # none is the recommended elevator for SSD, whereas HDD could use mq-deadline.
+  services.udev.extraRules = ''
+    ACTION=="add|change", KERNEL=="sd[a-z][0-9]*", ATTR{../queue/rotational}=="0", ATTR{../queue/scheduler}="none"
+    ACTION=="add|change", KERNEL=="nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/rotational}=="0", ATTR{../queue/scheduler}="none"
+  '';
   systemd.oomd = {
     enable = mkDefault true;
     enableRootSlice = mkDefault true;
     enableSystemSlice = mkDefault true;
-    enableUserServices = mkDefault true;
+    enableUserSlices = mkDefault true;
   };
-  systemd.services.openssh = {
+  systemd.services.sshd = {
     serviceConfig = {
       ManagedOOMPreference = "omit";
     };