diff --git a/SwarselSystems.org b/SwarselSystems.org index c7100d9..54f46d5 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -507,9 +507,23 @@ Lastly I define some common module lists that I can simply load depending on the "x86_64-darwin" ]; + # pkgs for home-manager builds + homepkgs = import nixpkgs { system = "x86_64-linux"; + overlays = [ emacs-overlay.overlay + nur.overlay + nixgl.overlay + (final: _prev: { + stable = import nixpkgs-stable { + inherit (final) system config; + }; + }) + ]; + config.allowUnfree = true; + }; + # NixOS modules that can only be used on NixOS systems nixModules = [ - ({ ... }: { nix.extraOptions = "experimental-features = nix-command flakes"; }) + (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) ({ inputs, config, ... }: { nixpkgs = { overlays = [ @@ -717,9 +731,10 @@ In contrast, this defines home-manager systems, which I only have one of. #+begin_src nix :tangle no :noweb-ref flakehomeconf - "leons@PCisLee" = inputs.home-manager.lib.homeManagerConfiguration { + "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = homepkgs; modules = homeModules ++ mixedModules ++ [ - ./profiles/surface/home.nix + ./profiles/home-manager/home.nix ]; }; @@ -1789,6 +1804,126 @@ in } #+end_src + +**** Home-manager only +***** Home manager +:PROPERTIES: +:CUSTOM_ID: h:483a26b5-5a40-4417-9ffb-67cc2cf07161 +:END: + +Special things to note here: We are running xcape to allow =CAPS= to act as =CTRL= and =ESC=. Also we are using =nixGL= in most places. + +#+begin_src nix :noweb yes :tangle profiles/home-manager/home.nix + + { config, pkgs, lib, fetchFromGitHub, ... }: + + { + programs.home-manager.enable = true; + home.username = "swarsel"; + home.homeDirectory = "/home/swarsel"; + + home.stateVersion = "23.05"; # Please read the comment before changing. + + stylix.image = ../../wallpaper/surfacewp.png; + <> + + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + }; + services.xcape = { + enable = true; + mapExpression = { + Control_L = "Escape"; + }; + }; + #keyboard config + home.keyboard.layout = "us"; + + sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; + + # waybar config + programs.waybar.settings.mainBar.cpu.format = "{icon0} {icon1} {icon2} {icon3}"; + + programs.waybar.settings.mainBar.temperature.hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input"; + programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" "mpris" "custom/left-arrow-light" + "network" + "custom/left-arrow-dark" + "pulseaudio" + "custom/left-arrow-light" + "battery" + "custom/left-arrow-dark" + "temperature" + "custom/left-arrow-light" + "disk" + "custom/left-arrow-dark" + "memory" + "custom/left-arrow-light" + "cpu" + "custom/left-arrow-dark" + "tray" + "custom/left-arrow-light" + "clock#2" + "custom/left-arrow-dark" + "clock#1" ]; + services.blueman-applet.enable = true; + home.packages = with pkgs; [ + # nixgl.auto.nixGLDefault + evince + # nodejs_20 + + # messaging + # we use gomuks for RAM preservation, but keep schildi around for files and images + ]; + + programs.zsh.initExtra = " + export GPG_TTY=\"$(tty)\" + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + gpgconf --launch gpg-agent + "; + + # sway config + wayland.windowManager.sway= { + config = rec { + input = { + "*" = { + xkb_layout = "us"; + xkb_options = "ctrl:nocaps,grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + + output = { + eDP-1 = { + mode = "2160x1440@59.955Hz"; + scale = "1"; + bg = "~/.dotfiles/wallpaper/surfacewp.png fill"; + }; + }; + + keybindings = let + inherit (config.wayland.windowManager.sway.config) modifier; + in { + }; + + startup = [ + ]; + + }; + + }; + } + +#+end_src + **** Threed (Surface Pro 3) :PROPERTIES: :CUSTOM_ID: h:7b1a8f91-ef43-433c-ba4c-c5baf50e1de4 @@ -4269,7 +4404,7 @@ As such, I also define three additional overlays: #+begin_src nix :tangle pkgs/default.nix -{ ... }: { } + _ : { } #+end_src diff --git a/flake.nix b/flake.nix index 8669bb9..365257f 100644 --- a/flake.nix +++ b/flake.nix @@ -86,9 +86,25 @@ "x86_64-darwin" ]; + # pkgs for home-manager builds + homepkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ + emacs-overlay.overlay + nur.overlay + nixgl.overlay + (final: _prev: { + stable = import nixpkgs-stable { + inherit (final) system config; + }; + }) + ]; + config.allowUnfree = true; + }; + # NixOS modules that can only be used on NixOS systems nixModules = [ - ({ ... }: { nix.extraOptions = "experimental-features = nix-command flakes"; }) + (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) ({ inputs, config, ... }: { nixpkgs = { overlays = [ @@ -289,9 +305,10 @@ homeConfigurations = { - "leons@PCisLee" = inputs.home-manager.lib.homeManagerConfiguration { + "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = homepkgs; modules = homeModules ++ mixedModules ++ [ - ./profiles/surface/home.nix + ./profiles/home-manager/home.nix ]; }; diff --git a/index.html b/index.html index 4e9d59d..30a4ec0 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 @@

