the configuration for all my nixos machines (hacky! bad! ugly!)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

laptopification and other stuff

+72 -36
+10 -33
hosts/prospero/configuration.nix
··· 5 5 { config, lib, pkgs, ... }: 6 6 7 7 { 8 - nix.settings.experimental-features = ["nix-command" "flakes"]; 9 8 imports = 10 9 [ # Include the results of the hardware scan. 11 10 ./hardware-configuration.nix 12 11 ]; 13 - hardware.bluetooth.enable = true; 14 12 # Bootloader. 15 13 boot.loader.systemd-boot.enable = true; 16 14 boot.loader.efi.canTouchEfiVariables = true; ··· 33 31 # Enable networking 34 32 networking.networkmanager.enable = true; 35 33 36 - # Enable touchpad support (enabled default in most desktopManager). 37 - # services.xserver.libinput.enable = true; 38 - 39 - # Define a user account. Don't forget to set a password with ‘passwd’. 40 - 41 - # List packages installed in system profile. To search, run: 42 - # $ nix search wget 43 34 environment.systemPackages = with pkgs; [ 44 - gcc 45 - gnumake 46 - bison 47 - flex 48 - autoconf 49 - automake 50 - libtool 51 - discord 52 - calibre 53 - libreoffice 54 - enchant 55 - rustup 56 - pkg-config 57 - passt 58 - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. 59 - # wget 60 35 ]; 61 36 62 37 # programs.mtr.enable = true; ··· 73 48 # networking.firewall.allowedTCPPorts = [ ... ]; 74 49 # networking.firewall.allowedUDPPorts = [ ... ]; 75 50 # Or disable the firewall altogether. 76 - 77 - # This value determines the NixOS release from which the default 78 - # settings for stateful data, like file locations and database versions 79 - # on your system were taken. It‘s perfectly fine and recommended to leave 80 - # this value at the release version of the first install of this system. 81 - # Before changing this value read the documentation for this option 82 - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). 83 51 system.stateVersion = "25.05"; # Did you read the comment? 84 - 52 + profiles = { 53 + desktop = { 54 + enable = true; 55 + niri.enable = true; 56 + }; 57 + laptop.enable = true; 58 + perftools.enable = true; 59 + games.enable = true; 60 + docs.enable = true; 61 + }; 85 62 }
+3 -1
hosts/prospero/default.nix
··· 3 3 modules = [ 4 4 ./configuration.nix 5 5 ]; 6 - home.modules = ./home.nix; 6 + home.modules = [ 7 + ./home.nix 8 + ]; 7 9 }
+6 -1
hosts/prospero/home.nix
··· 1 1 {...}: 2 - {} 2 + { 3 + profiles = { 4 + desktop.enable = true; 5 + desktop.niri.enable = true; 6 + }; 7 + }
-1
hosts/uruk/configuration.nix
··· 36 36 games.enable = true; 37 37 docs.enable = true; 38 38 zfs.enable = true; 39 - # nix-ld.enable = true; 40 39 }; 41 40 } 42 41
+1
modules/home/profiles/desktop/niri.nix
··· 77 77 }; 78 78 programs.niri.settings = { 79 79 prefer-no-csd = true; 80 + cursor.size = 12; 80 81 layout = { 81 82 gaps = 10; 82 83 preset-column-widths = [
+1
modules/nixos/default.nix
··· 7 7 ./profiles/docs.nix 8 8 ./profiles/games.nix 9 9 ./profiles/desktop 10 + ./profiles/laptop.nix 10 11 ]; 11 12 12 13 console = {
+51
modules/nixos/profiles/laptop.nix
··· 1 + { lib, config, pkgs, ... }: 2 + let cfg = config.profiles.laptop; 3 + in { 4 + options.profiles.laptop = with lib; { 5 + enable = mkEnableOption "laptop profile"; 6 + suspendThenHibernate = { 7 + enable = mkOption { 8 + type = types.bool; 9 + default = true; 10 + description = 11 + "Whether to setup suspend then hibernate when closing the lid."; 12 + }; 13 + delayHours = mkOption { 14 + type = types.int; 15 + default = 1; 16 + description = 17 + "Delay in hours before it should hibernate the laptop after suspending."; 18 + }; 19 + }; 20 + }; 21 + 22 + config = with lib; mkIf cfg.enable 23 + { 24 + # Enabling the laptop profile automatically enables the 25 + # desktop profile too. 26 + profiles.desktop.enable = mkDefault true; 27 + 28 + services = { 29 + # Enable UPower to watch battery stats. 30 + upower.enable = mkDefault true; 31 + # enable ppd 32 + tuned.enable = mkDefault true; 33 + }; 34 + 35 + # Enable light to control backlight. 36 + powerManagement.powertop.enable = mkDefault true; 37 + 38 + environment.systemPackages = with pkgs; [ powertop brightnessctl ]; 39 + 40 + # Setup suspend then hibernate. 41 + services.logind.lidSwitch = 42 + if cfg.suspendThenHibernate.enable then 43 + "suspend-then-hibernate" 44 + else 45 + "suspend"; 46 + # as per the systemd manual this does nothing if suspend-then-hibernate is 47 + # not enabled, so we might as well set it unconditionally. 48 + systemd.sleep.settings.Sleep.HibernateDelaySec = 49 + "${builtins.toString cfg.suspendThenHibernate.delayHours}h"; 50 + }; 51 + }