diff options
author | polwex <polwex@sortug.com> | 2024-09-09 18:49:26 +0000 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2024-09-09 18:49:26 +0000 |
commit | 1f438e0e2e7d1706e9e9dc1e517528e8e90fbeb1 (patch) | |
tree | 94327c9dedd617b5734e77d4f16966504bffadd3 | |
parent | 323096673f11009d45e06c87ae8afc17b56136c1 (diff) |
added s15
-rw-r--r-- | flake.lock | 115 | ||||
-rw-r--r-- | flake.nix | 1 | ||||
-rw-r--r-- | hosts/base.nix | 1 | ||||
-rw-r--r-- | hosts/linux.nix | 12 | ||||
-rw-r--r-- | hosts/local/s15/configuration.nix | 35 | ||||
-rw-r--r-- | hosts/local/s15/default.nix | 4 | ||||
-rw-r--r-- | hosts/local/s15/framework.kbd | 101 | ||||
-rw-r--r-- | hosts/local/s15/keyboard.nix | 46 | ||||
-rw-r--r-- | hosts/nixos.nix | 1 | ||||
-rw-r--r-- | hosts/pkgs.nix | 2 |
10 files changed, 297 insertions, 21 deletions
@@ -213,6 +213,22 @@ } }, "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { "locked": { "lastModified": 1717312683, "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", @@ -227,7 +243,7 @@ "type": "github" } }, - "flake-compat_5": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1696426674, @@ -427,6 +443,24 @@ "type": "github" } }, + "flake-utils_7": { + "inputs": { + "systems": "systems_7" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": "flake-compat", @@ -634,7 +668,7 @@ }, "lib-aggregate": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs-lib": "nixpkgs-lib_3" }, "locked": { @@ -695,7 +729,7 @@ "inputs": { "flake-parts": "flake-parts_4", "nix-github-actions": "nix-github-actions", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_11", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -908,6 +942,27 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_9" + }, + "locked": { + "lastModified": 1725882169, + "narHash": "sha256-v5L+Dh6KdyycIgcdIc6SQ1fRNNvFJmYz02+fyeptA2o=", + "owner": "nix-community", + "repo": "NixOS-WSL", + "rev": "34b95b3962f5b3436d4bae5091d1b2ff7c1eb180", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "main", + "repo": "NixOS-WSL", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1719082008, @@ -1044,7 +1099,7 @@ }, "nixpkgs-wayland": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_5", "lib-aggregate": "lib-aggregate", "nix-eval-jobs": "nix-eval-jobs", "nixpkgs": [ @@ -1067,6 +1122,22 @@ }, "nixpkgs_10": { "locked": { + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { + "locked": { "lastModified": 1723221148, "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", "owner": "NixOS", @@ -1081,7 +1152,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1702151865, "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", @@ -1211,16 +1282,16 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1725634671, - "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", - "owner": "nixos", + "lastModified": 1725693463, + "narHash": "sha256-ZPzhebbWBOr0zRWW10FfqfbJlan3G96/h3uqhiFqmwg=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", + "rev": "68e7dce0a6532e876980764167ad158174402c6f", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } @@ -1335,7 +1406,8 @@ "nixos-hardware": "nixos-hardware", "nixos-mailserver": "nixos-mailserver", "nixos-rk3588": "nixos-rk3588", - "nixpkgs": "nixpkgs_9", + "nixos-wsl": "nixos-wsl", + "nixpkgs": "nixpkgs_10", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-stable": "nixpkgs-stable_3", "nixpkgs-wayland": "nixpkgs-wayland", @@ -1518,6 +1590,21 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -1567,7 +1654,7 @@ }, "waybar": { "inputs": { - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_6", "nixpkgs": [ "nixpkgs" ] @@ -1588,7 +1675,7 @@ }, "wrapper-manager": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1724503599, @@ -9,6 +9,7 @@ url = "github:lnl7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; #secure book lanzaboote.url = "github:nix-community/lanzaboote"; 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 ]; } |