Table of Contents

-
  • 3.2. Manual Overlays and packages +
  • 3.2. Manual Overlays and packages
  • 3.3. Common NixOS @@ -268,7 +268,7 @@

    Table of Contents

  • 3.4.6. Linking dotfiles
  • 3.4.7. Sourcing environment variables
  • 3.4.8. Programs
  • -
  • 3.4.9. nix-index
  • +
  • 3.4.9. nix-index
  • 3.4.10. password-store
  • 3.4.11. direnv
  • 3.4.12. eza
  • @@ -336,7 +336,7 @@

    Table of Contents

    @@ -1021,9 +1021,23 @@

    2 "x86_64-darwin" ]; +# pkgs for home-manager builds +homepkgs = import nixpkgs { system = "x86_64-linux"; + overlays = [ emacs-overlay.overlay + nur.overlay + nixgl.overlay + (final: _prev: { + stable = import nixpkgs-stable { + inherit (final) system config; + }; + }) + ]; + config.allowUnfree = true; + }; + # NixOS modules that can only be used on NixOS systems nixModules = [ - ({ ... }: { nix.extraOptions = "experimental-features = nix-command flakes"; }) + (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) ({ inputs, config, ... }: { nixpkgs = { overlays = [ @@ -1059,8 +1073,8 @@

    2 -
    -

    2.3.3. General (outputs)

    +
    +

    2.3.3. General (outputs)

    @@ -1240,9 +1254,10 @@ 

    2
    -"leons@PCisLee" = inputs.home-manager.lib.homeManagerConfiguration {
    +"swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
    + pkgs = homepkgs;
       modules = homeModules ++ mixedModules ++ [
    -    ./profiles/surface/home.nix
    +    ./profiles/home-manager/home.nix
       ];
     };
     
    @@ -2440,6 +2455,175 @@ 

    3 }; } +

    +
    +

    + + + +
  • Home-manager only
    +
      +
    1. Home manager
      +
      +

      +Special things to note here: We are running xcape to allow CAPS to act as CTRL and ESC. Also we are using nixGL in most places. +

      + +
      +
      +{ config, pkgs, lib, fetchFromGitHub, ... }:
      +
      +{
      +  programs.home-manager.enable = true;
      +  home.username = "swarsel";
      +  home.homeDirectory = "/home/swarsel";
      +
      +  home.stateVersion = "23.05"; # Please read the comment before changing.
      +
      +  stylix.image = ../../wallpaper/surfacewp.png;
      +
      +  stylix = {
      +    enable = true;
      +    base16Scheme = ../../wallpaper/swarsel.yaml;
      +    # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml";
      +    polarity = "dark";
      +    opacity.popups = 0.5;
      +    cursor = {
      +      package = pkgs.capitaine-cursors;
      +      name = "capitaine-cursors";
      +      size = 16;
      +    };
      +    fonts = {
      +      sizes = {
      +        terminal = 10;
      +        applications = 11;
      +      };
      +      serif = {
      +        # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
      +        package = pkgs.cantarell-fonts;
      +        # package = pkgs.montserrat;
      +        name = "Cantarell";
      +        # name = "FiraCode Nerd Font Propo";
      +        # name = "Montserrat";
      +      };
      +
      +      sansSerif = {
      +        # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; });
      +        package = pkgs.cantarell-fonts;
      +        # package = pkgs.montserrat;
      +        name = "Cantarell";
      +        # name = "FiraCode Nerd Font Propo";
      +        # name = "Montserrat";
      +      };
      +
      +      monospace = {
      +        package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; };
      +        name = "FiraCode Nerd Font Mono";
      +      };
      +
      +      emoji = {
      +        package = pkgs.noto-fonts-emoji;
      +        name = "Noto Color Emoji";
      +      };
      +    };
      +  };
      +
      +
      +  nixpkgs = {
      +    config = {
      +      allowUnfree = true;
      +      allowUnfreePredicate = _: true;
      +    };
      +  };
      +  services.xcape = {
      +    enable = true;
      +    mapExpression = {
      +      Control_L = "Escape";
      +    };
      +  };
      +  #keyboard config
      +  home.keyboard.layout = "us";
      +
      +  sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ];
      +
      +  # waybar config
      +  programs.waybar.settings.mainBar.cpu.format = "{icon0} {icon1} {icon2} {icon3}";
      +
      +  programs.waybar.settings.mainBar.temperature.hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input";
      +  programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" "mpris" "custom/left-arrow-light"
      +                                                    "network"
      +                                                    "custom/left-arrow-dark"
      +                                                    "pulseaudio"
      +                                                    "custom/left-arrow-light"
      +                                                    "battery"
      +                                                    "custom/left-arrow-dark"
      +                                                    "temperature"
      +                                                    "custom/left-arrow-light"
      +                                                    "disk"
      +                                                    "custom/left-arrow-dark"
      +                                                    "memory"
      +                                                    "custom/left-arrow-light"
      +                                                    "cpu"
      +                                                    "custom/left-arrow-dark"
      +                                                    "tray"
      +                                                    "custom/left-arrow-light"
      +                                                    "clock#2"
      +                                                    "custom/left-arrow-dark"
      +                                                    "clock#1" ];
      +  services.blueman-applet.enable = true;
      +  home.packages = with pkgs; [
      +    # nixgl.auto.nixGLDefault
      +    evince
      +    # nodejs_20
      +
      +    # messaging
      +    # we use gomuks for RAM preservation, but keep schildi around for files and images
      +  ];
      +
      +  programs.zsh.initExtra = "
      +export GPG_TTY=\"$(tty)\"
      +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
      +gpgconf --launch gpg-agent
      +      ";
      +
      +  # sway config
      +  wayland.windowManager.sway= {
      +    config = rec {
      +      input = {
      +        "*" = {
      +          xkb_layout = "us";
      +          xkb_options = "ctrl:nocaps,grp:win_space_toggle";
      +          xkb_variant = "altgr-intl";
      +        };
      +        "type:touchpad" = {
      +          dwt = "enabled";
      +          tap = "enabled";
      +          natural_scroll = "enabled";
      +          middle_emulation = "enabled";
      +        };
      +      };
      +
      +      output = {
      +        eDP-1 = {
      +          mode = "2160x1440@59.955Hz";
      +          scale = "1";
      +          bg = "~/.dotfiles/wallpaper/surfacewp.png fill";
      +        };
      +      };
      +
      +      keybindings = let
      +        inherit (config.wayland.windowManager.sway.config) modifier;
      +      in {
      +      };
      +
      +      startup = [
      +      ];
      +
      +    };
      +
      +  };
      +}
      +
       
      @@ -5411,8 +5595,8 @@

      3

  • -
    -

    3.2. Manual Overlays and packages

    +
    +

    3.2. Manual Overlays and packages

    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. @@ -5431,19 +5615,19 @@

    3.2. Manual Overlays a 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. pkgs

    +
    +

    3.2.1. pkgs

    -{ ... }: { }
    +_ : { }
     
     
    -
    -

    3.2.2. Overlays

    +
    +

    3.2.2. Overlays

    @@ -6123,7 +6307,7 @@ 

    3

      -
    1. zsh
      +
    2. zsh

      Do not touch this. @@ -6140,7 +6324,7 @@

      3

    -
  • syncthing
    +
  • syncthing
    @@ -7087,8 +7271,8 @@ 

    3

  • -
    -

    3.4.9. nix-index

    +
    +

    3.4.9. 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. @@ -8548,9 +8732,23 @@

    3 "x86_64-darwin" ]; + # pkgs for home-manager builds + homepkgs = import nixpkgs { system = "x86_64-linux"; + overlays = [ emacs-overlay.overlay + nur.overlay + nixgl.overlay + (final: _prev: { + stable = import nixpkgs-stable { + inherit (final) system config; + }; + }) + ]; + config.allowUnfree = true; + }; + # NixOS modules that can only be used on NixOS systems nixModules = [ - ({ ... }: { nix.extraOptions = "experimental-features = nix-command flakes"; }) + (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) ({ inputs, config, ... }: { nixpkgs = { overlays = [ @@ -8751,9 +8949,10 @@

    3 homeConfigurations = { - "leons@PCisLee" = inputs.home-manager.lib.homeManagerConfiguration { + "swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = homepkgs; modules = homeModules ++ mixedModules ++ [ - ./profiles/surface/home.nix + ./profiles/home-manager/home.nix ]; }; @@ -9441,7 +9640,7 @@

    4

    -
  • Nix common prefix bracketer
    +
  • Nix common prefix bracketer

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

    4

  • -
  • Nix formatters
    +
  • Nix formatters

    This formats the org code block at point in accordance to the nixpkgs-fmt formatter @@ -11047,8 +11246,8 @@

    4

  • -
    -

    4.4.3. nixpkgs-fmt

    +
    +

    4.4.3. nixpkgs-fmt

    Adds functions for formatting nix code. @@ -13063,7 +13262,7 @@

    5

    Author: Leon Schwarzäugl

    -

    Created: 2024-07-21 So 15:56

    +

    Created: 2024-07-21 So 17:55

    Validate

    diff --git a/pkgs/default.nix b/pkgs/default.nix index c915eb0..958608a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1 +1 @@ -{ ... }: { } +_: { } diff --git a/profile/home-manager/home.nix b/profile/home-manager/home.nix new file mode 100644 index 0000000..ed88849 --- /dev/null +++ b/profile/home-manager/home.nix @@ -0,0 +1,111 @@ +{ config, pkgs, lib, fetchFromGitHub, ... }: + +{ + programs.home-manager.enable = true; + home.username = "swarsel"; + home.homeDirectory = "/home/swarsel"; + + home.stateVersion = "23.05"; # Please read the comment before changing. + + stylix.image = ../../wallpaper/surfacewp.png; + << theme>> + + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + }; + }; + services.xcape = { + enable = true; + mapExpression = { + Control_L = "Escape"; + }; + }; + #keyboard config + home.keyboard.layout = "us"; + + sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; + + # waybar config + programs.waybar.settings.mainBar.cpu.format = "{icon0} {icon1} {icon2} {icon3}"; + + programs.waybar.settings.mainBar.temperature.hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input"; + programs.waybar.settings.mainBar.modules-right = [ + "custom/outer-left-arrow-dark" + "mpris" + "custom/left-arrow-light" + "network" + "custom/left-arrow-dark" + "pulseaudio" + "custom/left-arrow-light" + "battery" + "custom/left-arrow-dark" + "temperature" + "custom/left-arrow-light" + "disk" + "custom/left-arrow-dark" + "memory" + "custom/left-arrow-light" + "cpu" + "custom/left-arrow-dark" + "tray" + "custom/left-arrow-light" + "clock#2" + "custom/left-arrow-dark" + "clock#1" + ]; + services.blueman-applet.enable = true; + home.packages = with pkgs; [ + # nixgl.auto.nixGLDefault + evince + # nodejs_20 + + # messaging + # we use gomuks for RAM preservation, but keep schildi around for files and images + ]; + + programs.zsh.initExtra = " +export GPG_TTY=\"$(tty)\" +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +gpgconf --launch gpg-agent + "; + + # sway config + wayland.windowManager.sway = { + config = rec { + input = { + "*" = { + xkb_layout = "us"; + xkb_options = "ctrl:nocaps,grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + + output = { + eDP-1 = { + mode = "2160x1440@59.955Hz"; + scale = "1"; + bg = "~/.dotfiles/wallpaper/surfacewp.png fill"; + }; + }; + + keybindings = + let + inherit (config.wayland.windowManager.sway.config) modifier; + in + { }; + + startup = [ + ]; + + }; + + }; +} diff --git a/profiles/home-manager/home.nix b/profiles/home-manager/home.nix new file mode 100644 index 0000000..d44d4e3 --- /dev/null +++ b/profiles/home-manager/home.nix @@ -0,0 +1,157 @@ +{ config, pkgs, lib, fetchFromGitHub, ... }: + +{ + programs.home-manager.enable = true; + home.username = "swarsel"; + home.homeDirectory = "/home/swarsel"; + + home.stateVersion = "23.05"; # Please read the comment before changing. + + stylix.image = ../../wallpaper/surfacewp.png; + + stylix = { + enable = true; + base16Scheme = ../../wallpaper/swarsel.yaml; + # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml"; + polarity = "dark"; + opacity.popups = 0.5; + cursor = { + package = pkgs.capitaine-cursors; + name = "capitaine-cursors"; + size = 16; + }; + fonts = { + sizes = { + terminal = 10; + applications = 11; + }; + serif = { + # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); + package = pkgs.cantarell-fonts; + # package = pkgs.montserrat; + name = "Cantarell"; + # name = "FiraCode Nerd Font Propo"; + # name = "Montserrat"; + }; + + sansSerif = { + # package = (pkgs.nerdfonts.override { fonts = [ "FiraMono" "FiraCode"]; }); + package = pkgs.cantarell-fonts; + # package = pkgs.montserrat; + name = "Cantarell"; + # name = "FiraCode Nerd Font Propo"; + # name = "Montserrat"; + }; + + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + }; + + + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + }; + services.xcape = { + enable = true; + mapExpression = { + Control_L = "Escape"; + }; + }; + #keyboard config + home.keyboard.layout = "us"; + + sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; + + # waybar config + programs.waybar.settings.mainBar.cpu.format = "{icon0} {icon1} {icon2} {icon3}"; + + programs.waybar.settings.mainBar.temperature.hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input"; + programs.waybar.settings.mainBar.modules-right = [ + "custom/outer-left-arrow-dark" + "mpris" + "custom/left-arrow-light" + "network" + "custom/left-arrow-dark" + "pulseaudio" + "custom/left-arrow-light" + "battery" + "custom/left-arrow-dark" + "temperature" + "custom/left-arrow-light" + "disk" + "custom/left-arrow-dark" + "memory" + "custom/left-arrow-light" + "cpu" + "custom/left-arrow-dark" + "tray" + "custom/left-arrow-light" + "clock#2" + "custom/left-arrow-dark" + "clock#1" + ]; + services.blueman-applet.enable = true; + home.packages = with pkgs; [ + # nixgl.auto.nixGLDefault + evince + # nodejs_20 + + # messaging + # we use gomuks for RAM preservation, but keep schildi around for files and images + ]; + + programs.zsh.initExtra = " +export GPG_TTY=\"$(tty)\" +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +gpgconf --launch gpg-agent + "; + + # sway config + wayland.windowManager.sway = { + config = rec { + input = { + "*" = { + xkb_layout = "us"; + xkb_options = "ctrl:nocaps,grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + + output = { + eDP-1 = { + mode = "2160x1440@59.955Hz"; + scale = "1"; + bg = "~/.dotfiles/wallpaper/surfacewp.png fill"; + }; + }; + + keybindings = + let + inherit (config.wayland.windowManager.sway.config) modifier; + in + { }; + + startup = [ + ]; + + }; + + }; +}