diff --git a/SwarselSystems.org b/SwarselSystems.org index 8382b53..28f6ddc 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -524,7 +524,7 @@ Lastly I define some common module lists that I can simply load depending on the # # NixOS modules that can only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix - # inputs.lanzaboote.nixosModules.lanzaboote + inputs.lanzaboote.nixosModules.lanzaboote inputs.disko.nixosModules.disko # inputs.impermanence.nixosModules.impermanence inputs.sops-nix.nixosModules.sops @@ -2008,7 +2008,7 @@ My work machine. #+begin_src nix :tangle profiles/nbl-imba-2/default.nix - { inputs, outputs, config, pkgs, ... }: + { inputs, outputs, config, pkgs, lib, ... }: { imports = [ @@ -2043,8 +2043,12 @@ My work machine. networking.networkmanager.wifi.scanRandMacAddress = false; boot = { - loader.systemd-boot.enable = true; + loader.systemd-boot.enable = lib.mkForce false; loader.efi.canTouchEfiVariables = true; + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; supportedFilesystems = [ "btrfs" ]; kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ @@ -5420,6 +5424,9 @@ Mostly used to install some compilers and lsp's that I want to have available wh # pinentry + # secure boot + sbctl + nix-index # keyboards diff --git a/index.html b/index.html index 575e6a1..869724b 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -223,7 +223,7 @@ -
  • 3.2. Overlays, packages, and modules +
  • 3.2. Overlays, packages, and modules
  • -
  • 3.3. NixOS +
  • 3.3. NixOS
  • -
  • 3.4. Home-manager +
  • 3.4. Home-manager
  • 3.5. flake.nix template @@ -310,7 +310,7 @@ @@ -1012,7 +1012,7 @@ pkgsFor = lib.genAttrs (import systems) ( # # NixOS modules that can only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix - # inputs.lanzaboote.nixosModules.lanzaboote + inputs.lanzaboote.nixosModules.lanzaboote inputs.disko.nixosModules.disko # inputs.impermanence.nixosModules.impermanence inputs.sops-nix.nixosModules.sops @@ -1036,8 +1036,8 @@ mixedModules = [ -
    -

    2.3.3. General (outputs)

    +
    +

    2.3.3. General (outputs)

    @@ -2424,7 +2424,7 @@ in
     
  • -
  • Home-manager only
    +
  • Home-manager only
    @@ -2625,7 +2625,7 @@ My work machine.
     
     
    -{ inputs, outputs, config, pkgs, ... }:
    +{ inputs, outputs, config, pkgs, lib, ... }:
     {
     
       imports = [
    @@ -2660,8 +2660,12 @@ My work machine.
       networking.networkmanager.wifi.scanRandMacAddress = false;
     
       boot = {
    -    loader.systemd-boot.enable = true;
    +    loader.systemd-boot.enable = lib.mkForce false;
         loader.efi.canTouchEfiVariables = true;
    +    lanzaboote = {
    +      enable = true;
    +      pkiBundle = "/etc/secureboot";
    +    };
         supportedFilesystems = [ "btrfs" ];
         kernelPackages = pkgs.linuxPackages_latest;
         kernelParams = [
    @@ -4854,8 +4858,8 @@ in
     
     
    -
    -

    3.2. Overlays, packages, and modules

    +
    +

    3.2. Overlays, packages, and modules

    In this section I define packages that I manually want to nixpkgs. This can be useful for packages that are currently awaiting a PR or public packages that I do not want to maintain. @@ -4874,8 +4878,8 @@ These are for packages that are on nixpkgs, but do not fit my usecase, meaning I This is simply a mirror of the most recent stable branch of nixpkgs. Useful for packages that are broken on nixpkgs, but do not need to be on bleeding edge anyways.

  • -
    -

    3.2.1. Packages

    +
    +

    3.2.1. Packages

    @@ -4894,13 +4898,14 @@ in
       swarselcheck = callPackage ./swarselcheck { };
       waybarupdate = callPackage ./waybarupdate { };
       opacitytoggle = callPackage ./opacitytoggle { };
    +  fs-diff = callPackage ./fs-diff { };
     }
     
     
      -
    1. pass-fuzzel
      +
    2. pass-fuzzel
      # Adapted from https://code.kulupu.party/thesuess/home-manager/src/branch/main/modules/river.nix
      @@ -4962,7 +4967,7 @@ writeShellApplication {
       
    3. -
    4. cura5
      +
    5. cura5
      @@ -4999,7 +5004,7 @@ writeScriptBin "cura" ''
       
    6. -
    7. cdw
      +
    8. cdw
      @@ -5018,7 +5023,7 @@ writeShellApplication {
       
    9. -
    10. cdb
      +
    11. cdb
      @@ -5036,7 +5041,7 @@ writeShellApplication {
       
    12. -
    13. bak
      +
    14. bak
      @@ -5054,7 +5059,7 @@ writeShellApplication {
       
    15. -
    16. timer
      +
    17. timer
      @@ -5072,7 +5077,7 @@ writeShellApplication {
       
    18. -
    19. e
      +
    20. e
      wait=0
      @@ -5113,7 +5118,7 @@ writeShellApplication {
       
    21. -
    22. command-not-found
      +
    23. command-not-found
      # Adapted from https://github.com/bennofs/nix-index/blob/master/command-not-found.sh
      @@ -5152,7 +5157,7 @@ command_not_found_handler () {
       
    24. -
    25. swarselcheck
      +
    26. swarselcheck
      kitty=0
      @@ -5227,7 +5232,7 @@ writeShellApplication {
       
    27. -
    28. waybarupdate
      +
    29. waybarupdate
      CFG=$(git --git-dir="$HOME"/.dotfiles/.git --work-tree="$HOME"/.dotfiles/ status -s | wc -l)
      @@ -5271,7 +5276,7 @@ writeShellApplication {
       
    30. -
    31. opacitytoggle
      +
    32. opacitytoggle
      if swaymsg opacity plus 0.01 -q; then
      @@ -5294,10 +5299,47 @@ writeShellApplication {
       
    33. +
    34. fs-diff
      +
      +
      +
      set -euo pipefail
      +
      +OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
      +OLD_TRANSID=${OLD_TRANSID#transid marker was }
      +
      +sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
      +sed '$d' |
      +cut -f17- -d' ' |
      +sort |
      +uniq |
      +while read -r path; do
      +  path="/$path"
      +  if [ -L "$path" ]; then
      +    : # The path is a symbolic link, so is probably handled by NixOS already
      +  elif [ -d "$path" ]; then
      +    : # The path is a directory, ignore
      +  else
      +    echo "$path"
      +  fi
      +done
      +
      +
      + +
      +
      { writeShellApplication, sway}:
      +
      +writeShellApplication {
      +  name = "fs-diff";
      +  text = builtins.readFile ../../scripts/fs-diff.sh;
      +}
      +
      +
      +
      +
    -
    -

    3.2.2. Overlays

    +
    +

    3.2.2. Overlays

    @@ -5330,15 +5372,15 @@ writeShellApplication {
     
    -
    -

    3.2.3. Modules

    +
    +

    3.2.3. Modules

    In this section I define custom modules under the swarsel attribute. These are mostly used to define settings specific to a host. I keep these settings confined to either home-manager or nixos to maintain compatibility with non-NixOS machines.

      -
    1. NixOS
      +
    2. NixOS

      Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS @@ -5356,7 +5398,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a

      -
    1. Wallpaper
      +
    2. Wallpaper
      { lib, ... }:
      @@ -5372,7 +5414,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    3. -
    4. Hardware
      +
    5. Hardware
      { lib, ... }:
      @@ -5390,7 +5432,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    6. -
    7. Setup
      +
    8. Setup
      { lib, ... }:
      @@ -5402,7 +5444,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    9. -
    10. Impermanence
      +
    11. Impermanence
      { lib, ... }:
      @@ -5414,7 +5456,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    12. -
    13. Filesystem
      +
    14. Filesystem
      { lib, ... }:
      @@ -5428,7 +5470,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    -
  • home-manager
    +
  • home-manager
    {
    @@ -5446,7 +5488,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
     
      -
    1. Laptop
      +
    2. Laptop
      { lib, config, ... }:
      @@ -5481,7 +5523,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    3. -
    4. Hardware
      +
    5. Hardware
      { lib, ... }:
      @@ -5505,7 +5547,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
       
    6. -
    7. Waybar
      +
    8. Waybar
        { lib, config, ... }:
      @@ -5545,7 +5587,7 @@ in
       
    9. -
    10. Monitors
      +
    11. Monitors
      { lib, ... }:
      @@ -5562,7 +5604,7 @@ in
       
    12. -
    13. Input
      +
    14. Input
      { lib, config, ... }:
      @@ -5602,7 +5644,7 @@ in
       
    15. -
    16. Nixos
      +
    17. Nixos
      { lib, config, ... }:
      @@ -5638,7 +5680,7 @@ in
       
    18. -
    19. System startup
      +
    20. System startup
      { lib, ... }:
      @@ -5663,7 +5705,7 @@ in
       
    21. -
    22. Wallpaper
      +
    23. Wallpaper
      { lib, ... }:
      @@ -5679,7 +5721,7 @@ in
       
    24. -
    25. Filesystem
      +
    26. Filesystem
      { lib, ... }:
      @@ -5696,8 +5738,8 @@ in
       
  • -
    -

    3.3. NixOS

    +
    +

    3.3. NixOS

    @@ -5708,7 +5750,7 @@ These are system-level settings specific to NixOS machines. All settings that ar

      -
    1. Imports, enable home-manager module, stateVersion
      +
    2. Imports, enable home-manager module, stateVersion

      :CUSTOMID: h:45e4315b-0929-4c47-b65a-c8f0a685f4df @@ -6275,7 +6317,7 @@ in

    -
  • Theme (stylix)
    +
  • Theme (stylix)

    By default, stylix wants to style GRUB as well. However, I think that looks horrible. @@ -6375,6 +6417,11 @@ Mostly used to install some compilers and lsp's that I want to have available wh # pinentry + # secure boot + sbctl + + nix-index + # keyboards qmk vial @@ -6463,7 +6510,7 @@ Some programs profit from being installed through dedicated NixOS settings on sy

    1. -
    2. zsh
      +
    3. zsh

      Do not touch this. @@ -6481,7 +6528,7 @@ Do not touch this.

    -
  • syncthing
    +
  • syncthing
    @@ -6558,7 +6605,7 @@ Enables the blueman service including the nice system tray icon.
     
  • -
  • Network devices
    +
  • Network devices

    In this section we enable compatibility with several network devices I have at home, mainly printers and scanners. @@ -6610,7 +6657,7 @@ services.printing = {

  • -
  • Avahi (device discovery)
    +
  • Avahi (device discovery)

    Avahi is the service used for the network discovery. @@ -6686,7 +6733,7 @@ This is a super-convenient package that lets my remap my CAPS key t

  • -
  • power-profiles-daemon
    +
  • power-profiles-daemon
    _ :
    @@ -6771,39 +6818,80 @@ This section houses the greetd related settings. I do not really want to use a d
     
  • -
  • nix-ld
    +
  • nix-ld
    { pkgs, ... }:
     {
    -  programs.nix-ld. = {
    +  programs.nix-ld = {
         enable = true;
         libraries = with pkgs; [
    +      SDL
    +      SDL2
    +      SDL2_image
    +      SDL2_mixer
    +      SDL2_ttf
    +      SDL_image
    +      SDL_mixer
    +      SDL_ttf
           alsa-lib
    +      alsaLib
           at-spi2-atk
           at-spi2-core
           atk
    +      bzip2
           cairo
           cups
           curl
           dbus
    +      dbus-glib
           expat
    +      ffmpeg
    +      flac
           fontconfig
    +      freeglut
           freetype
           fuse3
           gdk-pixbuf
    +      glew110
           glib
    +      gnome2.GConf
    +      gnome2.pango
    +      gtk2
           gtk3
           icu
           libGL
    +      libappindicator-gtk2
           libappindicator-gtk3
    +      libcaca
    +      libcanberra
    +      libcap
    +      libdbusmenu-gtk2
           libdrm
    +      libelf
    +      libgcrypt
           libglvnd
    +      libidn
    +      libindicator-gtk2
    +      libjpeg
    +      libmikmod
           libnotify
    +      libogg
    +      libpng
    +      libpng12
           libpulseaudio
    +      librsvg
    +      libsamplerate
    +      libtheora
    +      libtiff
    +      libudev0-shim
           libunwind
           libusb1
           libuuid
    +      libva
    +      libvdpau
    +      libvorbis
    +      libvpx
           libxkbcommon
           libxml2
           mesa
    @@ -6812,9 +6900,32 @@ This section houses the greetd related settings. I do not really want to use a d
           openssl
           pango
           pipewire
    +      pixman
    +      speex
           stdenv.cc.cc
           systemd
    +      tbb
           vulkan-loader
    +      xorg.libICE
    +      xorg.libSM
    +      xorg.libX11
    +      xorg.libXScrnSaver
    +      xorg.libXcomposite
    +      xorg.libXcursor
    +      xorg.libXdamage
    +      xorg.libXext
    +      xorg.libXfixes
    +      xorg.libXft
    +      xorg.libXi
    +      xorg.libXinerama
    +      xorg.libXmu
    +      xorg.libXrandr
    +      xorg.libXrender
    +      xorg.libXt
    +      xorg.libXtst
    +      xorg.libXxf86vm
    +      xorg.libxcb
    +      xorg.libxshmfence
           zlib
         ];
       };
    @@ -6823,7 +6934,7 @@ This section houses the greetd related settings. I do not really want to use a d
     
  • -
  • Impermanence
    +
  • Impermanence
    { config, lib, ... }:
    @@ -6919,12 +7030,12 @@ This section houses the greetd related settings. I do not really want to use a d
     
  • -
    -

    3.3.2. Optional

    +
    +

    3.3.2. Optional

      -
    1. gaming
      +
    2. gaming
      { pkgs, ... }:
      @@ -6957,7 +7068,7 @@ This section houses the greetd related settings. I do not really want to use a d
       
    3. -
    4. VirtualBox
      +
    5. VirtualBox
        _ :
      @@ -6977,7 +7088,7 @@ This section houses the greetd related settings. I do not really want to use a d
       
    6. -
    7. Auto-login
      +
    8. Auto-login
      _ :
      @@ -6991,7 +7102,7 @@ This section houses the greetd related settings. I do not really want to use a d
       
    9. -
    10. nswitch-rcm
      +
    11. nswitch-rcm
      { pkgs, ... }:
      @@ -7008,7 +7119,7 @@ This section houses the greetd related settings. I do not really want to use a d
       
    12. -
    13. work
      +
    14. work
      { pkgs, ... }:
      @@ -7026,8 +7137,8 @@ This section houses the greetd related settings. I do not really want to use a d
       
    -
    -

    3.4. Home-manager

    +
    +

    3.4. Home-manager

    @@ -7035,7 +7146,7 @@ This section houses the greetd related settings. I do not really want to use a d
      -
    1. Imports
      +
    2. Imports

      This section sets up all the imports that are used in the home-manager section. @@ -7288,6 +7399,7 @@ Programming languages and default lsp's are defined here:

    -
  • nix-index
    +
  • nix-index

    nix-index provides a way to find out which packages are provided by which derivations. By default it also comes with a replacement for command-not-found.sh, however, the implementation is based on a channel based setup. I like consistency, so I replace the command with one that provides a flakes-based output. @@ -8067,6 +8179,8 @@ Here we set some aliases (some of them should be shellApplications instead) as w hotspot = "nmcli connection up local; nmcli device wifi hotspot;"; cd = "z"; cdr = "cd \"$( (find /home/swarsel/Documents/GitHub -maxdepth 1 && echo /home/swarsel/.dotfiles) | fzf )\""; + nix-ldd = "LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH ldd"; + fs-diff = "sudo mount -o subvol=/ /dev/mapper/cryptroot /mnt ; fs-diff"; }; autosuggestion.enable = true; enableCompletion = true; @@ -9046,7 +9160,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se

  • -
  • gpg-agent
    +
  • gpg-agent
    { pkgs, ... }:
    @@ -9068,7 +9182,7 @@ services.gpg-agent = {
     
  • -
  • gammastep
    +
  • gammastep
    _:
    @@ -9086,12 +9200,12 @@ services.gpg-agent = {
     
  • -
    -

    3.4.2. Optional

    +
    +

    3.4.2. Optional

      -
    1. Gaming
      +
    2. Gaming
      @@ -9127,7 +9241,7 @@ services.gpg-agent = {
       
    3. -
    4. Work
      +
    5. Work
      @@ -9138,6 +9252,15 @@ services.gpg-agent = {
            teams-for-linux
            google-chrome
          ];
      +
      +   programs.ssh = {
      +     matchBlocks = {
      +       "*.vbc.ac.at" = {
      +         user = "dc_adm_schwarzaeugl";
      +       };
      +     };
      +   };
      +
        }
       
       
      @@ -9292,7 +9415,7 @@ This tangles the flake.nix file; This block only needs to be touched when updati # # NixOS modules that can only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix - # inputs.lanzaboote.nixosModules.lanzaboote + inputs.lanzaboote.nixosModules.lanzaboote inputs.disko.nixosModules.disko # inputs.impermanence.nixosModules.impermanence inputs.sops-nix.nixosModules.sops @@ -10182,7 +10305,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
    6. -
    7. Nix common prefix bracketer
      +
    8. Nix common prefix bracketer

      This function searches for common delimiters in region and removes them, summarizing all captured lines by it. @@ -10215,7 +10338,7 @@ This function searches for common delimiters in region and removes them, summari

    -
  • Nix formatters
    +
  • Nix formatters

    This formats the org code block at point in accordance to the nixpkgs-fmt formatter @@ -11788,8 +11911,8 @@ This adds a rudimentary nix-mode to Emacs. I have not really tried this out, as

  • -
    -

    4.4.3. nixpkgs-fmt

    +
    +

    4.4.3. nixpkgs-fmt

    Adds functions for formatting nix code. @@ -13804,7 +13927,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar

    Author: Leon Schwarzäugl

    -

    Created: 2024-08-04 So 11:19

    +

    Created: 2024-08-05 Mo 01:47

    Validate

    diff --git a/profiles/nbl-imba-2/default.nix b/profiles/nbl-imba-2/default.nix index d429f61..70d6400 100644 --- a/profiles/nbl-imba-2/default.nix +++ b/profiles/nbl-imba-2/default.nix @@ -1,4 +1,4 @@ -{ inputs, outputs, config, pkgs, ... }: +{ inputs, outputs, config, pkgs, lib, ... }: { imports = [ @@ -33,8 +33,12 @@ networking.networkmanager.wifi.scanRandMacAddress = false; boot = { - loader.systemd-boot.enable = true; + loader.systemd-boot.enable = lib.mkForce false; loader.efi.canTouchEfiVariables = true; + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; supportedFilesystems = [ "btrfs" ]; kernelPackages = pkgs.linuxPackages_latest; kernelParams = [