about summary refs log tree commit diff
path: root/users/tazjin/nixos
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@tvl.su>2023-08-29T14·10+0300
committertazjin <tazjin@tvl.su>2023-08-29T15·14+0000
commitd4c8840c575c32247abfc035efb5d2e3830678c1 (patch)
tree6bff6a0f47d9b403c89d36ee90cc7f1f439ca433 /users/tazjin/nixos
parent804b7fbe73152ee19c585f388ad2aaf3cde15134 (diff)
refactor(tazjin/nixos): pick correct Emacs from a NixOS option r/6537
This gives me the ability to override the Emacs per-machine easily.

Change-Id: Id480889c108833b0a11c377a9b1e946900c5aba1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9166
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/nixos')
-rw-r--r--users/tazjin/nixos/modules/desktop.nix4
-rw-r--r--users/tazjin/nixos/modules/physical.nix170
2 files changed, 93 insertions, 81 deletions
diff --git a/users/tazjin/nixos/modules/desktop.nix b/users/tazjin/nixos/modules/desktop.nix
index 5ead46fff3..aec51f182a 100644
--- a/users/tazjin/nixos/modules/desktop.nix
+++ b/users/tazjin/nixos/modules/desktop.nix
@@ -1,5 +1,5 @@
 # EXWM and other desktop configuration.
-{ depot, lib, pkgs, ... }:
+{ config, depot, lib, pkgs, ... }:
 
 {
   services = {
@@ -29,7 +29,7 @@
 
       windowManager.session = lib.singleton {
         name = "exwm";
-        start = "${depot.users.tazjin.emacs}/bin/tazjins-emacs";
+        start = "${config.tazjin.emacs}/bin/tazjins-emacs";
       };
     };
   };
diff --git a/users/tazjin/nixos/modules/physical.nix b/users/tazjin/nixos/modules/physical.nix
index d74bcdb7fe..aa95559abf 100644
--- a/users/tazjin/nixos/modules/physical.nix
+++ b/users/tazjin/nixos/modules/physical.nix
@@ -1,91 +1,103 @@
 # Default configuration settings for physical machines that I use.
-{ lib, pkgs, depot, ... }:
+{ lib, pkgs, config, depot, ... }:
 
 let
   pass-otp = pkgs.pass.withExtensions (e: [ e.pass-otp ]);
 in
 {
-  # Install all the default software.
-  environment.systemPackages =
-    # programs from the depot
-    (with depot; [
-      users.tazjin.screenLock
-      users.tazjin.emacs
-      third_party.agenix.cli
-      third_party.josh
-    ]) ++
+  options = with lib; {
+    tazjin.emacs = mkOption {
+      type = types.package;
+      default = depot.users.tazjin.emacs;
+      description = ''
+        Derivation with my Emacs package, with configuration included.
+      '';
+    };
+  };
+
+  config = {
+    # Install all the default software.
+    environment.systemPackages =
+      # programs from the depot
+      (with depot; [
+        users.tazjin.screenLock
+        config.tazjin.emacs
+        third_party.agenix.cli
+        third_party.josh
+      ]) ++
 
-    # programs from nixpkgs
-    (with pkgs; [
-      (aspellWithDicts (d: [ d.ru ]))
-      amber
-      bat
-      curl
-      ddcutil
-      direnv
-      dnsutils
-      electrum
-      emacs-unstable # emacsclient
-      exa
-      fd
-      file
-      gdb
-      gh
-      git
-      gnupg
-      gtk3 # for gtk-launch
-      htop
-      hyperfine
-      iftop
-      imagemagick
-      jq
-      lieer
-      maim
-      man-pages
-      moreutils
-      mosh
-      msmtp
-      mullvad-vpn
-      networkmanagerapplet
-      nix-prefetch-github
-      nmap
-      notmuch
-      openssh
-      openssl
-      pass-otp
-      pavucontrol
-      pinentry
-      pinentry-emacs
-      pulseaudio # for pactl
-      pwgen
-      quasselClient
-      rink
-      ripgrep
-      rust-analyzer
-      rustup
-      screen
-      thunderbird
-      tig
-      tokei
-      tree
-      unzip
-      vlc
-      volumeicon
-      whois
-      xclip
-      xsecurelock
-      zoxide
-    ]);
+      # programs from nixpkgs
+      (with pkgs; [
+        (aspellWithDicts (d: [ d.ru ]))
+        amber
+        bat
+        curl
+        ddcutil
+        direnv
+        dnsutils
+        electrum
+        config.tazjin.emacs.emacs # emacsclient
+        exa
+        fd
+        file
+        gdb
+        gh
+        git
+        gnupg
+        gtk3 # for gtk-launch
+        htop
+        hyperfine
+        iftop
+        imagemagick
+        jq
+        lieer
+        maim
+        man-pages
+        moreutils
+        mosh
+        msmtp
+        mullvad-vpn
+        networkmanagerapplet
+        nix-prefetch-github
+        nmap
+        notmuch
+        openssh
+        openssl
+        pass-otp
+        pavucontrol
+        pinentry
+        pinentry-emacs
+        pulseaudio # for pactl
+        pwgen
+        quasselClient
+        rink
+        ripgrep
+        rust-analyzer
+        rustup
+        screen
+        thunderbird
+        tig
+        tokei
+        tree
+        unzip
+        vlc
+        volumeicon
+        whois
+        xclip
+        xsecurelock
+        zoxide
+      ]);
 
-  # Run services & configure programs for all machines.
-  services.fwupd.enable = true;
+    # Run services & configure programs for all machines.
+    services.fwupd.enable = true;
 
-  # Disable the broken NetworkManager-wait-online.service
-  systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
+    # Disable the broken NetworkManager-wait-online.service
+    systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
 
-  programs = {
-    fish.enable = true;
-    mosh.enable = true;
-    ssh.startAgent = true;
+    programs = {
+      fish.enable = true;
+      mosh.enable = true;
+      ssh.startAgent = true;
+    };
   };
 }