helix fix and some useful zsh functions

This commit is contained in:
Rouven Seifert 2023-08-12 18:34:29 +02:00
parent 4964b6036b
commit 346d04e632
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
10 changed files with 206 additions and 37 deletions

View file

@ -1,9 +1,6 @@
name: Check name: Check
on: on:
push:
branches:
- main
pull_request: pull_request:
branches: branches:
- main - main

View file

@ -17,6 +17,36 @@
} }
}, },
"crane": { "crane": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [
"helix",
"nixpkgs"
],
"rust-overlay": [
"helix",
"rust-overlay"
]
},
"locked": {
"lastModified": 1688772518,
"narHash": "sha256-ol7gZxwvgLnxNSZwFTDJJ49xVY5teaSvF7lzlo3YQfM=",
"owner": "ipetkov",
"repo": "crane",
"rev": "8b08e96c9af8c6e3a2b69af5a7fa168750fcf88e",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"crane_2": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
"lanzaboote", "lanzaboote",
@ -103,6 +133,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -128,6 +174,24 @@
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1681202837, "lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
@ -164,6 +228,26 @@
"type": "github" "type": "github"
} }
}, },
"helix": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1691765042,
"narHash": "sha256-EeMn5KYej0NmCf3ghOjq2s8axjaKfqurak5FzScGTO0=",
"owner": "helix-editor",
"repo": "helix",
"rev": "ee3171cc54052bc8d3569cc04bd9f6a57b43afca",
"type": "github"
},
"original": {
"id": "helix",
"type": "indirect"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -171,11 +255,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1691506824, "lastModified": 1691853673,
"narHash": "sha256-Z2Ms7036CCEAfCmDBDy+sFauO6/7fx2UN3aoPCpp4tA=", "narHash": "sha256-GyiO0cIQjfcBHB6CfF0/36EjFNfCXtXtB12k6h2qPtg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7b8d43fbaf8450c30caaed5eab876897d0af891b", "rev": "255f921049df8d45fb5afa2529b79106edbd8301",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -221,15 +305,15 @@
}, },
"lanzaboote": { "lanzaboote": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane_2",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"pre-commit-hooks-nix": "pre-commit-hooks-nix", "pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1682802423, "lastModified": 1682802423,
@ -287,11 +371,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1691305349, "lastModified": 1691730710,
"narHash": "sha256-0Pig7jnmuRH3c5dOTVTOvTLwo2CRzYTyvJRQ82HWRSo=", "narHash": "sha256-q/UBet5RdX8CBjOIpI2Y8EB8DXYr9cb7WuNGTP9HKf8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "5426a95071d0b9782b3209b3995cde1f5689616e", "rev": "f61352cf8066ddd3dfe9058e62184bae7382672d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -301,17 +385,18 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1691472822, "lastModified": 1690272529,
"narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=", "narHash": "sha256-MakzcKXEdv/I4qJUtq/k/eG+rVmyOZLnYNC2w1mB59Y=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff", "rev": "ef99fa5c5ed624460217c31ac4271cfb5cb2502c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"type": "indirect" "repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
@ -347,11 +432,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1690066826, "lastModified": 1691280485,
"narHash": "sha256-6L2qb+Zc0BFkh72OS9uuX637gniOjzU6qCDBpjB2LGY=", "narHash": "sha256-/8Ct9092OC1TTNzHgbcE9ejQdS2QxZYGqrWXEwUxdtQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ce45b591975d070044ca24e3003c830d26fea1c8", "rev": "240472b7e47a641e9e7675f58b64d3626ca7824d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -361,6 +446,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1691654369,
"narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@ -415,19 +515,45 @@
"root": { "root": {
"inputs": { "inputs": {
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix-colors": "nix-colors", "nix-colors": "nix-colors",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"purge": "purge", "purge": "purge",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"trucksimulatorbot": "trucksimulatorbot" "trucksimulatorbot": "trucksimulatorbot"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": {
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1690424156,
"narHash": "sha256-Bpml+L280tHTQpwpC5/BJbU4HSvEzMvW8IZ4gAXimhE=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "f335a0213504c7e6481c359dc1009be9cf34432c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"lanzaboote", "lanzaboote",
@ -460,11 +586,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1690199016, "lastModified": 1691830846,
"narHash": "sha256-yTLL72q6aqGmzHq+C3rDp3rIjno7EJZkFLof6Ika7cE=", "narHash": "sha256-ffR5maL8R4gsoF43YZRSBVzB7qYxzG+Ssjjktg80Wy4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c36df4fe4bf4bb87759b1891cab21e7a05219500", "rev": "5f5d9a3c8bc247eb574823b9f16a79e054dafe73",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -487,6 +613,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"trucksimulatorbot": { "trucksimulatorbot": {
"inputs": { "inputs": {
"images": "images", "images": "images",

View file

@ -58,6 +58,7 @@
, lanzaboote , lanzaboote
, purge , purge
, trucksimulatorbot , trucksimulatorbot
, helix
, ... , ...
}@attrs: { }@attrs: {
packages.x86_64-linux = { packages.x86_64-linux = {
@ -100,7 +101,7 @@
}; };
nuc = nixpkgs.lib.nixosSystem { nuc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs.inputs = attrs; specialArgs = attrs;
modules = [ modules = [
nixos-hardware.nixosModules.intel-nuc-8i7beh nixos-hardware.nixosModules.intel-nuc-8i7beh
nix-index-database.nixosModules.nix-index nix-index-database.nixosModules.nix-index
@ -112,7 +113,7 @@
}; };
falkenstein-1 = nixpkgs.lib.nixosSystem { falkenstein-1 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs.inputs = attrs; specialArgs = attrs;
modules = [ modules = [
./hosts/falkenstein-1 ./hosts/falkenstein-1
./shared ./shared
@ -127,7 +128,7 @@
}; };
vm = nixpkgs.lib.nixosSystem { vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs.inputs = attrs; specialArgs = attrs;
modules = [ modules = [
./hosts/vm ./hosts/vm
./shared ./shared

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, helix, ... }:
{ {
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
imports = imports =
@ -38,7 +38,7 @@
vim vim
wget wget
htop-vim htop-vim
helix helix.packages.x86_64-linux.default
lsof lsof
python3 python3
]; ];

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, ... }: { config, pkgs, trucksimulatorbot, ... }:
let let
domain = "trucksimulatorbot.rfive.de"; domain = "trucksimulatorbot.rfive.de";
in in
@ -39,7 +39,7 @@ in
proxyPass = "http://127.0.0.1:${toString config.services.trucksimulatorbot.listenPort}"; proxyPass = "http://127.0.0.1:${toString config.services.trucksimulatorbot.listenPort}";
}; };
locations."/docs" = { locations."/docs" = {
root = "${inputs.trucksimulatorbot.packages.x86_64-linux.docs}"; root = "${trucksimulatorbot.packages.x86_64-linux.docs}";
}; };
}; };
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, helix, ... }:
{ {
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
imports = imports =
@ -58,7 +58,7 @@
vim vim
wget wget
htop-vim htop-vim
helix helix.packages.x86_64-linux.default
lsof lsof
btdu btdu
]; ];

View file

@ -38,10 +38,12 @@
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true; auto-optimise-store = true;
substituters = [ substituters = [
"https://helix.cachix.org"
"ssh://nuc.lan" "ssh://nuc.lan"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"nuc.lan:a9UkVw3AizAKCER1CfNGhx8UOMF4t4UGE3GJ9dmHwJc=" "nuc.lan:a9UkVw3AizAKCER1CfNGhx8UOMF4t4UGE3GJ9dmHwJc="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
]; ];
}; };
# distributedBuilds = true; # distributedBuilds = true;
@ -183,6 +185,13 @@
}; };
}; };
security.tpm2 = {
enable = true;
pkcs11.enable = true;
abrmd.enable = true;
tctiEnvironment.enable = true;
};
hardware.opengl.extraPackages = with pkgs; [ hardware.opengl.extraPackages = with pkgs; [
intel-compute-runtime intel-compute-runtime
intel-media-driver intel-media-driver
@ -192,6 +201,7 @@
# hardware utilities # hardware utilities
nvme-cli nvme-cli
intel-gpu-tools intel-gpu-tools
tpm2-tools
# system essentials # system essentials
wget wget

View file

@ -73,6 +73,19 @@
unlink $OUT_PATH unlink $OUT_PATH
} }
sysdiff() {
echo System package diff:
${config.nix.package}/bin/nix store diff-closures $(command ls -d /nix/var/nix/profiles/system-* | tail -2)
}
shell() {
for var in "$@"
do
PKGS=$PKGS\ nixpkgs/nixos-unstable#$var
done
eval ${pkgs.nix-output-monitor}/bin/nom shell $PKGS
}
''; '';
promptInit = promptInit =
'' ''

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, helix, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
gdb gdb
@ -24,12 +24,17 @@
]; ];
programs.helix = { programs.helix = {
enable = true; enable = true;
# pull helix from the flake to fix random coredumps
package = helix.packages.x86_64-linux.default;
languages = { languages = {
language-server.rnix-lsp = {
command = "rnix-lsp";
};
language = [ language = [
{ {
name = "nix"; name = "nix";
auto-format = true; auto-format = true;
language-server.command = "rnix-lsp"; language-servers = [ "rnix-lsp" ];
} }
]; ];
}; };

View file

@ -16,6 +16,7 @@
source = source =
pkgs.writeShellScript "river-init.sh" '' pkgs.writeShellScript "river-init.sh" ''
riverctl focus-follows-cursor always riverctl focus-follows-cursor always
riverctl set-cursor-warp on-focus-change
riverctl attach-mode bottom riverctl attach-mode bottom
riverctl spawn rivertile riverctl spawn rivertile
riverctl default-layout rivertile riverctl default-layout rivertile
@ -24,6 +25,7 @@
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad drag enabled riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad drag enabled
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad middle-emulation enabled riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad middle-emulation enabled
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad accel-profile adaptive
riverctl spawn "${pkgs.swaybg}/bin/swaybg -i ${../../../../images/wallpaper.png}" riverctl spawn "${pkgs.swaybg}/bin/swaybg -i ${../../../../images/wallpaper.png}"