User Tools

Site Tools


configuration.nix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
configuration.nix [2026/06/18 18:52] – Tweaks samconfiguration.nix [2026/06/29 14:27] (current) – tweaks sam
Line 1: Line 1:
 ====== My Nix Configuration ====== ====== My Nix Configuration ======
 +
 +In order to edit the configuration without root permissions, it is convenient to symlink ''configuration.nix'' to my user's home directory, like this:
 +<code>
 +mkdir ~/etc
 +sudo mv /etc/nixos/ ~/etc/
 +sudo chown -R $(id -un):users ~/etc/nixos/
 +sudo ln -s ~/etc/nixos/ /etc/
 +</code>
 +
 +===== The Configuration =====
  
 <code> <code>
Line 35: Line 45:
   # Enable networking   # Enable networking
   networking.networkmanager.enable = true;   networking.networkmanager.enable = true;
 +
 +  # Enable bluetooth
 +  hardware.bluetooth = {
 +    enable = true;
 +    powerOnBoot = false;
 +  };
  
   # Set your time zone.   # Set your time zone.
Line 75: Line 91:
   security.pam.services = {   security.pam.services = {
     greetd.enableGnomeKeyring = true;     greetd.enableGnomeKeyring = true;
 +    # Necessary for swaylock to work correctly.
 +    swaylock = {};
   };   };
  
Line 86: Line 104:
       };       };
     };     };
 +  };
 +
 +  services.logind.settings.Login = {
 +    # don’t shutdown when power button is short-pressed. We want sway
 +    # to handle that key instead.
 +    HandlePowerKey = "ignore";
   };   };
  
Line 105: Line 129:
   # when necessary.   # when necessary.
   services.thermald.enable = true;   services.thermald.enable = true;
 +
 +  # A service which automatically mounts external storage devices.
 +  services.udisks2.enable = true;
  
   ## Printing ##########   ## Printing ##########
Line 130: Line 157:
       # Permits adjustment of audio volume via pactl       # Permits adjustment of audio volume via pactl
       pactl = "${pkgs.pulseaudio}/bin/pactl";       pactl = "${pkgs.pulseaudio}/bin/pactl";
 +      # Permits locking the screen
 +      swaylock = "${pkgs.swaylock}/bin/swaylock";
     in {     in {
       home.packages = with pkgs; [       home.packages = with pkgs; [
-        kdePackages.falkon 
- 
         # For keeping track of passwords:         # For keeping track of passwords:
         pass         pass
Line 198: Line 225:
         # text rendering:         # text rendering:
         extraConfig = "text_composition_strategy 1.5 15";         extraConfig = "text_composition_strategy 1.5 15";
 +      };
 +
 +      programs.rofi = {
 +        enable = true;
 +        modes = [ "drun" ];
 +        theme = "dmenu";
 +      };
 +
 +      # Client for udisks2
 +      services.udiskie = {
 +        enable = true;
       };       };
  
Line 208: Line 246:
         # it later.         # it later.
         MU4E = "${pkgs.mu.mu4e}";         MU4E = "${pkgs.mu.mu4e}";
 +        EDITOR = "emacsclient";
       };       };
  
Line 265: Line 304:
  
                 # Launching                 # Launching
 +                "${modifier}+d" = "exec rofi -show";
                 "${modifier}+Return" = "exec kitty";                 "${modifier}+Return" = "exec kitty";
                 "${modifier}+e" = "exec emacsclient -c";                 "${modifier}+e" = "exec emacsclient -c";
-                "${modifier}+b" = "exec falkon";+                "${modifier}+b" = "exec firefox"; 
 + 
 +                # Locking 
 +                "XF86PowerOff" = "exec ${swaylock}";
               }               }
             ];             ];
Line 310: Line 353:
         ];         ];
         events = {         events = {
-          "after-resume" = "${brightnessctl} -r"; # Restore the previous brightness.;+          # Restore the previously saved brightness. 
 +          "after-resume" = "${brightnessctl} -r"; 
 +          "before-sleep" = "${swaylock}";
         };         };
 +      };
 +
 +      # Locks the screen when power button is pressed.
 +      programs.swaylock = {
 +        enable = true;
 +      };
 +
 +      # Displays notifications when called upon.
 +      services.mako = {
 +        enable = true;
 +        settings = {
 +          default-timeout = 5000; # 5 seconds.
 +        };
 +      };
 +
 +      programs.firefox = {
 +        enable = true;
       };       };
  
Line 339: Line 401:
   # $ nix search wget   # $ nix search wget
   environment.systemPackages = with pkgs; [   environment.systemPackages = with pkgs; [
-    pkgs.direnv +    libnotify          # Send notifications to the notification daemon
- +    wl-clipboard       # Copy/Paste from the terminal (`wl-copy/paste`). 
-    # A PDF viewer +    direnv 
-    pkgs.kdePackages.okular+    kdePackages.okular # A PDF viewer 
 +    darktable          # Raw image editor 
 +    gphoto2            # A command-line program to communicate with cameras
  
     ## In Service of Emacs ##########     ## In Service of Emacs ##########
Line 348: Line 412:
     # Ghostscript is necessary to interpret PDF files in emacs'     # Ghostscript is necessary to interpret PDF files in emacs'
     # document viewer.     # document viewer.
-    pkgs.ghostscript +    ghostscript 
-    # A spell-checking library+    ispell             # A spell-checking program
-    pkgs.ispell +    ripgrep            # A better grep.
-    # A better grep +
-    pkgs.ripgrep+
   ];   ];
- 
-  # Some programs need SUID wrappers, can be configured further or are 
-  # started in user sessions. 
-  # programs.mtr.enable = true; 
-  # programs.gnupg.agent = { 
-  #   enable = true; 
-  #   enableSSHSupport = true; 
-  # }; 
- 
-  # List services that you want to enable: 
- 
-  # Enable the OpenSSH daemon. 
-  # services.openssh.enable = true; 
- 
-  # Open ports in the firewall. 
-  # networking.firewall.allowedTCPPorts = [ ... ]; 
-  # networking.firewall.allowedUDPPorts = [ ... ]; 
-  # Or disable the firewall altogether. 
-  # networking.firewall.enable = false; 
  
   # This value determines the NixOS release from which the default   # This value determines the NixOS release from which the default
configuration.nix.1781808738.txt.gz · Last modified: by sam