diff --git a/SwarselSystems.org b/SwarselSystems.org index 684ed8d..8531b46 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -116,9 +116,8 @@ For styling, I am using the [[https://github.com/danth/stylix][stylix]] NixOS mo #+begin_src nix :tangle no :noweb-ref theme - stylix = { enable = true; - base16Scheme = ../../wallpaper/swarsel.yaml; + base16Scheme = ../../../wallpaper/swarsel.yaml; # base16Scheme = "${pkgs.base16-schemes}/share/themes/shapeshifter.yaml"; polarity = "dark"; opacity.popups = 0.5; @@ -160,7 +159,6 @@ For styling, I am using the [[https://github.com/danth/stylix][stylix]] NixOS mo name = "Noto Color Emoji"; }; }; - }; #+end_src *** Waybar items - LAPTOPS @@ -534,7 +532,6 @@ 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 = [ - (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) inputs.stylix.nixosModules.stylix inputs.sops-nix.nixosModules.sops inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm @@ -560,6 +557,9 @@ Lastly I define some common module lists that I can simply load depending on the inherit lib; inherit mixedModules; + nixosModules = import ./modules/nixos; + homeManagerModules = import ./modules/home; + packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); devShells = forEachSystem (pkgs: @@ -2092,9 +2092,10 @@ My new main machine. { home-manager.users.swarsel.imports = outputs.mixedModules ++ [ ./home.nix - ]; + ] ++ (builtins.attrValues outputs.homeManagerModules); } - ]; + ]++ (builtins.attrValues outputs.nixosModules); + nixpkgs = { overlays = outputs.overlays; @@ -2103,6 +2104,39 @@ My new main machine. }; }; + # ------ ----- + # | DP-4 | |eDP-1| + # ------ ----- + home-manager.users.swarsel.swarselsystems = { + isLaptop = true; + isNixos = true; + monitors = { + main = { + name = "California Institute of Technology 0x1407 Unknown"; + mode = "1920x1080"; # TEMPLATE + scale = "1"; + position = "2560,0"; + workspace = "2:二"; + output = "eDP-1"; + }; + homedesktop = { + name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + mode = "2560x1440"; + scale = "1"; + position = "0,0"; + workspace = "1:一"; + output = "DP-4"; + }; + }; + inputs = { + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "us"; + xkb_options = "grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + }; + }; + } @@ -2165,7 +2199,6 @@ Mostly just sets some opened ports for several games, enables virtualbox (which }; stylix.image = ../../wallpaper/lenovowp.png; - <> hardware = { graphics = { @@ -2234,101 +2267,58 @@ Mostly just sets some opened ports for several games, enables virtualbox (which This is basically just adjusted to the core count, path to the =hwmon= (this was very bothersome on this machine due to changing address), as well as making use of the top-row function keys. #+begin_src nix :noweb yes :tangle profiles/fourside/home.nix - { config, pkgs, ... }: + { config, pkgs, lib, ... }: with lib; + { - { - - <> - home = { - username = "swarsel"; - homeDirectory = "/home/swarsel"; - stateVersion = "23.05"; # TEMPLATE -- Please read the comment before changing. - keyboard.layout = "us"; # TEMPLATE - packages = with pkgs; [ - ]; - }; - sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; - - # waybar config - TEMPLATE - update for cores and temp - programs.waybar.settings.mainBar = { - cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}"; - # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; - temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; - temperature.input-filename = "temp1_input"; - }; - - <> - - wayland.windowManager.sway = { - config = rec { - # update for actual inputs here, - input = { - "36125:53060:splitkb.com_Kyria_rev3" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - "1:1:AT_Translated_Set_2_keyboard" = { - # TEMPLATE - xkb_layout = "us"; - xkb_options = "grp:win_space_toggle"; - xkb_variant = "altgr-intl"; - }; - "type:touchpad" = { - dwt = "enabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - }; + <> + sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; + # waybar config - TEMPLATE - update for cores and temp + programs.waybar.settings.mainBar = { + cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}"; + # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input"; + temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; + temperature.input-filename = "temp1_input"; }; - output = { - eDP-1 = { - mode = "1920x1080"; # TEMPLATE - scale = "1"; - position = "2560,0"; - # bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; - }; - DP-4 = { - mode = "2560x1440"; - scale = "1"; - # bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; - position = "0,0"; + <> + + wayland.windowManager.sway = { + config = rec { + # update for actual inputs here, + + # workspaceOutputAssign = [ + # { output = "eDP-1"; workspace = "1:一"; } + # { output = "DP-4"; workspace = "2:二"; } + # ]; + + + keybindings = + let + inherit (config.wayland.windowManager.sway.config) modifier; + in + { + "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; + "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; + "XF86Display" = "exec wl-mirror eDP-1"; + # these are left open to use + # "XF86WLAN" = "exec wl-mirror eDP-1"; + # "XF86Messenger" = "exec wl-mirror eDP-1"; + # "XF86Go" = "exec wl-mirror eDP-1"; + # "XF86Favorites" = "exec wl-mirror eDP-1"; + # "XF86HomePage" = "exec wtype -P Escape -p Escape"; + # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; + # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; + "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle"; + }; + + startup = [ + <> + ]; }; }; - - workspaceOutputAssign = [ - { output = "eDP-1"; workspace = "1:一"; } - { output = "DP-4"; workspace = "2:二"; } - ]; - - - keybindings = - let - inherit (config.wayland.windowManager.sway.config) modifier; - in - { - "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\""; - "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; - "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; - "XF86Display" = "exec wl-mirror eDP-1"; - # these are left open to use - # "XF86WLAN" = "exec wl-mirror eDP-1"; - # "XF86Messenger" = "exec wl-mirror eDP-1"; - # "XF86Go" = "exec wl-mirror eDP-1"; - # "XF86Favorites" = "exec wl-mirror eDP-1"; - # "XF86HomePage" = "exec wtype -P Escape -p Escape"; - # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%"; - # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5% "; - "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle"; - }; - - startup = [ - <> - ]; - }; - }; - } + } #+end_src @@ -4404,7 +4394,7 @@ Lastly, the machine that runs matrix needs to regularly update, as otherwise you } #+end_src -** Manual Overlays and packages +** 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. @@ -4417,7 +4407,7 @@ As such, I also define three additional overlays: 3) =nixpkgs-stable= 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. -*** pkgs +*** Packages #+begin_src nix :tangle pkgs/default.nix @@ -4456,6 +4446,110 @@ As such, I also define three additional overlays: #+end_src +*** 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. + +**** 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 + +#+begin_src nix :tangle modules/nixos/default.nix + { + + } +#+end_src + + + +**** home-manager + +#+BEGIN_src nix :tangle modules/home/default.nix + { + laptop = import ./laptop.nix; + monitors = import ./monitors.nix; + input = import ./input.nix; + nixos = import ./nixos.nix; + } +#+end_src + +***** Laptop + +#+begin_src nix :tangle modules/home/laptop.nix + { lib, config, ... }: + { + options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host"; + config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop { + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + } +#+end_src + +***** Monitors + +#+begin_src nix :tangle modules/home/monitors.nix + { lib, config, ... }: + let + inherit (lib) mkOption types; + in + { + options.swarselsystems.monitors = mkOption { + type = types.attrsOf (types.attrsOf types.str ); + default = { }; + }; + } +#+end_src + +***** Input + +#+begin_src nix :tangle modules/home/input.nix + { lib, config, ... }: + let + inherit (lib) mkIf mkOption types; + in + { + options.swarselsystems.inputs = mkOption { + type = types.attrsOf (types.attrsOf types.str ); + default = { }; + }; + options.swarselsystems.kyria = mkOption { + type = types.attrsOf (types.attrsOf types.str ); + default = { + "36125:53060:splitkb.com_Kyria_rev3" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; + }; + options.swarselsystems.touchpad = mkOption { + type = types.attrsOf (types.attrsOf types.str ); + default = { }; + }; + options.swarselsystems.standardinputs = mkOption { + type = types.attrsOf (types.attrsOf types.str ); + default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; + }; + + + } +#+end_src + +***** Nixos + + +#+begin_src nix :noweb yes :tangle modules/home/nixos.nix + + { lib, config, ... }: + { + options.swarselsystems.isNixos = lib.mkEnableOption "nixos host"; + } +#+end_src + ** Common NixOS :PROPERTIES: :CUSTOM_ID: h:1c1250cd-e9b4-4715-8d9f-eb09e64bfc7f @@ -4463,12 +4557,7 @@ As such, I also define three additional overlays: These are system-level settings specific to NixOS machines. All settings that are required on all machines go here. -*** General -:PROPERTIES: -:CUSTOM_ID: h:5a114da6-ef8d-404d-b31b-b51472908e77 -:END: - -**** Imports, enable home-manager module +*** Imports, enable home-manager module :PROPERTIES: :CUSTOM_ID: h:45e4315b-0929-4c47-b65a-c8f0a685f4df :END: @@ -4502,6 +4591,7 @@ First, we enable the use of =home-manager= as a NixoS module ./interceptiontools.nix ./hardwarecompatibility.nix ./login.nix + ./stylix.nix ]; @@ -4513,6 +4603,11 @@ First, we enable the use of =home-manager= as a NixoS module #+end_src +*** General +:PROPERTIES: +:CUSTOM_ID: h:5a114da6-ef8d-404d-b31b-b51472908e77 +:END: + **** Setup login keymap :PROPERTIES: :CUSTOM_ID: h:7248f338-8cad-4443-9060-deae7955b26f @@ -4532,7 +4627,6 @@ Next, we setup the keymap in case we are not in a graphical session. At this poi } #+end_src - **** Make users non-mutable :PROPERTIES: :CUSTOM_ID: h:48959890-fbc7-4d28-b33c-f33e028ab473 @@ -4582,21 +4676,6 @@ Next, we will setup some environment variables that need to be set on the system } #+end_src -**** Disallow stylix from styling grub -:PROPERTIES: -:CUSTOM_ID: h:b09c2bb6-86b7-46f4-a855-ac21dd9988b2 -:END: - -By default, [[https://github.com/danth/stylix][stylix]] wants to style GRUB as well. However, I think that looks horrible. - -#+begin_src nix :tangle profiles/common/nixos/stylix.nix - { ... }: - { - # dont style GRUB with stylix - stylix.targets.grub.enable = false; # the styling makes grub more ugly - } -#+end_src - **** Enable PolicyKit :PROPERTIES: :CUSTOM_ID: h:e2d40df9-0026-4caa-8476-9dc2353055a1 @@ -4998,6 +5077,21 @@ I use sops-nix to handle secrets that I want to have available on my machines at } #+end_src +*** Theme (stylix) + +By default, [[https://github.com/danth/stylix][stylix]] wants to style GRUB as well. However, I think that looks horrible. +=theme= is defined in [[#h:5bc1b0c9-dc59-4c81-b5b5-e60699deda78][Theme (stylix)]]. + +#+begin_src nix :noweb yes :tangle profiles/common/nixos/stylix.nix + { pkgs, ... }: + { + stylix = { + <> + targets.grub.enable = false; # the styling makes grub more ugly + }; + } +#+end_src + *** System Packages :PROPERTIES: :CUSTOM_ID: h:0e7e8bea-ec58-499c-9731-09dddfc39532 @@ -5375,7 +5469,7 @@ This section houses the greetd related settings. I do not really want to use a d This section sets up all the imports that are used in the home-manager section. #+begin_src nix :tangle profiles/common/home/default.nix - { ... }: + { lib, pkgs, config, outputs, ... }: { imports = [ ./packages.nix @@ -5405,6 +5499,32 @@ This section sets up all the imports that are used in the home-manager section. ./sway.nix ]; + nix = { + package = lib.mkDefault pkgs.nix; + settings = { + experimental-features = [ + "nix-command" + "flakes" + "ca-derivations" + ]; + warn-dirty = false; + }; + }; + + programs = { + git.enable = true; + }; + + home = { + username = lib.mkDefault "swarsel"; + homeDirectory = lib.mkDefault "/home/${config.home.username}"; + stateVersion = lib.mkDefault "23.05"; + keyboard.layout = "us"; # TEMPLATE + sessionVariables = { + FLAKE = "$HOME/.dotfiles"; + }; + }; + } #+end_src @@ -5888,7 +6008,7 @@ It is very convenient to have SSH aliases in place for machines that I use. This } #+end_src -*** Fonts + Theme +*** Theme (stylix) :PROPERTIES: :CUSTOM_ID: h:a92318cd-413e-4e78-a478-e63b09df019c :END: @@ -5897,10 +6017,16 @@ These section allows home-manager to allow theme settings, and handles some othe This section has been notably empty ever since switching to stylix. Only Emacs is not allowed to be styled by it, because it becomes more ugly compared to my handcrafted setup. -#+begin_src nix :tangle profiles/common/home/stylix.nix - { ... }: +=theme= is defined in [[#h:5bc1b0c9-dc59-4c81-b5b5-e60699deda78][Theme (stylix)]]. + +#+begin_src nix :noweb yes :tangle profiles/common/home/stylix.nix + { lib, config, pkgs, ... }: { - stylix.targets.emacs.enable = false; + stylix = lib.mkIf (!config.swarselsystems.isNixos) { + <> + targets.emacs.enable = false; + targets.waybar.enable = false; + }; } #+end_src @@ -7022,19 +7148,20 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi sort = "-time"; width = 300; # font = "monospace 10"; - extraConfig = "[urgency=low] - border-color=#cccccc - [urgency=normal] - border-color=#d08770 - [urgency=high] - border-color=#bf616a - default-timeout=3000 - [category=mpd] - default-timeout=2000 - group-by=category - "; + extraConfig = '' + [urgency=low] + border-color=#cccccc + [urgency=normal] + border-color=#d08770 + [urgency=high] + border-color=#bf616a + default-timeout=3000 + [category=mpd] + default-timeout=2000 + group-by=category + ''; }; -} + } #+end_src *** Sway @@ -7047,7 +7174,20 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded Currently, I am too lazy to explain every option here, but most of it is very self-explaining in any case. #+begin_src nix :tangle profiles/common/home/sway.nix - { config, pkgs, ... }: + { config, pkgs, lib, ... }: with lib; + let + monitors = config.swarselsystems.monitors; + eachMonitor = _name: monitor: { + name = monitor.name; + value = builtins.removeAttrs monitor [ "workspace" "name" "output" ]; + }; + eachOutput = _name: monitor: { + name = monitor.name; + value = builtins.removeAttrs monitor [ "mode" "name" "scale" "position" ]; + }; + workplaceSets = (mapAttrs' eachOutput monitors); + workplaceOutputs = (map (key: getAttr key workplaceSets) (attrNames workplaceSets)); + in { wayland.windowManager.sway = { enable = true; @@ -7147,6 +7287,9 @@ Currently, I am too lazy to explain every option here, but most of it is very se }; }; defaultWorkspace = "workspace 1:一"; + output = (mapAttrs' eachMonitor monitors); + input = config.swarselsystems.standardinputs; + workspaceOutputAssign = workplaceOutputs; startup = [ { command = "kitty -T kittyterm"; } { command = "sleep 60; kitty -T spotifytui -o confirm_os_window_close=0 spotify_player"; } diff --git a/flake.nix b/flake.nix index 5bc3af1..c8c1b96 100644 --- a/flake.nix +++ b/flake.nix @@ -115,7 +115,6 @@ # NixOS modules that can only be used on NixOS systems nixModules = [ - (_: { nix.extraOptions = "experimental-features = nix-command flakes"; }) inputs.stylix.nixosModules.stylix inputs.sops-nix.nixosModules.sops inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm @@ -139,6 +138,9 @@ inherit lib; inherit mixedModules; + nixosModules = import ./modules/nixos; + homeManagerModules = import ./modules/home; + packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); devShells = forEachSystem (pkgs: diff --git a/index.html b/index.html index de9c7cf..be722f4 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. Manual Overlays and packages +
  • 3.2. Overlays, packages, and modules
  • 3.3. Common NixOS
  • 3.4. Common Home-Manager
      -
    • 3.4.1. Imports
    • +
    • 3.4.1. Imports
    • 3.4.2. Installed packages
    • 3.4.3. sops
    • 3.4.4. SSH Machines
    • -
    • 3.4.5. Fonts + Theme
    • +
    • 3.4.5. Theme (stylix)
    • 3.4.6. Desktop Entries
    • 3.4.7. Linking dotfiles
    • 3.4.8. Sourcing environment variables
    • 3.4.9. Programs
    • -
    • 3.4.10. nix-index
    • +
    • 3.4.10. nix-index
    • 3.4.11. password-store
    • 3.4.12. direnv
    • 3.4.13. eza
    • @@ -336,7 +339,7 @@
      • 4.4.1. Org Mode
      • 4.4.2. Nix Mode
      • -
      • 4.4.3. nixpkgs-fmt
      • +
      • 4.4.3. nixpkgs-fmt
      • 4.4.4. Markdown Mode
      • 4.4.5. Olivetti
      • 4.4.6. darkroom
      • @@ -396,7 +399,7 @@

        -This file has 41818 words spanning 11251 lines and was last revised on 2024-07-23 11:27:32 +0200. +This file has 42234 words spanning 11394 lines and was last revised on 2024-07-24 18:31:42 +0200.

        @@ -446,7 +449,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-07-23 11:27:32 +0200) +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-07-24 18:31:42 +0200)

      @@ -537,49 +540,47 @@ For styling, I am using the stylix
      -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;
      +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";
         };
      -  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";
      -    };
      +  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";
      -    };
      +  monospace = {
      +    package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; };
      +    name = "FiraCode Nerd Font Mono";
      +  };
       
      -    emoji = {
      -      package = pkgs.noto-fonts-emoji;
      -      name = "Noto Color Emoji";
      -    };
      +  emoji = {
      +    package = pkgs.noto-fonts-emoji;
      +    name = "Noto Color Emoji";
         };
       };
       
      @@ -1048,7 +1049,6 @@ homepkgs = import nixpkgs { system = "x86_64-linux";
       
       # NixOS modules that can only be used on NixOS systems
       nixModules = [
      -  (_: { nix.extraOptions = "experimental-features = nix-command flakes"; })
         inputs.stylix.nixosModules.stylix
         inputs.sops-nix.nixosModules.sops
         inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
      @@ -1071,13 +1071,16 @@ mixedModules = [
       
      -
      -

      2.3.3. General (outputs)

      +
      +

      2.3.3. General (outputs)

       inherit lib;
       inherit mixedModules;
      +nixosModules = import ./modules/nixos;
      +homeManagerModules = import ./modules/home;
      +
       packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
       devShells = forEachSystem
         (pkgs:
      @@ -1394,49 +1397,47 @@ No matter what you do, check the initial /etc/nixos/configuration.nix for notabl
       
         stylix.image = ../../wallpaper/TEMPLATEwp.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;
      +  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";
           };
      -    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";
      -      };
      +    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";
      -      };
      +    monospace = {
      +      package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; };
      +      name = "FiraCode Nerd Font Mono";
      +    };
       
      -      emoji = {
      -        package = pkgs.noto-fonts-emoji;
      -        name = "Noto Color Emoji";
      -      };
      +    emoji = {
      +      package = pkgs.noto-fonts-emoji;
      +      name = "Noto Color Emoji";
           };
         };
       
      @@ -2462,7 +2463,7 @@ in
       
       
       
      -
    • Home-manager only
      +
    • Home-manager only
      1. Home manager
        @@ -2483,49 +2484,47 @@ Special things to note here: We are running xcape to allow CAPS to 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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; @@ -2679,49 +2678,47 @@ New setup for the SP3, this time using NixOS - another machine will take over th 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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; @@ -2887,9 +2884,10 @@ My new main machine. { home-manager.users.swarsel.imports = outputs.mixedModules ++ [ ./home.nix - ]; + ] ++ (builtins.attrValues outputs.homeManagerModules); } - ]; + ]++ (builtins.attrValues outputs.nixosModules); + nixpkgs = { overlays = outputs.overlays; @@ -2898,6 +2896,39 @@ My new main machine. }; }; + # ------ ----- + # | DP-4 | |eDP-1| + # ------ ----- + home-manager.users.swarsel.swarselsystems = { + isLaptop = true; + isNixos = true; + monitors = { + main = { + name = "California Institute of Technology 0x1407 Unknown"; + mode = "1920x1080"; # TEMPLATE + scale = "1"; + position = "2560,0"; + workspace = "2:二"; + output = "eDP-1"; + }; + homedesktop = { + name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + mode = "2560x1440"; + scale = "1"; + position = "0,0"; + workspace = "1:一"; + output = "DP-4"; + }; + }; + inputs = { + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "us"; + xkb_options = "grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + }; + }; + } @@ -2962,53 +2993,6 @@ Mostly just sets some opened ports for several games, enables virtualbox (which stylix.image = ../../wallpaper/lenovowp.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"; - }; - }; - }; - - hardware = { graphics = { enable = true; @@ -3077,139 +3061,96 @@ This is basically just adjusted to the core count, path to the hwmon
        -
        { config, pkgs, ... }:
        -
        -{
        +
        { config, pkgs, lib, ... }: with lib;
        +    {
         
         
        -  services.gpg-agent = {
        -    enable = true;
        -    enableSshSupport = true;
        -    enableExtraSocket = true;
        -    pinentryPackage = pkgs.pinentry.gtk2;
        -    defaultCacheTtl = 600;
        -    maxCacheTtl = 7200;
        -    extraConfig = ''
        -      allow-loopback-pinentry
        -      allow-emacs-pinentry
        -    '';
        -  };
        -
        -  home = {
        -    username = "swarsel";
        -    homeDirectory = "/home/swarsel";
        -    stateVersion = "23.05"; # TEMPLATE -- Please read the comment before changing.
        -    keyboard.layout = "us"; # TEMPLATE
        -    packages = with pkgs; [
        -    ];
        -  };
        -  sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ];
        -
        -  # waybar config - TEMPLATE - update for cores and temp
        -  programs.waybar.settings.mainBar = {
        -    cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
        -    # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input";
        -    temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
        -    temperature.input-filename = "temp1_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"
        -    "custom/pseudobat"
        -    "battery"
        -    "custom/left-arrow-dark"
        -    "group/hardware"
        -    "custom/left-arrow-light"
        -    "clock#2"
        -    "custom/left-arrow-dark"
        -    "clock#1"
        -  ];
        -
        -
        -  wayland.windowManager.sway = {
        -    config = rec {
        -      # update for actual inputs here,
        -      input = {
        -        "36125:53060:splitkb.com_Kyria_rev3" = {
        -          xkb_layout = "us";
        -          xkb_variant = "altgr-intl";
        -        };
        -        "1:1:AT_Translated_Set_2_keyboard" = {
        -          # TEMPLATE
        -          xkb_layout = "us";
        -          xkb_options = "grp:win_space_toggle";
        -          xkb_variant = "altgr-intl";
        -        };
        -        "type:touchpad" = {
        -          dwt = "enabled";
        -          tap = "enabled";
        -          natural_scroll = "enabled";
        -          middle_emulation = "enabled";
        -        };
        -
        +      services.gpg-agent = {
        +        enable = true;
        +        enableSshSupport = true;
        +        enableExtraSocket = true;
        +        pinentryPackage = pkgs.pinentry.gtk2;
        +        defaultCacheTtl = 600;
        +        maxCacheTtl = 7200;
        +        extraConfig = ''
        +          allow-loopback-pinentry
        +          allow-emacs-pinentry
        +        '';
               };
         
        -      output = {
        -        eDP-1 = {
        -          mode = "1920x1080"; # TEMPLATE
        -          scale = "1";
        -          position = "2560,0";
        -          # bg = "~/.dotfiles/wallpaper/lenovowp.png fill";
        -        };
        -        DP-4 = {
        -          mode = "2560x1440";
        -          scale = "1";
        -          # bg = "~/.dotfiles/wallpaper/lenovowp.png fill";
        -          position = "0,0";
        -        };
        +      sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ];
        +
        +      # waybar config - TEMPLATE - update for cores and temp
        +      programs.waybar.settings.mainBar = {
        +        cpu.format = "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
        +        # temperature.hwmon-path = "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon4/temp1_input";
        +        temperature.hwmon-path.abs = "/sys/devices/platform/thinkpad_hwmon/hwmon/";
        +        temperature.input-filename = "temp1_input";
               };
         
        -      workspaceOutputAssign = [
        -        { output = "eDP-1"; workspace = "1:一"; }
        -        { output = "DP-4"; workspace = "2:二"; }
        +
        +      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"
        +        "custom/pseudobat"
        +        "battery"
        +        "custom/left-arrow-dark"
        +        "group/hardware"
        +        "custom/left-arrow-light"
        +        "clock#2"
        +        "custom/left-arrow-dark"
        +        "clock#1"
               ];
         
         
        -      keybindings =
        -        let
        -          inherit (config.wayland.windowManager.sway.config) modifier;
        -        in
        -        {
        -          "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\"";
        -          "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
        -          "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
        -          "XF86Display" = "exec wl-mirror eDP-1";
        -          # these are left open to use
        -          # "XF86WLAN" = "exec wl-mirror eDP-1";
        -          # "XF86Messenger" = "exec wl-mirror eDP-1";
        -          # "XF86Go" = "exec wl-mirror eDP-1";
        -          # "XF86Favorites" = "exec wl-mirror eDP-1";
        -          # "XF86HomePage" = "exec wtype -P Escape -p Escape";
        -          # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%";
        -          # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5%  ";
        -          "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle";
        +      wayland.windowManager.sway = {
        +        config = rec {
        +          # update for actual inputs here,
        +
        +          # workspaceOutputAssign = [
        +          #   { output = "eDP-1"; workspace = "1:一"; }
        +          #   { output = "DP-4"; workspace = "2:二"; }
        +          # ];
        +
        +
        +          keybindings =
        +            let
        +              inherit (config.wayland.windowManager.sway.config) modifier;
        +            in
        +              {
        +                "${modifier}+w" = "exec \"bash ~/.dotfiles/scripts/checkelement.sh\"";
        +                "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
        +                "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
        +                "XF86Display" = "exec wl-mirror eDP-1";
        +                # these are left open to use
        +                # "XF86WLAN" = "exec wl-mirror eDP-1";
        +                # "XF86Messenger" = "exec wl-mirror eDP-1";
        +                # "XF86Go" = "exec wl-mirror eDP-1";
        +                # "XF86Favorites" = "exec wl-mirror eDP-1";
        +                # "XF86HomePage" = "exec wtype -P Escape -p Escape";
        +                # "XF86AudioLowerVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink -5%";
        +                # "XF86AudioRaiseVolume" = "pactl set-sink-volume alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink +5%  ";
        +                "XF86AudioMute" = "pactl set-sink-mute alsa_output.pci-0000_08_00.6.HiFi__hw_Generic_1__sink toggle";
        +              };
        +
        +          startup = [
        +
        +            { command = "nextcloud --background"; }
        +            { command = "discord --start-minimized"; }
        +            { command = "element-desktop --hidden  -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
        +            { command = "ANKI_WAYLAND=1 anki"; }
        +            { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
        +            { command = "nm-applet"; }
        +
        +          ];
                 };
        -
        -      startup = [
        -
        -        { command = "nextcloud --background"; }
        -        { command = "discord --start-minimized"; }
        -        { command = "element-desktop --hidden  -enable-features=UseOzonePlatform -ozone-platform=wayland --disable-gpu-driver-bug-workarounds"; }
        -        { command = "ANKI_WAYLAND=1 anki"; }
        -        { command = "OBSIDIAN_USE_WAYLAND=1 obsidian"; }
        -        { command = "nm-applet"; }
        -
        -      ];
        -    };
        -  };
        -}
        +      };
        +    }
         
         
        @@ -3286,49 +3227,47 @@ Mostly just sets some opened ports for several games, enables virtualbox (which stylix.image = ../../wallpaper/lenovowp.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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; @@ -5608,8 +5547,8 @@ in
    • -
      -

      3.2. Manual Overlays and packages

      +
      +

      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. @@ -5628,8 +5567,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. pkgs

      +
      +

      3.2.1. Packages

      @@ -5639,8 +5578,8 @@ _ : rec { }
       
      -
      -

      3.2.2. Overlays

      +
      +

      3.2.2. Overlays

      @@ -5673,6 +5612,129 @@ _ : rec { }
       
      +
      +

      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
        +
        +

        +Modules that need to be loaded on the NixOS level. Note that these will not be available on systems that are not running NixOS +

        + +
        +
        {
        +
        +}
        +
        +
        +
        +
      2. +
      3. home-manager
        +
        +
        +
        {
        +  laptop = import ./laptop.nix;
        +  monitors = import ./monitors.nix;
        +  input = import ./input.nix;
        +  nixos = import ./nixos.nix;
        +}
        +
        +
        +
        +
          +
        1. Laptop
          +
          +
          +
          { lib, config, ... }:
          +{
          +  options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host";
          +  config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop {
          +     "type:touchpad" = {
          +        dwt = "enabled";
          +        tap = "enabled";
          +        natural_scroll = "enabled";
          +        middle_emulation = "enabled";
          +     };
          +  };
          +}
          +
          +
          +
          +
        2. +
        3. Monitors
          +
          +
          +
          { lib, config, ... }:
          +let
          +  inherit (lib) mkOption types;
          +in
          +{
          +  options.swarselsystems.monitors = mkOption {
          +    type = types.attrsOf (types.attrsOf types.str );
          +    default = { };
          +  };
          +}
          +
          +
          +
          +
        4. +
        5. Input
          +
          +
          +
          { lib, config, ... }:
          +let
          +  inherit (lib) mkIf mkOption types;
          +in
          +{
          +  options.swarselsystems.inputs = mkOption {
          +    type = types.attrsOf (types.attrsOf types.str );
          +    default = { };
          +  };
          +  options.swarselsystems.kyria = mkOption {
          +    type = types.attrsOf (types.attrsOf types.str );
          +    default = {
          +      "36125:53060:splitkb.com_Kyria_rev3" = {
          +        xkb_layout = "us";
          +        xkb_variant = "altgr-intl";
          +      };
          +    };
          +  };
          +  options.swarselsystems.touchpad = mkOption {
          +    type = types.attrsOf (types.attrsOf types.str );
          +    default = { };
          +  };
          +  options.swarselsystems.standardinputs = mkOption {
          +    type = types.attrsOf (types.attrsOf types.str );
          +    default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs;
          +  };
          +
          +
          +}
          +
          +
          +
          +
        6. +
        7. Nixos
          +
          +
          +
          +{ lib, config, ... }:
          +{
          +  options.swarselsystems.isNixos = lib.mkEnableOption "nixos host";
          +}
          +
          +
          +
          +
        8. +
        +
      4. +
      +

      3.3. Common NixOS

      @@ -5681,13 +5743,9 @@ _ : rec { } These are system-level settings specific to NixOS machines. All settings that are required on all machines go here.

      -
      -

      3.3.1. General

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

        3.3.1. Imports, enable home-manager module

        +

        First, we enable the use of home-manager as a NixoS module

        @@ -5719,6 +5777,7 @@ First, we enable the use of home-manager as a NixoS module ./interceptiontools.nix ./hardwarecompatibility.nix ./login.nix + ./stylix.nix ]; @@ -5731,7 +5790,12 @@ First, we enable the use of home-manager as a NixoS module
        -
      2. +
      +
      +

      3.3.2. General

      +
      +
      +
      1. Setup login keymap

        @@ -5803,22 +5867,6 @@ Next, we will setup some environment variables that need to be set on the system

      -
    • Disallow stylix from styling grub
      -
      -

      -By default, stylix wants to style GRUB as well. However, I think that looks horrible. -

      - -
      -
      { ... }:
      -{
      -  # dont style GRUB with stylix
      -  stylix.targets.grub.enable = false; # the styling makes grub more ugly
      -}
      -
      -
      -
      -
    • Enable PolicyKit

      @@ -6183,7 +6231,7 @@ Setup timezone and locale. I want to use the US layout, but have the rest adapte

      -

      3.3.2. sops

      +

      3.3.3. sops

      I use sops-nix to handle secrets that I want to have available on my machines at all times. Procedure to add a new machine: @@ -6233,8 +6281,72 @@ I use sops-nix to handle secrets that I want to have available on my machines at

    • +
      +

      3.3.4. Theme (stylix)

      +
      +

      +By default, stylix wants to style GRUB as well. However, I think that looks horrible. +theme is defined in Theme (stylix). +

      + +
      +
      { pkgs, ... }:
      +{
      +  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";
      +      };
      +    };
      +
      +    targets.grub.enable = false; # the styling makes grub more ugly
      +  };
      +}
      +
      +
      +
      +
      -

      3.3.3. System Packages

      +

      3.3.5. System Packages

      Mostly used to install some compilers and lsp's that I want to have available when not using a devShell flake. Most other packages should go in Installed packages. @@ -6327,7 +6439,7 @@ Mostly used to install some compilers and lsp's that I want to have available wh

      -

      3.3.4. Programs (including zsh setup)

      +

      3.3.6. Programs (including zsh setup)

      Some programs profit from being installed through dedicated NixOS settings on system-level; these go here. Notably the zsh setup goes here and cannot be deleted under any circumstances. @@ -6346,8 +6458,8 @@ Some programs profit from being installed through dedicated NixOS settings on sy

        -
      1. zsh
        -
        +
      2. zsh
        +

        Do not touch this.

        @@ -6364,8 +6476,8 @@ Do not touch this.
      -
    • syncthing
      -
      +
    • syncthing
      +
       { ... }:
      @@ -6420,7 +6532,7 @@ Do not touch this.
       
       
      -

      3.3.5. Services

      +

      3.3.7. Services

      Setting up some hardware services as well as keyboard related settings. Here we make sure that we can use the CAPS key as a ESC/CTRL double key, which is a lifesaver. @@ -6442,8 +6554,8 @@ 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.

      @@ -6494,8 +6606,8 @@ services.printing = {
    • -
    • Avahi (device discovery)
      -
      +
    • Avahi (device discovery)
      +

      Avahi is the service used for the network discovery.

      @@ -6573,7 +6685,7 @@ This is a super-convenient package that lets my remap my CAPS key t
      -

      3.3.6. Hardware compatibility settings (Yubikey, Ledger) - udev rules

      +

      3.3.8. Hardware compatibility settings (Yubikey, Ledger) - udev rules

      It makes sense to house these settings in their own section, since they are all needed really. Note that the starting of the gpg-agent is done in the sway settings, to also perform this step of the setup for non NixOS-machines at the same time. @@ -6611,7 +6723,7 @@ Also, this is a good place to setup the udev rules.

      -

      3.3.7. System Login

      +

      3.3.9. System Login

      This section houses the greetd related settings. I do not really want to use a display manager, but it is useful to have setup in some ways - in my case for starting sway on system startup. Notably the default user login setting that is commented out here goes into the system specific settings, make sure to update it there @@ -6648,15 +6760,15 @@ This section houses the greetd related settings. I do not really want to use a d

      3.4. Common Home-Manager

      -
      -

      3.4.1. Imports

      +
      +

      3.4.1. Imports

      This section sets up all the imports that are used in the home-manager section.

      -
      { ... }:
      +
      { lib, pkgs, config, outputs, ... }:
       {
         imports = [
           ./packages.nix
      @@ -6686,6 +6798,32 @@ This section sets up all the imports that are used in the home-manager section.
           ./sway.nix
         ];
       
      +  nix = {
      +    package = lib.mkDefault pkgs.nix;
      +    settings = {
      +      experimental-features = [
      +        "nix-command"
      +        "flakes"
      +        "ca-derivations"
      +      ];
      +      warn-dirty = false;
      +    };
      +  };
      +
      +  programs = {
      +    git.enable = true;
      +  };
      +
      +  home = {
      +    username = lib.mkDefault "swarsel";
      +    homeDirectory = lib.mkDefault "/home/${config.home.username}";
      +    stateVersion = lib.mkDefault "23.05";
      +    keyboard.layout = "us"; # TEMPLATE
      +    sessionVariables = {
      +      FLAKE = "$HOME/.dotfiles";
      +    };
      +  };
      +
       }
       
      @@ -7187,7 +7325,7 @@ It is very convenient to have SSH aliases in place for machines that I use. This
      -

      3.4.5. Fonts + Theme

      +

      3.4.5. Theme (stylix)

      These section allows home-manager to allow theme settings, and handles some other appearance-related settings like cursor styles. Interestingly, system icons (adwaita) still need to be setup on system-level, and will break if defined here. @@ -7197,10 +7335,62 @@ These section allows home-manager to allow theme settings, and handles some othe This section has been notably empty ever since switching to stylix. Only Emacs is not allowed to be styled by it, because it becomes more ugly compared to my handcrafted setup.

      +

      +theme is defined in Theme (stylix). +

      +
      -
      { ... }:
      +
      { lib, config, pkgs, ... }:
       {
      - stylix.targets.emacs.enable = false;
      + stylix = lib.mkIf (!config.swarselsystems.isNixos) {
      +
      +   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";
      +     };
      +   };
      +
      +   targets.emacs.enable = false;
      +   targets.waybar.enable = false;
      + };
       }
       
      @@ -7377,8 +7567,8 @@ This section is for programs that require no further configuration. zsh Integrat
    • -
      -

      3.4.10. nix-index

      +
      +

      3.4.10. 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. @@ -8371,35 +8561,36 @@ The `extraConfig` section here CANNOT be reindented. This has something to do wi

      -
        { ... }:
      -  {
      -    services.mako = {
      -      enable = true;
      -      # backgroundColor = "#2e3440";
      -      # borderColor = "#88c0d0";
      -      borderRadius = 15;
      -      borderSize = 1;
      -      defaultTimeout = 5000;
      -      height = 150;
      -      icons = true;
      -      ignoreTimeout = true;
      -      layer = "overlay";
      -      maxIconSize = 64;
      -      sort = "-time";
      -      width = 300;
      -      # font = "monospace 10";
      -      extraConfig = "[urgency=low]
      -    border-color=#cccccc
      -    [urgency=normal]
      -    border-color=#d08770
      -    [urgency=high]
      -    border-color=#bf616a
      -    default-timeout=3000
      -    [category=mpd]
      -    default-timeout=2000
      -    group-by=category
      -    ";
      -    };
      +
      { ... }:
      +{
      +  services.mako = {
      +    enable = true;
      +    # backgroundColor = "#2e3440";
      +    # borderColor = "#88c0d0";
      +    borderRadius = 15;
      +    borderSize = 1;
      +    defaultTimeout = 5000;
      +    height = 150;
      +    icons = true;
      +    ignoreTimeout = true;
      +    layer = "overlay";
      +    maxIconSize = 64;
      +    sort = "-time";
      +    width = 300;
      +    # font = "monospace 10";
      +    extraConfig = ''
      +      [urgency=low]
      +      border-color=#cccccc
      +      [urgency=normal]
      +      border-color=#d08770
      +      [urgency=high]
      +      border-color=#bf616a
      +      default-timeout=3000
      +      [category=mpd]
      +      default-timeout=2000
      +      group-by=category
      +      '';
      +  };
       }
       
      @@ -8419,7 +8610,20 @@ Currently, I am too lazy to explain every option here, but most of it is very se

      -
      { config, pkgs, ... }:
      +
      { config, pkgs, lib, ... }: with lib;
      +  let
      +    monitors = config.swarselsystems.monitors;
      +    eachMonitor = _name: monitor: {
      +      name = monitor.name;
      +      value = builtins.removeAttrs monitor [ "workspace" "name" "output" ];
      +    };
      +    eachOutput = _name: monitor: {
      +      name = monitor.name;
      +      value = builtins.removeAttrs monitor [ "mode" "name" "scale" "position" ];
      +    };
      +    workplaceSets = (mapAttrs' eachOutput monitors);
      +    workplaceOutputs = (map (key: getAttr key workplaceSets) (attrNames workplaceSets));
      +  in
       {
         wayland.windowManager.sway = {
           enable = true;
      @@ -8519,6 +8723,9 @@ Currently, I am too lazy to explain every option here, but most of it is very se
               };
             };
             defaultWorkspace = "workspace 1:一";
      +      output = (mapAttrs' eachMonitor monitors);
      +      input = config.swarselsystems.standardinputs;
      +      workspaceOutputAssign = workplaceOutputs;
             startup = [
               { command = "kitty -T kittyterm"; }
               { command = "sleep 60; kitty -T spotifytui -o confirm_os_window_close=0 spotify_player"; }
      @@ -8823,7 +9030,6 @@ 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 = [
      -        (_: { nix.extraOptions = "experimental-features = nix-command flakes"; })
               inputs.stylix.nixosModules.stylix
               inputs.sops-nix.nixosModules.sops
               inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
      @@ -8847,6 +9053,9 @@ This tangles the flake.nix file; This block only needs to be touched when updati
       
             inherit lib;
             inherit mixedModules;
      +      nixosModules = import ./modules/nixos;
      +      homeManagerModules = import ./modules/home;
      +
             packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
             devShells = forEachSystem
               (pkgs:
      @@ -9702,7 +9911,7 @@ The standard Emacs behaviour for the Python process shell is a bit annoying. Thi
       
      -
    • 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. @@ -9735,7 +9944,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 @@ -11308,8 +11517,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. @@ -13324,7 +13533,7 @@ My laptop, sadly soon to be replaced by a new one, since most basic functions ar

      Author: Leon Schwarzäugl

      -

      Created: 2024-07-23 Di 11:27

      +

      Created: 2024-07-24 Mi 18:31

      Validate

      diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..266887d --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,6 @@ +{ + laptop = import ./laptop.nix; + monitors = import ./monitors.nix; + input = import ./input.nix; + nixos = import ./nixos.nix; +} diff --git a/modules/home/input.nix b/modules/home/input.nix new file mode 100644 index 0000000..7f7cc9a --- /dev/null +++ b/modules/home/input.nix @@ -0,0 +1,29 @@ +{ lib, config, ... }: +let + inherit (lib) mkIf mkOption types; +in +{ + options.swarselsystems.inputs = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = { }; + }; + options.swarselsystems.kyria = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = { + "36125:53060:splitkb.com_Kyria_rev3" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; + }; + options.swarselsystems.touchpad = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = { }; + }; + options.swarselsystems.standardinputs = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = lib.recursiveUpdate (lib.recursiveUpdate config.swarselsystems.touchpad config.swarselsystems.kyria) config.swarselsystems.inputs; + }; + + +} diff --git a/modules/home/laptop.nix b/modules/home/laptop.nix new file mode 100644 index 0000000..4ee50d4 --- /dev/null +++ b/modules/home/laptop.nix @@ -0,0 +1,12 @@ +{ lib, config, ... }: +{ + options.swarselsystems.isLaptop = lib.mkEnableOption "laptop host"; + config.swarselsystems.touchpad = lib.mkIf config.swarselsystems.isLaptop { + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; +} diff --git a/modules/home/monitors.nix b/modules/home/monitors.nix new file mode 100644 index 0000000..1a9e177 --- /dev/null +++ b/modules/home/monitors.nix @@ -0,0 +1,10 @@ +{ lib, config, ... }: +let + inherit (lib) mkOption types; +in +{ + options.swarselsystems.monitors = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = { }; + }; +} diff --git a/modules/home/nixos.nix b/modules/home/nixos.nix new file mode 100644 index 0000000..ffc7742 --- /dev/null +++ b/modules/home/nixos.nix @@ -0,0 +1,4 @@ +{ lib, config, ... }: +{ + options.swarselsystems.isNixos = lib.mkEnableOption "nixos host"; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..ffcd441 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1 @@ +{ } diff --git a/profiles/TEMPLATE/nixos.nix b/profiles/TEMPLATE/nixos.nix index 59097a5..3097789 100644 --- a/profiles/TEMPLATE/nixos.nix +++ b/profiles/TEMPLATE/nixos.nix @@ -38,49 +38,47 @@ stylix.image = ../../wallpaper/TEMPLATEwp.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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; diff --git a/profiles/common/home/default.nix b/profiles/common/home/default.nix index 173a429..341c053 100644 --- a/profiles/common/home/default.nix +++ b/profiles/common/home/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, pkgs, config, outputs, ... }: { imports = [ ./packages.nix @@ -28,4 +28,30 @@ ./sway.nix ]; + nix = { + package = lib.mkDefault pkgs.nix; + settings = { + experimental-features = [ + "nix-command" + "flakes" + "ca-derivations" + ]; + warn-dirty = false; + }; + }; + + programs = { + git.enable = true; + }; + + home = { + username = lib.mkDefault "swarsel"; + homeDirectory = lib.mkDefault "/home/${config.home.username}"; + stateVersion = lib.mkDefault "23.05"; + keyboard.layout = "us"; # TEMPLATE + sessionVariables = { + FLAKE = "$HOME/.dotfiles"; + }; + }; + } diff --git a/profiles/common/home/mako.nix b/profiles/common/home/mako.nix index 0a466c8..a67eacc 100644 --- a/profiles/common/home/mako.nix +++ b/profiles/common/home/mako.nix @@ -15,16 +15,17 @@ sort = "-time"; width = 300; # font = "monospace 10"; - extraConfig = "[urgency=low] - border-color=#cccccc - [urgency=normal] - border-color=#d08770 - [urgency=high] - border-color=#bf616a - default-timeout=3000 - [category=mpd] - default-timeout=2000 - group-by=category - "; + extraConfig = '' + [urgency=low] + border-color=#cccccc + [urgency=normal] + border-color=#d08770 + [urgency=high] + border-color=#bf616a + default-timeout=3000 + [category=mpd] + default-timeout=2000 + group-by=category + ''; }; } diff --git a/profiles/common/home/stylix.nix b/profiles/common/home/stylix.nix index 0596743..dc683e1 100644 --- a/profiles/common/home/stylix.nix +++ b/profiles/common/home/stylix.nix @@ -1,4 +1,52 @@ -{ ... }: +{ lib, config, pkgs, ... }: { - stylix.targets.emacs.enable = false; + stylix = lib.mkIf (!config.swarselsystems.isNixos) { + + 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"; + }; + }; + + targets.emacs.enable = false; + targets.waybar.enable = false; + }; } diff --git a/profiles/common/home/sway.nix b/profiles/common/home/sway.nix index ebe63b7..f6a5207 100644 --- a/profiles/common/home/sway.nix +++ b/profiles/common/home/sway.nix @@ -1,4 +1,17 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: with lib; +let + monitors = config.swarselsystems.monitors; + eachMonitor = _name: monitor: { + name = monitor.name; + value = builtins.removeAttrs monitor [ "workspace" "name" "output" ]; + }; + eachOutput = _name: monitor: { + name = monitor.name; + value = builtins.removeAttrs monitor [ "mode" "name" "scale" "position" ]; + }; + workplaceSets = (mapAttrs' eachOutput monitors); + workplaceOutputs = (map (key: getAttr key workplaceSets) (attrNames workplaceSets)); +in { wayland.windowManager.sway = { enable = true; @@ -98,6 +111,9 @@ }; }; defaultWorkspace = "workspace 1:一"; + output = (mapAttrs' eachMonitor monitors); + input = config.swarselsystems.standardinputs; + workspaceOutputAssign = workplaceOutputs; startup = [ { command = "kitty -T kittyterm"; } { command = "sleep 60; kitty -T spotifytui -o confirm_os_window_close=0 spotify_player"; } diff --git a/profiles/common/nixos/default.nix b/profiles/common/nixos/default.nix index 7c82208..753f0af 100644 --- a/profiles/common/nixos/default.nix +++ b/profiles/common/nixos/default.nix @@ -23,6 +23,7 @@ ./interceptiontools.nix ./hardwarecompatibility.nix ./login.nix + ./stylix.nix ]; diff --git a/profiles/common/nixos/stylix.nix b/profiles/common/nixos/stylix.nix index 9e98507..bd273b3 100644 --- a/profiles/common/nixos/stylix.nix +++ b/profiles/common/nixos/stylix.nix @@ -1,5 +1,51 @@ -{ ... }: +{ pkgs, ... }: { - # dont style GRUB with stylix - stylix.targets.grub.enable = false; # the styling makes grub more ugly + 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"; + }; + }; + + targets.grub.enable = false; # the styling makes grub more ugly + }; } diff --git a/profiles/fourside/default.nix b/profiles/fourside/default.nix index a55c7f4..cac0b49 100644 --- a/profiles/fourside/default.nix +++ b/profiles/fourside/default.nix @@ -9,9 +9,10 @@ { home-manager.users.swarsel.imports = outputs.mixedModules ++ [ ./home.nix - ]; + ] ++ (builtins.attrValues outputs.homeManagerModules); } - ]; + ] ++ (builtins.attrValues outputs.nixosModules); + nixpkgs = { overlays = outputs.overlays; @@ -20,4 +21,37 @@ }; }; + # ------ ----- + # | DP-4 | |eDP-1| + # ------ ----- + home-manager.users.swarsel.swarselsystems = { + isLaptop = true; + isNixos = true; + monitors = { + main = { + name = "California Institute of Technology 0x1407 Unknown"; + mode = "1920x1080"; # TEMPLATE + scale = "1"; + position = "2560,0"; + workspace = "2:二"; + output = "eDP-1"; + }; + homedesktop = { + name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320"; + mode = "2560x1440"; + scale = "1"; + position = "0,0"; + workspace = "1:一"; + output = "DP-4"; + }; + }; + inputs = { + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "us"; + xkb_options = "grp:win_space_toggle"; + xkb_variant = "altgr-intl"; + }; + }; + }; + } diff --git a/profiles/fourside/home.nix b/profiles/fourside/home.nix index 25d727f..f1bc192 100644 --- a/profiles/fourside/home.nix +++ b/profiles/fourside/home.nix @@ -1,5 +1,4 @@ -{ config, pkgs, ... }: - +{ config, pkgs, lib, ... }: with lib; { @@ -16,14 +15,6 @@ ''; }; - home = { - username = "swarsel"; - homeDirectory = "/home/swarsel"; - stateVersion = "23.05"; # TEMPLATE -- Please read the comment before changing. - keyboard.layout = "us"; # TEMPLATE - packages = with pkgs; [ - ]; - }; sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/sops" ]; # waybar config - TEMPLATE - update for cores and temp @@ -57,45 +48,11 @@ wayland.windowManager.sway = { config = rec { # update for actual inputs here, - input = { - "36125:53060:splitkb.com_Kyria_rev3" = { - xkb_layout = "us"; - xkb_variant = "altgr-intl"; - }; - "1:1:AT_Translated_Set_2_keyboard" = { - # TEMPLATE - xkb_layout = "us"; - xkb_options = "grp:win_space_toggle"; - xkb_variant = "altgr-intl"; - }; - "type:touchpad" = { - dwt = "enabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - }; - }; - - output = { - eDP-1 = { - mode = "1920x1080"; # TEMPLATE - scale = "1"; - position = "2560,0"; - # bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; - }; - DP-4 = { - mode = "2560x1440"; - scale = "1"; - # bg = "~/.dotfiles/wallpaper/lenovowp.png fill"; - position = "0,0"; - }; - }; - - workspaceOutputAssign = [ - { output = "eDP-1"; workspace = "1:一"; } - { output = "DP-4"; workspace = "2:二"; } - ]; + # workspaceOutputAssign = [ + # { output = "eDP-1"; workspace = "1:一"; } + # { output = "DP-4"; workspace = "2:二"; } + # ]; keybindings = diff --git a/profiles/fourside/nixos.nix b/profiles/fourside/nixos.nix index 0bf04c0..0022a6b 100644 --- a/profiles/fourside/nixos.nix +++ b/profiles/fourside/nixos.nix @@ -48,53 +48,6 @@ stylix.image = ../../wallpaper/lenovowp.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"; - }; - }; - }; - - hardware = { graphics = { enable = true; diff --git a/profiles/home-manager/home.nix b/profiles/home-manager/home.nix index ee10a26..5e54b3d 100644 --- a/profiles/home-manager/home.nix +++ b/profiles/home-manager/home.nix @@ -9,49 +9,47 @@ 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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; diff --git a/profiles/threed/nixos.nix b/profiles/threed/nixos.nix index 34873a6..0f59691 100644 --- a/profiles/threed/nixos.nix +++ b/profiles/threed/nixos.nix @@ -36,49 +36,47 @@ 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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; diff --git a/profiles/winters/nixos.nix b/profiles/winters/nixos.nix index a4c8508..47cd4de 100644 --- a/profiles/winters/nixos.nix +++ b/profiles/winters/nixos.nix @@ -53,49 +53,47 @@ stylix.image = ../../wallpaper/lenovowp.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; + 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"; }; - 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"; - }; + 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"; - }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + name = "FiraCode Nerd Font Mono"; + }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; }; diff --git a/programs/firefox/tridactyl/tridactylrc b/programs/firefox/tridactyl/tridactylrc index 31753a4..80c4222 100644 --- a/programs/firefox/tridactyl/tridactylrc +++ b/programs/firefox/tridactyl/tridactylrc @@ -44,6 +44,7 @@ seturl www.google.com followpagepatterns.prev Previous " Autocmds autocmd DocStart undefined mode ignore autocmd DocStart pokerogue.net mode ignore +autocmd DocStart typelit.io mode ignore " For syntax highlighting see https://github.com/tridactyl/vim-tridactyl " vim: set filetype=tridactyl