From 1f438e0e2e7d1706e9e9dc1e517528e8e90fbeb1 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 9 Sep 2024 18:49:26 +0000 Subject: added s15 --- hosts/base.nix | 1 + hosts/linux.nix | 12 ++--- hosts/local/s15/configuration.nix | 35 +++++++++++++ hosts/local/s15/default.nix | 4 ++ hosts/local/s15/framework.kbd | 101 ++++++++++++++++++++++++++++++++++++++ hosts/local/s15/keyboard.nix | 46 +++++++++++++++++ hosts/nixos.nix | 1 + hosts/pkgs.nix | 2 +- 8 files changed, 195 insertions(+), 7 deletions(-) create mode 100644 hosts/local/s15/configuration.nix create mode 100644 hosts/local/s15/default.nix create mode 100644 hosts/local/s15/framework.kbd create mode 100644 hosts/local/s15/keyboard.nix (limited to 'hosts') diff --git a/hosts/base.nix b/hosts/base.nix index 7bd0ed0..2ba2c05 100644 --- a/hosts/base.nix +++ b/hosts/base.nix @@ -13,6 +13,7 @@ settings = { keep-outputs = true; keep-derivations = true; + trusted-users = ["root" "y"]; }; }; diff --git a/hosts/linux.nix b/hosts/linux.nix index 7c9fec5..95049ff 100644 --- a/hosts/linux.nix +++ b/hosts/linux.nix @@ -35,10 +35,10 @@ }; ## Bluetooth - hardware.enableAllFirmware = true; - hardware.bluetooth.enable = true; - hardware.bluetooth.settings = {General = {Experimental = true;};}; - hardware.bluetooth.disabledPlugins = ["sap"]; - hardware.bluetooth.package = pkgs.bluez; - services.blueman.enable = true; +# hardware.enableAllFirmware = true; +# hardware.bluetooth.enable = true; +# hardware.bluetooth.settings = {General = {Experimental = true;};}; +# hardware.bluetooth.disabledPlugins = ["sap"]; +# hardware.bluetooth.package = pkgs.bluez; +# services.blueman.enable = true; } diff --git a/hosts/local/s15/configuration.nix b/hosts/local/s15/configuration.nix new file mode 100644 index 0000000..410033c --- /dev/null +++ b/hosts/local/s15/configuration.nix @@ -0,0 +1,35 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +# NixOS-WSL specific options are documented on the NixOS-WSL repository: +# https://github.com/nix-community/NixOS-WSL + +{ config, lib, pkgs, ... }: + +{ + wsl.enable = true; + wsl.defaultUser = "y"; + imports = [ + ../../base.nix + ../../users.nix + ../../pkgs.nix + ]; + environment.systemPackages = with pkgs;[ + busybox + git + lazygit + tmux + wget + helix + iptables + ]; + services.tailscale.enable = true; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/hosts/local/s15/default.nix b/hosts/local/s15/default.nix new file mode 100644 index 0000000..14c4dc5 --- /dev/null +++ b/hosts/local/s15/default.nix @@ -0,0 +1,4 @@ +inputs: [ + inputs.nixos-wsl.nixosModules.default + ./configuration.nix +] diff --git a/hosts/local/s15/framework.kbd b/hosts/local/s15/framework.kbd new file mode 100644 index 0000000..2594bf6 --- /dev/null +++ b/hosts/local/s15/framework.kbd @@ -0,0 +1,101 @@ +;; one liner comments ';;' +#| Multiline + comments |# + +(defcfg ;; For linux & by-id lists pluggable devices +;; If a key is not bound/left_empty(_) then it will fall back to the previous +;; layer's binding if not then default. +fallthrough true +;; To run system commands. You MIGHT face issues with tiling window managers due to command helpers. +;; allow-cmd true +;; use 'ls /dev/input/by-id/' for detachable keyboards and +;; 'ls /dev/input/by-path/' for builtin keyboards location' +input (device-file "/dev/input/event0") +;; Not sure what this does. Please check the docs. +output (uinput-sink "My KMonad output") +) + +;; This is the real representation of your actual keyboard. We haven't started +;; customizing layouts yet. +(defsrc + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft up + lctl lmet lalt spc ralt rctl left down right +) +;; Aliases + +(defalias +;; Layer toggles +sym (layer-toggle syms) +sym2 (layer-toggle syms2) +cords (sticky-key 1000 (layer-toggle mods)) +;; +hrt (layer-switch homerowmods) +back (layer-switch qwerty) + +;; Homerow keys +a (tap-hold-next-release 280 a lctl) +s (tap-hold-next-release 280 s lalt) +d (tap-hold-next-release 280 d lmet) +f (tap-hold-next-release 280 f lsft) +;; +j (tap-hold-next-release 280 j rsft) +k (tap-hold-next-release 280 k lmet) +l (tap-hold-next-release 280 l lalt) +semi (tap-hold-next-release 280 ; rctl) + +;; button to launch brave browser +;; veeb (cmd-button "brave") +;; ssf (sticky-key 500 (layer-toggle rshift)) +;; rsf (layer-toggle rshift) +) + +;; The first custom layer is the one that gets activated when kmonad is started +(deflayer qwerty ;; The default layer that'd be read when you launch kmonad + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc a s d f g h j k l ; ' ret + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc @cords @hrt left down right +) +(deflayer homerowmods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc @a @s @d @f g h @j @k @l @semi ' ret + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc lalt @back left down right +) +(deflayer mods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] h + esc lctl lalt lmet lsft g h rsft rmet ralt rctl ' ret + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc lalt @back left down right +) + +;; A layer dedicated to symbols +(deflayer syms + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ up _ _ ! @ # $ % _ _ _ + _ _ left down right @sym2 ' ^ & - = _ ret + _ _ _ _ _ _ \( [ { < \ _ _ + _ _ _ _ _ _ _ _ _ +) + + +;; More symbols +(deflayer syms2 + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ ` ~ * \_ + _ ret + _ _ _ _ _ _ \) ] } > | _ _ + _ _ _ _ _ _ _ _ _ +) diff --git a/hosts/local/s15/keyboard.nix b/hosts/local/s15/keyboard.nix new file mode 100644 index 0000000..88f8545 --- /dev/null +++ b/hosts/local/s15/keyboard.nix @@ -0,0 +1,46 @@ +{ + config, + lib, + pkgs, + ... +}: { + services.logind.extraConfig = '' + # don’t shutdown when power button is short-pressed + HandlePowerKey=ignore + ''; + + # config file keeps getting rewritten but I don't know by who + # i18n.inputMethod = { + # enabled = "fcitx5"; + # fcitx5.addons = with pkgs; [ + # fcitx5-mozc + # # mozc-ut is better, wat do + # fcitx5-gtk + # libsForQt5.fcitx5-qt + # fcitx5-lua + # fcitx5-configtool + # fcitx5-rime + # ]; + # }; + environment.variables = { + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + FCITX_SOCKET = "default"; + }; + + #kmonad + services.kmonad = lib.mkIf (pkgs.system == "x86_64-linux") { + enable = true; + + keyboards.internal = { + device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd"; + config = builtins.readFile ./framework.kbd; + + # defcfg = { + # enable = true; + # fallthrough = true; + # }; + }; + }; +} diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 4602318..96d8bf3 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -6,6 +6,7 @@ modules = import (./. + "/${path}") inputs; }; in { + s15 = mkNixosSystem "aarch64-linux" "local/s15"; fw11 = mkNixosSystem "x86_64-linux" "local/fw11"; master = mkNixosSystem "x64_64-linux" "local/master"; # vivo2025 = mkNixosSystem "x64_64-linux" "local/vivo2025"; diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix index 00ad3d9..b5b0b07 100644 --- a/hosts/pkgs.nix +++ b/hosts/pkgs.nix @@ -65,7 +65,7 @@ udiskie #crypto # electrum - yacreader + # yacreader nethogs ]; } -- cgit v1.2.3