diff --git a/SwarselSystems.org b/SwarselSystems.org index caf1dae..bb95876 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -492,7 +492,7 @@ This file defines the templates that are being exposed by the flake. These can b "default" ]; in - lib.swarselsystems.mkTemplates templateNames + lib.swarselsystems.mkTemplates templateNames #+end_src @@ -4419,7 +4419,8 @@ A breakdown of each function: path = "${self}/templates/${name}"; description = "${name} project "; }; - }) names); + }) + names); eachMonitor = _: monitor: { inherit (monitor) name; @@ -4657,57 +4658,57 @@ Mostly used to install some compilers and lsp's that I want to have available wh # lsp-related ------------------------------- # nix # latex - texlab + # texlab ghostscript_headless # wireguard wireguard-tools # rust - rust-analyzer - clippy - rustfmt + # rust-analyzer + # clippy + # rustfmt # go - go - gopls + # go + # gopls # nix nixd # zig zig zls # cpp - clang-tools + # clang-tools # + cuda - cudatoolkit + # cudatoolkit # ansible # ansible-lint # ansible-language-server # molecule #lsp-bridge / python - gcc - gdb + # gcc + # gdb # (python3.withPackages (ps: with ps; [ jupyter ipython pyqt5 epc orjson sexpdata six setuptools paramiko numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server ])) # (python3.withPackages(ps: with ps; [ jupyter ipython pyqt5 numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server])) # -------------------------------------------- - (stdenv.mkDerivation { - name = "oama"; + # (stdenv.mkDerivation { + # name = "oama"; - src = pkgs.fetchurl { - name = "oama"; - url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz"; - sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc="; - }; + # src = pkgs.fetchurl { + # name = "oama"; + # url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz"; + # sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc="; + # }; - phases = [ - "unpackPhase" - ]; + # phases = [ + # "unpackPhase" + # ]; - unpackPhase = '' - mkdir -p $out/bin - tar xvf $src -C $out/ - mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/ - ''; + # unpackPhase = '' + # mkdir -p $out/bin + # tar xvf $src -C $out/ + # mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/ + # ''; - }) + # }) ]; } @@ -12164,8 +12165,8 @@ Lastly, I load the =highlight-indent-guides= package. This adds a neat visual in (set-face-attribute 'highlight-indent-guides-stack-even-face nil :background "gray40") (set-face-attribute 'highlight-indent-guides-stack-odd-face nil :background "gray50")) - (use-package aggressive-indent) - (global-aggressive-indent-mode 1) + ;; (use-package aggressive-indent) + ;; (global-aggressive-indent-mode 1) #+end_src diff --git a/index.html b/index.html index f60b0e5..1347bb4 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 @@ -204,16 +204,17 @@
  • 1. Introduction (no code)
  • 2. flake.nix
  • 3. System @@ -293,6 +294,7 @@
  • 3.2.1.22. ts2t
  • 3.2.1.23. vershell
  • 3.2.1.24. eontimer
  • +
  • 3.2.1.25. project
  • 3.2.2. Overlays (additions, overrides, nixpkgs-stable)
  • @@ -553,6 +555,7 @@
  • 4.3.7.4. evil-cleverparens
  • 4.3.7.5. evil-surround
  • 4.3.7.6. evil-visual-mark-mode
  • +
  • 4.3.7.7. evil-textobj-tree-sitter
  • 4.3.8. ispell
  • @@ -681,7 +684,7 @@

    -This file has 57175 words spanning 14786 lines and was last revised on 2024-12-29 20:11:24 +0100. +This file has 57884 words spanning 14894 lines and was last revised on 2024-12-31 21:56:30 +0100.

    @@ -734,7 +737,7 @@ This section defines my Emacs configuration. For a while, I considered to use ry

    -My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-29 20:11:24 +0100) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-12-31 21:56:30 +0100)

    @@ -746,7 +749,7 @@ system-configuration-options
    ---prefix=/nix/store/qg96jwf3hwpzyydpibyg6vz1dk525cmj-emacs-pgtk-20241209.0 --disable-build-details --with-modules --with-pgtk --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --without-xwidgets --with-dbus --with-selinux
    +--prefix=/nix/store/hzdmp1fxycaibbpk8lr0imjzi8n7yr4i-emacs-pgtk-20241230.0 --disable-build-details --with-modules --with-pgtk --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --without-xwidgets --with-dbus --with-selinux
     
    @@ -826,7 +829,7 @@ These blocks are later inserted here: -

    2.1. flake.nix template

    +

    2.1. flake.nix skeleton

    This sections puts together the flake.nix file from the Noweb-Ref blocks section. This tangles the flake.nix file; This block only needs to be touched when updating the general structure of the flake. For everything else, see the respective noweb-ref block. @@ -1014,6 +1017,8 @@ In outputs = inputs@ [...], the inputs@ makes it so th } ); + templates = import ./templates { inherit lib; }; + checks = lib.swarselsystems.forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; @@ -1064,59 +1069,8 @@ In outputs = inputs@ [...], the inputs@ makes it so th

    -
    -

    2.2. Pre-commit-hooks (Checks)

    -
    -

    -This file defines a number of checks that can either be run by calling nix flake check or while in a nix-shell or nix develop. This helps me make sure that my flake confirms to my self-imposed standards. The GitHub actions perform less checks than are being done here (they are only checking the formatting, as well as statix and deadnix) -

    - -
    -
    { self, inputs, pkgs, system, ... }:
    -{
    -  pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
    -    src = "${self}";
    -    hooks = {
    -      check-added-large-files.enable = true;
    -      check-case-conflicts.enable = true;
    -      check-executables-have-shebangs.enable = true;
    -      check-shebang-scripts-are-executable.enable = false;
    -      check-merge-conflicts.enable = true;
    -      deadnix.enable = true;
    -      detect-private-keys.enable = true;
    -      end-of-file-fixer.enable = true;
    -      fix-byte-order-marker.enable = true;
    -      flake-checker.enable = true;
    -      forbid-new-submodules.enable = true;
    -      mixed-line-endings.enable = true;
    -      nixpkgs-fmt.enable = true;
    -      statix.enable = true;
    -      trim-trailing-whitespace.enable = true;
    -
    -      destroyed-symlinks = {
    -        enable = true;
    -        entry = "${inputs.pre-commit-hooks.checks.${system}.pre-commit-hooks}/bin/destroyed-symlinks";
    -      };
    -
    -      shellcheck = {
    -        enable = true;
    -        entry = "${pkgs.shellcheck}/bin/shellcheck --shell=bash";
    -      };
    -
    -      shfmt = {
    -        enable = true;
    -        entry = "${pkgs.shfmt}/bin/shfmt -i 4 -sr -d -s -l";
    -      };
    -
    -    };
    -  };
    -}
    -
    -
    -
    -
    -

    2.3. Inputs

    +

    2.2. Inputs

    Here we define inputs and outputs of the flake. First, the following list is for the outputs of the flake. @@ -1257,7 +1211,7 @@ nix-topology.url = "github:oddlama/nix-topology";

    -

    2.4. let

    +

    2.3. let

    Here I define a few variables that I need for my system specifications. First and foremost, pkgs, which gets passed the emacs-overlay, nur, and nixgl modules to it. With this, I can grab all these packages by referencing pkgs.<name> instead of having to put e.g. nixgl.auto.nixGLDefault. @@ -1313,7 +1267,7 @@ mixedModules = [

    -

    2.5. General (outputs)

    +

    2.4. General (outputs)

    In this section I am creating some attributes that define general concepts of my configuration: @@ -1391,6 +1345,8 @@ devShells = lib.swarselsystems.forAllSystems (system: } ); +templates = import ./templates { inherit lib; }; + checks = lib.swarselsystems.forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; @@ -1398,12 +1354,89 @@ checks = lib.swarselsystems.forAllSystems (system: import ./checks { inherit self inputs system pkgs; } ); + +

    +
    + +
    +

    2.5. Pre-commit-hooks (Checks)

    +
    +

    +This file defines a number of checks that can either be run by calling nix flake check or while in a nix-shell or nix develop. This helps me make sure that my flake confirms to my self-imposed standards. The GitHub actions perform less checks than are being done here (they are only checking the formatting, as well as statix and deadnix) +

    + +
    +
    { self, inputs, pkgs, system, ... }:
    +{
    +  pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
    +    src = "${self}";
    +    hooks = {
    +      check-added-large-files.enable = true;
    +      check-case-conflicts.enable = true;
    +      check-executables-have-shebangs.enable = true;
    +      check-shebang-scripts-are-executable.enable = false;
    +      check-merge-conflicts.enable = true;
    +      deadnix.enable = true;
    +      detect-private-keys.enable = true;
    +      end-of-file-fixer.enable = true;
    +      fix-byte-order-marker.enable = true;
    +      flake-checker.enable = true;
    +      forbid-new-submodules.enable = true;
    +      mixed-line-endings.enable = true;
    +      nixpkgs-fmt.enable = true;
    +      statix.enable = true;
    +      trim-trailing-whitespace.enable = true;
    +
    +      destroyed-symlinks = {
    +        enable = true;
    +        entry = "${inputs.pre-commit-hooks.checks.${system}.pre-commit-hooks}/bin/destroyed-symlinks";
    +      };
    +
    +      shellcheck = {
    +        enable = true;
    +        entry = "${pkgs.shellcheck}/bin/shellcheck --shell=bash";
    +      };
    +
    +      shfmt = {
    +        enable = true;
    +        entry = "${pkgs.shfmt}/bin/shfmt -i 4 -sr -d -s -l";
    +      };
    +
    +    };
    +  };
    +}
    +
    +
    +
    +
    +
    +

    2.6. Templates

    +
    +

    +This file defines the templates that are being exposed by the flake. These can be used by running nix flake init -t github:Swarsel/.dotfiles#<TEMPLATE_NAME>. +

    + + +
    +
    { lib, ... }:
    +let
    +  templateNames = [
    +    "python"
    +    "rust"
    +    "go"
    +    "cpp"
    +    "latex"
    +    "default"
    +  ];
    +in
    +lib.swarselsystems.mkTemplates templateNames
    +
     
    -

    2.6. nixosConfigurations

    +

    2.7. nixosConfigurations

    This section used to be much longer, since I performed all of my imports right here in the past. Since then, I have however refactored and now my important hosts can be defined in little space. Once I have fully transitioned my server to NixOS too this section will become even smaller once more. @@ -1422,7 +1455,7 @@ Note: The preceding nixosConfigurations is found in -

    2.7. darwinConfigurations

    +

    2.8. darwinConfigurations

    -

    2.9. nixOnDroidConfigurations

    +

    2.10. nixOnDroidConfigurations

    Nix on Android also demands an own flake output, which is provided here. @@ -1484,7 +1517,7 @@ lib.swarselsystems.mkHalfHostConfigs (lib.swarselsystems.readHosts "android") "a

    -

    2.10. topologyConfigurations

    +

    2.11. topologyConfigurations

    @@ -1763,7 +1796,7 @@ My work machine. Built for more security, this is the gold standard of my config
     
    3.1.2.1.1. Main Configuration
    -
    { self, inputs, outputs, config, pkgs, lib, ... }:
    +
    { self, inputs, outputs, pkgs, lib, ... }:
     let
       profilesPath = "${self}/profiles";
       sharedOptions = {
    @@ -1796,12 +1829,6 @@ in
       ] ++ (builtins.attrValues outputs.nixosModules);
     
     
    -  nixpkgs = {
    -    overlays = [ outputs.overlays.default ];
    -    config = {
    -      allowUnfree = true;
    -    };
    -  };
     
       networking.networkmanager.wifi.scanRandMacAddress = false;
     
    @@ -1814,15 +1841,15 @@ in
         resumeDevice = "/dev/disk/by-label/nixos";
       };
     
    -  hardware = {
    -    amdgpu = {
    -      opencl.enable = true;
    -      amdvlk = {
    -        enable = true;
    -        support32Bit.enable = true;
    -      };
    -    };
    -  };
    +  # hardware = {
    +  #   amdgpu = {
    +  #     opencl.enable = true;
    +  #     amdvlk = {
    +  #       enable = true;
    +  #       support32Bit.enable = true;
    +  #     };
    +  #   };
    +  # };
     
       programs.fw-fanctrl.enable = true;
     
    @@ -1848,6 +1875,7 @@ in
           isImpermanence = false;
           isSecureBoot = true;
           isCrypted = true;
    +      isLinux = true;
         }
         sharedOptions;
     
    @@ -2134,7 +2162,7 @@ This is my main server that I run at home. It handles most tasks that require bi
     
    3.1.2.2.1. Main Configuration
    -
    { self, inputs, outputs, config, ... }:
    +
    { self, inputs, outputs, ... }:
     let
       profilesPath = "${self}/profiles";
     in
    @@ -2157,14 +2185,6 @@ in
     
       ] ++ (builtins.attrValues outputs.nixosModules);
     
    -
    -  nixpkgs = {
    -    overlays = [ outputs.overlays.default ];
    -    config = {
    -      allowUnfree = true;
    -    };
    -  };
    -
       boot = {
         loader.systemd-boot.enable = true;
         loader.efi.canTouchEfiVariables = true;
    @@ -2184,6 +2204,7 @@ in
         hasFingerprint = false;
         isImpermanence = false;
         isBtrfs = false;
    +    isLinux = true;
         flakePath = "/home/swarsel/.dotfiles";
         server = {
           enable = true;
    @@ -2476,6 +2497,7 @@ in
         hasBluetooth = false;
         hasFingerprint = false;
         isImpermanence = false;
    +    isLinux = true;
         isBtrfs = false;
         flakePath = "/root/.dotfiles";
         server = {
    @@ -2507,7 +2529,7 @@ This is a slim setup for developing base configuration. I do not track the hardw
     
    3.1.4.1.1. Main Configuration
    -
    { self, inputs, outputs, config, pkgs, lib, ... }:
    +
    { self, inputs, outputs, pkgs, lib, ... }:
     let
       profilesPath = "${self}/profiles";
       sharedOptions = {
    @@ -2548,13 +2570,6 @@ in
       ] ++ (builtins.attrValues outputs.nixosModules);
     
     
    -  nixpkgs = {
    -    overlays = [ outputs.overlays.default ];
    -    config = {
    -      allowUnfree = true;
    -    };
    -  };
    -
       environment.systemPackages = with pkgs; [
         curl
         git
    @@ -2587,6 +2602,7 @@ in
           isCrypted = true;
           isSecureBoot = false;
           isSwap = true;
    +      isLinux = true;
           swapSize = "8G";
           # rootDisk = "/dev/nvme0n1";
           rootDisk = "/dev/vda";
    @@ -2958,7 +2974,7 @@ I also set the WLR_RENDERER_ALLOW_SOFTWARE=1 to allow this configur
     
     
     
    -
    { self, inputs, outputs, config, pkgs, lib, ... }:
    +
    { self, inputs, outputs, pkgs, lib, ... }:
     let
       profilesPath = "${self}/profiles";
     in
    @@ -3006,6 +3022,7 @@ in
         wallpaper = self + /wallpaper/lenovowp.png;
         initialSetup = true;
         isPublic = true;
    +    isLinux = true;
       };
     
       home-manager.users.swarsel.swarselsystems = {
    @@ -3088,6 +3105,7 @@ let
         "ts2t"
         "vershell"
         "eontimer"
    +    "project"
       ];
     in
     lib.swarselsystems.mkPackages packageNames pkgs
    @@ -3497,10 +3515,10 @@ fi
     
    -
    { self, name, writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, jq }:
    +
    { self, name, writeShellApplication, kitty, element-desktop, vesktop, spotify-player, jq }:
     writeShellApplication {
       inherit name;
    -  runtimeInputs = [ kitty element-desktop-wayland vesktop spotify-player jq ];
    +  runtimeInputs = [ kitty element-desktop vesktop spotify-player jq ];
       text = builtins.readFile "${self}/scripts/${name}.sh";
     }
     
    @@ -4603,6 +4621,30 @@ python3Packages.buildPythonApplication rec {
     
     }
     
    +
    +
    +
    +
    +
    +
    3.2.1.25. project
    +
    +
    +
    set -euo pipefail
    +
    +if [ ! -d "$(pwd)/.git" ]; then
    +    git init
    +fi
    +nix flake init --template "$FLAKE"#"$1"
    +direnv allow
    +
    +
    + +
    +
    { self, name, writeShellApplication }:
    +writeShellApplication {
    +  inherit name;
    +  text = builtins.readFile "${self}/scripts/${name}.sh";
    +}
     
    @@ -4649,11 +4691,11 @@ let dolphin # gc/wii ]); - # #river = prev.river.overrideAttrs (oldAttrs: rec { + # luakit = prev.river.overrideAttrs (oldAttrs: rec { # pname = "river"; # version = "git"; # src = prev.fetchFromGitHub { - # owner = "riverwm"; + # owner = "luakit"; # repo = pname; # rev = "c16628c7f57c51d50f2d10a96c265fb0afaddb02"; # hash = "sha256-E3Xtv7JeCmafiNmpuS5VuLgh1TDAbibPtMo6A9Pz6EQ="; @@ -4808,6 +4850,7 @@ I usually use mutableUsers = false in my NixOS configuration. Howev options.swarselsystems.isCrypted = lib.mkEnableOption "uses full disk encryption"; options.swarselsystems.isPublic = lib.mkEnableOption "is a public machine (no secrets)"; options.swarselsystems.initialSetup = lib.mkEnableOption "initial setup (no sops keys available)"; + options.swarselsystems.isLinux = lib.mkEnableOption "whether this is a linux machine"; options.swarselsystems.isBtrfs = lib.mkEnableOption "use btrfs filesystem"; options.swarselsystems.isImpermanence = lib.mkEnableOption "use impermanence on this system"; @@ -5458,7 +5501,7 @@ A breakdown of each function: in systemFunc { inherit pkgs; - extraSpecialArgs = { inherit inputs outputs; }; + extraSpecialArgs = { inherit inputs outputs lib self; }; modules = [ "${self}/hosts/${type}/${host}" ]; }; }; @@ -5494,6 +5537,16 @@ A breakdown of each function: }) names); + mkTemplates = names: builtins.listToAttrs (map + (name: { + inherit name; + value = { + path = "${self}/templates/${name}"; + description = "${name} project "; + }; + }) + names); + eachMonitor = _: monitor: { inherit (monitor) name; value = builtins.removeAttrs monitor [ "workspace" "name" "output" ]; @@ -5591,16 +5644,54 @@ This section is for setting things that should be used on hosts that are using t
    3.3.1.2. General NixOS settings (stateVersion)

    -Also, we disable the warnings that trigger when rebuilding with a dirty flake. At this point, I am also disabling channels and pinning the flake registry - the latter lets me use the local version of nixpkgs for commands like nix shell (without it, we will always download the newest version of nixpkgs for these commands). +We disable the warnings that trigger when rebuilding with a dirty flake. At this point, I am also disabling channels and pinning the flake registry - the latter lets me use the local version of nixpkgs for commands like nix shell (without it, we will always download the newest version of nixpkgs for these commands).

    Also, the system state version is set here. No need to touch it.

    +

    +A breakdown of the flags being set: +

    +
      +
    • nixpgks.config.allowUnfree: allows packages with an unfree license to be built
    • +
    • nix.settings: +
        +
      • experimental-features: +
          +
        • nix-command: Enables the nix command from nix 2.4
        • +
        • flakes: Enables flakes to be used
        • +
        • ca-derivations: Enables content-addressed derivations, which stops unnecessary rebuiluds - to be used with my TODO private hydra and the binary cache cache.ngi0.nixos.org in flake.nix template
        • +
        • cgroups: allows the use of cgroups in builds
        • +
        • pipe-operators: Enables 'piping' instead of the classic currying syntax - fun arg can be expressed as arg |> fun. Associatively, it is weaker than functions: a |> b |> d c |> e = e ((d c) (b a))
        • +
      • +
      • trusted-users: these users have elevated privileges in nix (mostly used to acknowledge binary caches) - root is added per default here
      • +
      • connect-timeout: normally, nix tries to reach the cache for 300 seconds for each derivation per cache. This setting lets me change that
      • +
      • bash-prompt-prefix: adds a prefix to shells spawned by nix develop
      • +
      • [min,max]-free: amounts of space where intermittent GC will be run during builds
      • +
      • flake registry: URI of the global flake registry (I disable it)
      • +
      • auto-optimise-store: create hardlinks in the nix store to save space
      • +
      • warn-dirty: I do not need to see the warning when I have uncommited changes
      • +
      • max-jobs: How many build jobs should be run in parallel. auto sets this to the number of CPUs (which is all) - on systems with many cores this can lead to OOM situations. The default is now 1, but used to be auto, I set this manually just to be safe in the future.
      • +
      • use-cgroups: Actually run builds within cgroups
      • +
    • +
    • nix.channel.enable: whether to use channels
    • +
    • nix.registry: Sets the registry for this flake, which I set to its inputs. This allows me to use e.g. nixpkgs directly in nix repl
    • +
    • nix.nixPath: Basically the same as nix.registry, but for the legacy nix commands
    • +
    +
    -
    { lib, inputs, ... }:
    +
    { lib, config, outputs, inputs, ... }:
     {
    +
    +  nixpkgs = {
    +    overlays = [ outputs.overlays.default ];
    +    config = {
    +      allowUnfree = true;
    +    };
    +  };
    +
       nix =
         let
           flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
    @@ -5611,11 +5702,21 @@ Also, the system state version is set here. No need to touch it.
               "nix-command"
               "flakes"
               "ca-derivations"
    +          "cgroups"
               "pipe-operators"
             ];
    -        trusted-users = [ "swarsel" ];
    +        trusted-users = [ "@wheel" "swarsel" ];
    +        connect-timeout = 5;
    +        bash-prompt-prefix = "$SHLVL:\\w ";
    +        bash-prompt = "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)\[\e[1m\]λ\[\e[0m\] ";
    +        fallback = true;
    +        min-free = 128000000;
    +        max-free = 1000000000;
             flake-registry = "";
    +        auto-optimise-store = true;
             warn-dirty = false;
    +        max-jobs = 1;
    +        use-cgroups = lib.mkIf config.swarselsystems.isLinux true;
           };
           channel.enable = false;
           registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
    @@ -5699,57 +5800,57 @@ Mostly used to install some compilers and lsp's that I want to have available wh
         # lsp-related -------------------------------
         # nix
         # latex
    -    texlab
    +    # texlab
         ghostscript_headless
         # wireguard
         wireguard-tools
         # rust
    -    rust-analyzer
    -    clippy
    -    rustfmt
    +    # rust-analyzer
    +    # clippy
    +    # rustfmt
         # go
    -    go
    -    gopls
    +    # go
    +    # gopls
         # nix
         nixd
         # zig
         zig
         zls
         # cpp
    -    clang-tools
    +    # clang-tools
         # + cuda
    -    cudatoolkit
    +    # cudatoolkit
         # ansible
    -    ansible-lint
    -    ansible-language-server
    -    molecule
    +    # ansible-lint
    +    # ansible-language-server
    +    # molecule
         #lsp-bridge / python
    -    gcc
    -    gdb
    -    (python3.withPackages (ps: with ps; [ jupyter ipython pyqt5 epc orjson sexpdata six setuptools paramiko numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server ]))
    +    # gcc
    +    # gdb
    +    # (python3.withPackages (ps: with ps; [ jupyter ipython pyqt5 epc orjson sexpdata six setuptools paramiko numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server ]))
         # (python3.withPackages(ps: with ps; [ jupyter ipython pyqt5 numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server]))
         # --------------------------------------------
     
    -    (stdenv.mkDerivation {
    -      name = "oama";
    +    # (stdenv.mkDerivation {
    +    #   name = "oama";
     
    -      src = pkgs.fetchurl {
    -        name = "oama";
    -        url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz";
    -        sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc=";
    -      };
    +    #   src = pkgs.fetchurl {
    +    #     name = "oama";
    +    #     url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz";
    +    #     sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc=";
    +    #   };
     
    -      phases = [
    -        "unpackPhase"
    -      ];
    +    #   phases = [
    +    #     "unpackPhase"
    +    #   ];
     
    -      unpackPhase = ''
    -        mkdir -p $out/bin
    -        tar xvf $src -C $out/
    -        mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/
    -      '';
    +    #   unpackPhase = ''
    +    #     mkdir -p $out/bin
    +    #     tar xvf $src -C $out/
    +    #     mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/
    +    #   '';
     
    -    })
    +    # })
     
       ];
     }
    @@ -6409,8 +6510,7 @@ By default, stylix wants to style
     {
       stylix = {
         enable = true;
    -    base16Scheme = "${self}/wallpaper/swarsel.yaml";
    -    # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
    +    base16Scheme = "${self}/programs/stylix/swarsel.yaml";
         polarity = "dark";
         opacity.popups = 0.5;
         cursor = {
    @@ -6864,8 +6964,8 @@ When a program does not work, start with nix-ldd <program>. T
           gdk-pixbuf
           glew110
           glib
    -      gnome2.GConf
    -      gnome2.pango
    +      stable.gnome2.GConf
    +      pango
           gtk2
           gtk3
           icu
    @@ -7192,6 +7292,7 @@ I am using distrobox to quickly circumvent isses that I cannot immediately solve
     
       virtualisation.podman = {
         enable = true;
    +    package = pkgs.stable.podman;
       };
     
     }
    @@ -9152,6 +9253,7 @@ This opens a few gaming ports and installs the steam configuration suite for gam
     
           programs.steam = {
             enable = true;
    +        package = pkgs.stable.steam;
             extraCompatPackages = [
               pkgs.proton-ge-bin
             ];
    @@ -9556,19 +9658,36 @@ Again, we adapt nix to our needs, enable the home-manager command f
     

    -
    { lib, config, pkgs, ... }:
    +
    { lib, inputs, config, ... }:
     {
    -  nix = {
    -    package = lib.mkDefault pkgs.nix;
    -    settings = {
    -      experimental-features = [
    -        "nix-command"
    -        "flakes"
    -        "ca-derivations"
    -        "pipe-operators"
    -      ];
    +  nix =
    +    let
    +      flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
    +    in
    +    lib.mkIf (!config.swarselsystems.isNixos) {
    +      settings = {
    +        experimental-features = [
    +          "nix-command"
    +          "flakes"
    +          "ca-derivations"
    +          "cgroups"
    +          "pipe-operators"
    +        ];
    +        trusted-users = [ "@wheel" "swarsel" ];
    +        connect-timeout = 5;
    +        bash-prompt-prefix = "$SHLVL:\\w ";
    +        bash-prompt = "$(if [[ $? -gt 0 ]]; then printf \"\"; else printf \"\"; fi)\[\e[1m\]λ\[\e[0m\] ";
    +        fallback = true;
    +        min-free = 128000000;
    +        max-free = 1000000000;
    +        flake-registry = "";
    +        auto-optimise-store = true;
    +        warn-dirty = false;
    +        max-jobs = 1;
    +        use-cgroups = lib.mkIf config.swarselsystems.isLinux true;
    +      };
    +      registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
         };
    -  };
     
       programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
     
    @@ -9581,6 +9700,7 @@ Again, we adapt nix to our needs, enable the home-manager command f
           FLAKE = "${config.home.homeDirectory}/.dotfiles";
         };
       };
    +
     }
     
    @@ -9623,7 +9743,7 @@ This holds packages that I can use as provided, or with small modifications (as picard-tools audacity sox - feishin + stable.feishin # printing cups @@ -9632,6 +9752,9 @@ This holds packages that I can use as provided, or with small modifications (as # dict (aspellWithDicts (dicts: with dicts; [ de en en-computers en-science ])) + # browser + vieb + # utilities util-linux nmap @@ -9673,7 +9796,7 @@ This holds packages that I can use as provided, or with small modifications (as vesktop # discord client nextcloud-client spotify-player - element-desktop-wayland + element-desktop nicotine-plus stable.transmission mktorrent @@ -9808,42 +9931,9 @@ This is just a separate container for derivations defined in
    @@ -9966,8 +10056,7 @@ This section has been notably empty ever since switching to stylix. Only Emacs i { stylix = lib.mkIf (!config.swarselsystems.isNixos) { enable = true; - base16Scheme = "${self}/wallpaper/swarsel.yaml"; - # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml"; + base16Scheme = "${self}/programs/stylix/swarsel.yaml"; polarity = "dark"; opacity.popups = 0.5; cursor = { @@ -10294,6 +10383,7 @@ Enables direnv, which I use for nearly all of my nix dev flakes. { programs.direnv = { enable = true; + silent = true; nix-direnv.enable = true; }; } @@ -10417,7 +10507,7 @@ Starship makes my zsh look cooler! I have symbols for most programm enableZshIntegration = true; settings = { add_newline = false; - format = "$character"; + format = "$shlvl$character"; right_format = "$all"; command_timeout = 3000; @@ -10430,7 +10520,7 @@ Starship makes my zsh look cooler! I have symbols for most programm git_status = { style = "bg:#394260"; - format = "[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)"; + format = "[[($all_status$ahead_behind)](fg:#769ff0 bg:#394260)]($style) "; }; character = { @@ -10438,7 +10528,23 @@ Starship makes my zsh look cooler! I have symbols for most programm error_symbol = "[λ](bold red)"; }; - aws.symbol = " "; + shlvl = { + disabled = false; + symbol = "↳"; + format = "[$symbol]($style) "; + repeat = true; + repeat_offset = 1; + style = "blue"; + }; + + nix_shell = { + disabled = false; + heuristic = true; + format = "[$symbol$name]($style)"; + symbol = " "; + }; + + aws.symbol = " "; buf.symbol = " "; c.symbol = " "; conda.symbol = " "; @@ -10461,7 +10567,6 @@ Starship makes my zsh look cooler! I have symbols for most programm memory_usage.symbol = "󰍛 "; meson.symbol = "󰔷 "; nim.symbol = "󰆥 "; - nix_shell.symbol = " "; nodejs.symbol = " "; os.symbols = { @@ -12416,7 +12521,7 @@ The rest of the settings is at highlight-indent-guides package. This adds a nea (set-face-attribute 'highlight-indent-guides-stack-even-face nil :background "gray40") (set-face-attribute 'highlight-indent-guides-stack-odd-face nil :background "gray50")) -(use-package aggressive-indent) -(global-aggressive-indent-mode 1) +;; (use-package aggressive-indent) +;; (global-aggressive-indent-mode 1)
    @@ -13851,6 +13956,23 @@ This minor-mode adds functionality for doing better surround-commands; for examp (use-package evil-visual-mark-mode :config (evil-visual-mark-mode)) +
    +
    +
    +
    +
    +
    4.3.7.7. evil-textobj-tree-sitter
    +
    +
    +
    +(use-package evil-textobj-tree-sitter)
    +;; bind `function.outer`(entire function block) to `f` for use in things like `vaf`, `yaf`
    +(define-key evil-outer-text-objects-map "f" (evil-textobj-tree-sitter-get-textobj "function.outer"))
    +;; bind `function.inner`(function block without name and args) to `f` for use in things like `vif`, `yif`
    +(define-key evil-inner-text-objects-map "f" (evil-textobj-tree-sitter-get-textobj "function.inner"))
    +
    +;; You can also bind multiple items and we will match the first one we can find
    +(define-key evil-outer-text-objects-map "a" (evil-textobj-tree-sitter-get-textobj ("conditional.outer" "loop.outer")))
     
    @@ -14608,6 +14730,7 @@ This provides several utilities for LaTeX in Emacs, including many completions a (setq TeX-auto-save t) (setq TeX-save-query nil) (setq TeX-parse-self t) +(setq-default TeX-engine 'luatex) (setq-default TeX-master nil) (add-hook 'LaTeX-mode-hook 'visual-line-mode) @@ -15022,39 +15145,41 @@ In order to update the language grammars, run the next command below.
    -(use-package emacs
    -  :ensure nil
    -  :init
    -  (setq treesit-language-source-alist
    -        '((bash . ("https://github.com/tree-sitter/tree-sitter-bash"))
    -          (c . ("https://github.com/tree-sitter/tree-sitter-c"))
    -          (cmake . ("https://github.com/uyha/tree-sitter-cmake"))
    -          (cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
    -          (css . ("https://github.com/tree-sitter/tree-sitter-css"))
    -          (elisp . ("https://github.com/Wilfred/tree-sitter-elisp"))
    -          (go . ("https://github.com/tree-sitter/tree-sitter-go"))
    -          (html . ("https://github.com/tree-sitter/tree-sitter-html"))
    -          (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript"))
    -          (json . ("https://github.com/tree-sitter/tree-sitter-json"))
    -          (julia . ("https://github.com/tree-sitter/tree-sitter-julia"))
    -          (latex . ("https://github.com/latex-lsp/tree-sitter-latex"))
    -          (make . ("https://github.com/alemuller/tree-sitter-make"))
    -          (markdown . ("https://github.com/ikatyang/tree-sitter-markdown"))
    -          (nix . ("https://github.com/nix-community/tree-sitter-nix"))
    -          (R . ("https://github.com/r-lib/tree-sitter-r"))
    -          (python . ("https://github.com/tree-sitter/tree-sitter-python"))
    -          (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "typescript/src" "typescript"))
    -          (rust . ("https://github.com/tree-sitter/tree-sitter-rust"))
    -          (sql . ("https://github.com/m-novikov/tree-sitter-sql"))
    -          (toml . ("https://github.com/tree-sitter/tree-sitter-toml"))
    -          (tsx  . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))
    -          (yaml . ("https://github.com/ikatyang/tree-sitter-yaml"))))
    -  )
    +;; (use-package emacs
    +;;   :ensure nil
    +;;   :init
    +;;   (setq treesit-language-source-alist
    +;;         '((bash . ("https://github.com/tree-sitter/tree-sitter-bash"))
    +;;           (c . ("https://github.com/tree-sitter/tree-sitter-c"))
    +;;           (cmake . ("https://github.com/uyha/tree-sitter-cmake"))
    +;;           (cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
    +;;           (css . ("https://github.com/tree-sitter/tree-sitter-css"))
    +;;           (elisp . ("https://github.com/Wilfred/tree-sitter-elisp"))
    +;;           (go . ("https://github.com/tree-sitter/tree-sitter-go"))
    +;;           (html . ("https://github.com/tree-sitter/tree-sitter-html"))
    +;;           (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript"))
    +;;           (json . ("https://github.com/tree-sitter/tree-sitter-json"))
    +;;           (julia . ("https://github.com/tree-sitter/tree-sitter-julia"))
    +;;           (latex . ("https://github.com/latex-lsp/tree-sitter-latex"))
    +;;           (make . ("https://github.com/alemuller/tree-sitter-make"))
    +;;           (markdown . ("https://github.com/ikatyang/tree-sitter-markdown"))
    +;;           (nix . ("https://github.com/nix-community/tree-sitter-nix"))
    +;;           (R . ("https://github.com/r-lib/tree-sitter-r"))
    +;;           (python . ("https://github.com/tree-sitter/tree-sitter-python"))
    +;;           (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "typescript/src" "typescript"))
    +;;           (rust . ("https://github.com/tree-sitter/tree-sitter-rust"))
    +;;           (sql . ("https://github.com/m-novikov/tree-sitter-sql"))
    +;;           (toml . ("https://github.com/tree-sitter/tree-sitter-toml"))
    +;;           (tsx  . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))
    +;;           (yaml . ("https://github.com/ikatyang/tree-sitter-yaml"))))
    +;;   )
     
     (use-package treesit-auto
    +  :custom
    +  (setq treesit-auto-install t)
       :config
    -  (global-treesit-auto-mode)
    -  (setq treesit-auto-install 'prompt))
    +  (treesit-auto-add-to-auto-mode-alist 'all)
    +  (global-treesit-auto-mode))
     
     
     
    @@ -15064,11 +15189,18 @@ In order to update the language grammars, run the next command below.

    4.4.13. direnv (envrc)

    +

    +In emacs, there are two packages for managing dev environments - emacs-direnv (direnv) and envrc. Direnv uses the global Emacs environment whereas envrc is buffer-local. I do not really care about this difference. What is more important to me is that emacs should not block upon handling a bigger flake.nix while setting up the dev environment. This seems to be better handled by envrc. +

    +
    -(use-package direnv
    -  :custom (direnv-always-show-summary nil)
    -  :config (direnv-mode))
    +;; (use-package direnv
    +;;   :custom (direnv-always-show-summary nil)
    +;;   :config (direnv-mode))
    +
    +(use-package envrc
    +  :hook (after-init . envrc-global-mode))
     
     
    @@ -15146,8 +15278,9 @@ projectile is useful for keeping track of your git projects within Emacs. I most ("C-c p" . projectile-command-map) ; all projectile commands under this :init ;; NOTE: Set this to the folder where you keep your Git repos! - (when (file-directory-p swarsel-projects-directory) - (setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory))) + (when (file-directory-p swarsel-work-projects-directory) + (when (file-directory-p swarsel-private-projects-directory) + (setq projectile-project-search-path (list swarsel-work-projects-directory swarsel-private-projects-directory)))) (setq projectile-switch-project-action #'magit-status))
    @@ -15224,9 +15357,6 @@ create classic token with repo; user; read:org permissions (use-package forge :after magit) -(with-eval-after-load 'forge - (add-to-list 'forge-alist - ))
    @@ -15538,6 +15668,8 @@ After having tried out lsp-mode and lsp-bridge for a w c-ts-mode c++-mode c++-ts-mode + go-mode + go-ts-mode rust-ts-mode rustic-mode tex-mode @@ -16042,8 +16174,7 @@ This is where the theme for the whole OS is defined. Originally, this noweb-ref
    enable = true;
    -base16Scheme = "${self}/wallpaper/swarsel.yaml";
    -# base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
    +base16Scheme = "${self}/programs/stylix/swarsel.yaml";
     polarity = "dark";
     opacity.popups = 0.5;
     cursor = {
    @@ -16648,7 +16779,7 @@ ignore = ['.direnv']
     
    diff --git a/profiles/common/nixos/packages.nix b/profiles/common/nixos/packages.nix index 5cde14a..6c7f4a8 100644 --- a/profiles/common/nixos/packages.nix +++ b/profiles/common/nixos/packages.nix @@ -59,57 +59,57 @@ # lsp-related ------------------------------- # nix # latex - texlab + # texlab ghostscript_headless # wireguard wireguard-tools # rust - rust-analyzer - clippy - rustfmt + # rust-analyzer + # clippy + # rustfmt # go - go - gopls + # go + # gopls # nix nixd # zig zig zls # cpp - clang-tools + # clang-tools # + cuda - cudatoolkit + # cudatoolkit # ansible # ansible-lint # ansible-language-server # molecule #lsp-bridge / python - gcc - gdb + # gcc + # gdb # (python3.withPackages (ps: with ps; [ jupyter ipython pyqt5 epc orjson sexpdata six setuptools paramiko numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server ])) # (python3.withPackages(ps: with ps; [ jupyter ipython pyqt5 numpy pandas scipy matplotlib requests debugpy flake8 gnureadline python-lsp-server])) # -------------------------------------------- - (stdenv.mkDerivation { - name = "oama"; + # (stdenv.mkDerivation { + # name = "oama"; - src = pkgs.fetchurl { - name = "oama"; - url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz"; - sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc="; - }; + # src = pkgs.fetchurl { + # name = "oama"; + # url = "https://github.com/pdobsan/oama/releases/download/0.13.1/oama-0.13.1-Linux-x86_64-static.tgz"; + # sha256 = "sha256-OTdCObVfnMPhgZxVtZqehgUXtKT1iyqozdkPIV+i3Gc="; + # }; - phases = [ - "unpackPhase" - ]; + # phases = [ + # "unpackPhase" + # ]; - unpackPhase = '' - mkdir -p $out/bin - tar xvf $src -C $out/ - mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/ - ''; + # unpackPhase = '' + # mkdir -p $out/bin + # tar xvf $src -C $out/ + # mv $out/oama-0.13.1-Linux-x86_64-static/oama $out/bin/ + # ''; - }) + # }) ]; } diff --git a/programs/emacs/init.el b/programs/emacs/init.el index d5cc11c..f8b1b27 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -503,8 +503,8 @@ create a new one." (set-face-attribute 'highlight-indent-guides-stack-even-face nil :background "gray40") (set-face-attribute 'highlight-indent-guides-stack-odd-face nil :background "gray50")) -(use-package aggressive-indent) -(global-aggressive-indent-mode 1) +;; (use-package aggressive-indent) +;; (global-aggressive-indent-mode 1) (setq mouse-wheel-scroll-amount '(1