Compare commits

...

14 commits

Author SHA1 Message Date
fcb5ee3581
temperance: remove nixpkgs.hostPlatform
This option does not exist anymore since I set nixpkgs' pkgs
value, which disables most options.

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a6964fb25569eef1b0ae547b724a36a71bc95
2025-07-21 00:26:21 +02:00
2b7a72a6d5
fla: use BuiltinsFetchTree
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69644d409983dc04ca29a43fd12b60e73ed0
2025-07-21 00:26:20 +02:00
28f2c699e7
hermit: drop newer-nil from programs
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69649fe97fcc35f81034e3c5d0464b26afbc
2025-07-21 00:26:19 +02:00
f967df7b1e
niri: conf: decrease zoom size
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69647a28f5754ee957567f85a8896f6707c0
2025-07-21 00:26:19 +02:00
5765bbc868
niri: switch to master package, move config file location
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696441d048ff2328d08338293b4a1be005e7
2025-07-21 00:26:18 +02:00
f4790c05ed
nix: switch to lix
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641a5c002234e971b698d9164999be08f3
2025-07-21 00:26:17 +02:00
6293930e1f
packages: add nushell packages to systemPackages
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696403f8a1a3f2c7cff8b73bf745376e6172
2025-07-21 00:26:16 +02:00
8c3ff343b0
nushell: move to modules/home
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a6964b332aee4de78ddbba4d16b55f6783485
2025-07-21 00:26:16 +02:00
71505a4629
helix: move to modules/home
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a6964949ee86c73c9dee2fc4a89c01a7a0579
2025-07-21 00:26:15 +02:00
917074fb32
ghostty: move to modules/home
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641141c64ef2be00b4e93eefeba26ae292
2025-07-21 00:26:14 +02:00
2d3d2ef1d7
hjem: init
Finally, a sane home management system.

Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696430c3a408520811d1b0b3038a66b0f73a
2025-07-21 00:26:13 +02:00
3a9e31cc88
nixpkgs: switch to read-only packages
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69641b8369b151024324d8d06f2acb790c15
2025-07-21 00:26:12 +02:00
d276dea712
changes
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696407aaf040f34e2ef257545f441b621c99
2025-07-21 00:26:12 +02:00
467155afc6
forgejo: update themes
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a69645a04ba54314c439162c2fb8946656a7f
2025-07-21 00:26:11 +02:00
32 changed files with 1232 additions and 1266 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/.direnv /.direnv
**/.qmlls.ini .qmlls.ini

View file

@ -1,5 +1,5 @@
let let
inherit (builtins) currentSystem filter mapAttrs; inherit (builtins) filter mapAttrs;
# https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers # https://github.com/andir/npins?tab=readme-ov-file#using-the-nixpkgs-fetchers
src = import ./npins; src = import ./npins;
@ -20,10 +20,7 @@ let
modules = [ modules = [
# This is used to pre-emptively set the hostPlatform for nixpkgs. # This is used to pre-emptively set the hostPlatform for nixpkgs.
# Also, we set the system hostname here. # Also, we set the system hostname here.
{ { networking.hostName = hostname; }
networking.hostName = hostname;
nixpkgs.hostPlatform = system;
}
./hosts/common.nix ./hosts/common.nix
./hosts/${hostname} ./hosts/${hostname}
] ]

7
flake.lock generated
View file

@ -1,7 +0,0 @@
{
"nodes": {
"root": {}
},
"root": "root",
"version": 7
}

View file

@ -7,7 +7,12 @@
_: _:
let let
sources = import ./npins; sources = import ./npins;
nixpkgs = (import sources.flake-compat { src = sources.nixpkgs; }).outputs; nixpkgs =
(import sources.flake-compat {
src = sources.nixpkgs;
copySourceTreeToStore = false;
useBuiltinsFetchTree = true;
}).outputs;
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
pkgsFor = nixpkgs.legacyPackages; pkgsFor = nixpkgs.legacyPackages;
inputs = sources; inputs = sources;
@ -21,9 +26,7 @@
inherit inputs pkgs sources; inherit inputs pkgs sources;
}) })
fish fish
helix
kakoune kakoune
nushell
; ;
}) pkgsFor; }) pkgsFor;
devShells = lib.mapAttrs (_: pkgs: { devShells = lib.mapAttrs (_: pkgs: {

View file

@ -4,16 +4,11 @@
# which should have a small attack surface. # which should have a small attack surface.
{ {
lib, lib,
self,
pkgs, pkgs,
sources,
... ...
}: }:
let let
inherit (lib.meta) hiPrioSet; inherit (lib.meta) hiPrioSet;
helix = pkgs.callPackage (self + "/packages/helix") { inherit sources; };
fish = pkgs.callPackage (self + "/packages/fish") { inherit sources; };
in in
{ {
environment.systemPackages = environment.systemPackages =
@ -46,12 +41,10 @@ in
zip zip
zoxide zoxide
; ;
inherit fish;
} }
++ builtins.attrValues (hiPrioSet { ++ builtins.attrValues (hiPrioSet {
inherit helix; })
inherit (pkgs) uutils-coreutils-noprefix; ++ [ (lib.hiPrio pkgs.uutils-coreutils-noprefix) ];
});
# helix as the only editor, a reasonable choice. # helix as the only editor, a reasonable choice.
environment.variables.EDITOR = "hx"; environment.variables.EDITOR = "hx";
} }

View file

@ -1,24 +1,4 @@
{ pkgs, ... }: { pkgs, ... }:
let
# a newer nil version, for pipes support.
new-nil = pkgs.nil.overrideAttrs (_: {
version = "unstable-18-07-2025";
src = pkgs.fetchFromGitHub {
owner = "oxalica";
repo = "nil";
rev = "524ae2d67dd84d99a10f409ed6cd8e4e7b3cae3f";
hash = "sha256-Uy2qzd+fMoBcp4NPSO7DavEC1pGMegmAqoEMvmXbIQU=";
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (new-nil) src;
hash = "sha256-Sljr3ff8hl/qm/0wqc1GXsEr1wWn7NAXmdrd5wHzUX8=";
};
});
in
{ {
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)

View file

@ -27,6 +27,5 @@
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -0,0 +1,492 @@
{
lib,
pkgs,
sources,
...
}:
let
inherit (lib.attrsets) mapAttrs' nameValuePair;
helix = pkgs.helix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "25.07.2";
src = pkgs.fetchzip {
url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
hash = "sha256-ZNsQwFfPXe6oewajx1tl68W60kVo7q2SuvTgy/o1HKk=";
stripRoot = false;
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (helix) src;
hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg=";
};
}
);
helix-with-plugins = pkgs.helix.overrideAttrs (
finalAttrs: previousAttrs: {
name = "helix-with-plugins";
version = "25.07.2";
src = pkgs.fetchzip {
url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
hash = "sha256-ZNsQwFfPXe6oewajx1tl68W60kVo7q2SuvTgy/o1HKk=";
stripRoot = false;
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (helix) src;
hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg=";
};
postInstall = ''
mv $out/bin/hx $out/bin/hxp
'';
}
);
toml = pkgs.formats.toml { };
languages =
let
inherit (lib.meta) getExe getExe';
nixfmt = pkgs.callPackage "${sources.nixfmt}/default.nix" { };
nil = pkgs.rustPlatform.buildRustPackage {
pname = "nil";
version = "unstable";
src = sources.nil;
cargoLock = {
lockFile = "${sources.nil}/Cargo.lock";
allowBuiltinFetchGit = false;
};
nativeBuildInputs = [ pkgs.nixVersions.latest ];
doInstallCheck = false;
meta.mainProgram = "nil";
};
new-deadnix = pkgs.deadnix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "unstable-15-07-2025";
src = pkgs.fetchFromGitHub {
owner = "astro";
repo = "deadnix";
rev = "d75457b95d7cfa82fcd60970939f76fccfce19e5";
hash = "sha256-O/z2neAXL8JNkGosvxC+DyZnnJ8zYP9XHApxHVmlzfY=";
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (new-deadnix) src;
hash = "sha256-O8yhqyPflOvQXAA19k1XpbrHysgV5VNWLBX0l5Q5GkM=";
};
meta.mainProgram = "nil";
}
);
in
{
language =
let
mark = lang: {
command = getExe pkgs.deno;
args = [
"fmt"
"-"
"--ext"
lang
];
};
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = getExe pkgs.shfmt;
args = [
"-i"
"2"
];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
}
{
name = "cmake";
auto-format = true;
language-servers = [ "cmake-language-server" ];
formatter = {
command = getExe pkgs.cmake-format;
args = [ "-" ];
};
}
{
name = "javascript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "json";
formatter = mark "json";
}
{
name = "markdown";
auto-format = true;
formatter = mark "md";
language-servers = [ "taplo" ];
}
{
name = "nix";
language-servers = [ "nil" ];
}
{
name = "qml";
language-servers = [ "qmlls" ];
}
{
name = "python";
auto-format = true;
language-servers = [
"basedpyright"
"ruff"
];
}
{
name = "typescript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "rust";
}
{
name = "c";
auto-format = true;
language-servers = [ "clangd" ];
}
{
name = "zig";
auto-format = true;
}
{
name = "c";
}
];
language-server = {
bash-language-server = {
command = getExe pkgs.bash-language-server;
args = [ "start" ];
};
rust-analyzer = {
command = getExe pkgs.rust-analyzer;
config.rust-analyzer = {
checkOnSave.command = "clippy";
procMacro.enable = true;
cargo = {
loadOutDirsFromCheck = true;
features = "all";
};
assist = {
preferSelf = true;
};
check = {
command = "clippy";
extraArgs = [
"--"
"-W"
"clippy::pedantic"
"-W"
"clippy::nursery"
"-W"
"clippy::perf"
];
};
lens = {
references = true;
methodReferences = true;
};
completion.autoimport.enable = true;
experimental.procAttrMacros = true;
interpret.tests = true;
};
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = [ "-std=c++2b" ];
};
cmake-language-server = {
command = getExe pkgs.cmake-language-server;
};
deno-lsp = {
command = getExe pkgs.deno;
args = [ "lsp" ];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
lint = true;
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {
hosts."https://deno.land" = true;
};
};
inlayHints = {
enumMemberValues.enabled = true;
functionLikeReturnTypes.enabled = true;
parameterNames.enabled = "all";
parameterTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
variableTypes.enabled = true;
};
};
};
dprint = {
command = getExe pkgs.dprint;
args = [ "lsp" ];
};
nil = {
command = getExe nil;
config.nil = {
formatting.command = [ "${getExe nixfmt}" ];
diagnostics = {
bindingEndHintMinLines = 3;
};
nix.flake = {
autoArchive = true;
# autoEvalInputs = true;
nixpkgsInputName = "nixpkgs";
};
};
};
deadnix = {
command = getExe new-deadnix;
};
typescript-language-server = {
command = getExe pkgs.typescript-language-server;
args = [ "--stdio" ];
config = {
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
};
};
ruff = {
command = getExe pkgs.ruff;
args = [ "server" ];
};
qmlls = {
command = getExe' pkgs.kdePackages.qtdeclarative "qmlls";
args = [ "-E" ];
};
basedpyright.command = "${pkgs.basedpyright}/bin/basedpyright-langserver";
vscode-css-language-server = {
command = "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server";
args = [ "--stdio" ];
config = {
provideFormatter = true;
css.validate.enable = true;
scss.validate.enable = true;
};
};
zls = {
command = getExe pkgs.zls;
config = {
enable_build_on_save = true;
build_on_save_args = [
"check"
"-fincremental"
"--watch"
];
enable_autofix = false;
warn_style = true;
highlight_global_var_declarations = true;
};
};
};
};
themes = {
rose_pine_transparent = {
inherits = "rose_pine";
"ui.background" = { };
};
rose_pine_dawn_transparent = {
inherits = "rose_pine_dawn";
"ui.background" = { };
};
nightfox_transparent = {
inherits = "nightfox";
"ui.background" = { };
};
nord_transparent = {
inherits = "nord";
"ui.background" = { };
};
};
settings = {
theme = "nord";
editor = {
cursorline = true;
color-modes = true;
true-color = true;
indent-guides.render = true;
lsp = {
enable = true;
auto-signature-help = true;
display-inlay-hints = false;
display-messages = true;
snippets = true;
};
file-picker = {
hidden = true;
};
line-number = "relative";
auto-format = true;
completion-timeout = 5;
mouse = true;
bufferline = "multiple";
soft-wrap.enable = true;
word-completion = {
enable = true;
trigger-length = 2;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = [
"spinner"
"version-control"
"diagnostics"
"file-name"
];
right = [
"file-base-name"
"file-type"
"position"
"file-encoding"
];
};
gutters.layout = [
"diff"
"diagnostics"
"line-numbers"
"spacer"
];
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
};
keys = {
normal = {
space = {
g = [
":new"
":buffer-close!"
":redraw"
];
i = ":toggle lsp.display-inlay-hints";
};
esc = [
"collapse_selection"
"keep_primary_selection"
"normal_mode"
];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
A-f = ":format";
A-r = ":reload";
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
";" = "flip_selections";
"A-;" = "collapse_selection";
# Kakoune-like config
H = "extend_char_left";
J = "extend_line_down";
K = "extend_line_up";
L = "extend_char_right";
};
select = {
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
g = {
e = "goto_file_end";
};
};
};
};
in
{
packages = builtins.attrValues {
inherit helix;
inherit (pkgs)
tinymist
taplo
kdlfmt
gopls
;
};
files = {
".config/helix/config.toml".source = toml.generate "helix-config.toml" settings;
".config/helix/languages.toml".source = toml.generate "helix-languages.toml" languages;
}
// mapAttrs' (
name: value:
nameValuePair ".config/helix/themes/${name}.toml" {
source = toml.generate "helix-theme-${name}.toml" value;
}
) themes;
}

36
modules/home/hjem.mod.nix Normal file
View file

@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
sources,
...
}:
let
inherit (builtins) filter;
inherit (config.meta.mainUser) username;
inherit (lib.modules) mkForce;
inherit (lib.filesystem) listFilesRecursive;
inherit (lib.strings) hasSuffix;
in
{
imports = [ (sources.hjem + "/modules/nixos") ];
config = {
hjem = {
clobberByDefault = true;
linker = pkgs.smfh;
users.${username} = {
enable = true;
user = username;
directory = config.users.users.${username}.home;
clobberFiles = mkForce true;
};
extraModules = ((listFilesRecursive ./.) |> filter (hasSuffix ".hjem.nix"));
specialArgs = {
inherit sources;
};
};
};
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,300 @@
#! /usr/bin/env nu
$env.config = {
bracketed_paste: true
buffer_editor: "hx"
datetime_format: {}
edit_mode: vi
error_style: fancy
float_precision: 2
footer_mode: 25
render_right_prompt_on_last_line: false
show_banner: false
use_ansi_coloring: true
use_kitty_protocol: true
shell_integration: {
osc2: false
osc7: true
osc8: true
osc9_9: false
osc133: true
osc633: true
reset_application_mode: true
}
}
$env.config.color_config = {
binary: '#b48ead'
block: '#81a1c1'
cell-path: '#e5e9f0'
closure: '#88c0d0'
custom: '#8fbcbb'
duration: '#ebcb8b'
float: '#bf616a'
glob: '#8fbcbb'
int: '#b48ead'
list: '#88c0d0'
nothing: '#bf616a'
range: '#ebcb8b'
record: '#88c0d0'
string: '#a3be8c'
bool: {|| if $in { '#88c0d0' } else { '#ebcb8b' } }
datetime: {|| (date now) - $in |
if $in < 1hr {
{ fg: '#bf616a' attr: 'b' }
} else if $in < 6hr {
'#bf616a'
} else if $in < 1day {
'#ebcb8b'
} else if $in < 3day {
'#a3be8c'
} else if $in < 1wk {
{ fg: '#a3be8c' attr: 'b' }
} else if $in < 6wk {
'#88c0d0'
} else if $in < 52wk {
'#81a1c1'
} else { 'dark_gray' }
}
filesize: {|e|
if $e == 0b {
'#e5e9f0'
} else if $e < 1mb {
'#88c0d0'
} else {{ fg: '#81a1c1' }}
}
shape_and: { fg: '#b48ead' attr: 'b' }
shape_binary: { fg: '#b48ead' attr: 'b' }
shape_block: { fg: '#81a1c1' attr: 'b' }
shape_bool: '#88c0d0'
shape_closure: { fg: '#88c0d0' attr: 'b' }
shape_custom: '#a3be8c'
shape_datetime: { fg: '#88c0d0' attr: 'b' }
shape_directory: '#88c0d0'
shape_external: '#88c0d0'
shape_external_resolved: '#88c0d0'
shape_externalarg: { fg: '#a3be8c' attr: 'b' }
shape_filepath: '#88c0d0'
shape_flag: { fg: '#81a1c1' attr: 'b' }
shape_float: { fg: '#bf616a' attr: 'b' }
shape_garbage: { fg: '#FFFFFF' bg: '#FF0000' attr: 'b' }
shape_glob_interpolation: { fg: '#88c0d0' attr: 'b' }
shape_globpattern: { fg: '#88c0d0' attr: 'b' }
shape_int: { fg: '#b48ead' attr: 'b' }
shape_internalcall: { fg: '#88c0d0' attr: 'b' }
shape_keyword: { fg: '#b48ead' attr: 'b' }
shape_list: { fg: '#88c0d0' attr: 'b' }
shape_literal: '#81a1c1'
shape_match_pattern: '#a3be8c'
shape_matching_brackets: { attr: 'u' }
shape_nothing: '#bf616a'
shape_operator: '#ebcb8b'
shape_or: { fg: '#b48ead' attr: 'b' }
shape_pipe: { fg: '#b48ead' attr: 'b' }
shape_range: { fg: '#ebcb8b' attr: 'b' }
shape_raw_string: { fg: '#8fbcbb' attr: 'b' }
shape_record: { fg: '#88c0d0' attr: 'b' }
shape_redirection: { fg: '#b48ead' attr: 'b' }
shape_signature: { fg: '#a3be8c' attr: 'b' }
shape_string: '#a3be8c'
shape_string_interpolation: { fg: '#88c0d0' attr: 'b' }
shape_table: { fg: '#81a1c1' attr: 'b' }
shape_vardecl: { fg: '#81a1c1' attr: 'u' }
shape_variable: '#b48ead'
foreground: '#e5e9f0'
background: '#2e3440'
cursor: '#e5e9f0'
empty: '#81a1c1'
header: { fg: '#a3be8c' attr: 'b' }
hints: '#4c566a'
leading_trailing_space_bg: { attr: 'n' }
row_index: { fg: '#a3be8c' attr: 'b' }
search_result: { fg: '#bf616a' bg: '#e5e9f0' }
separator: '#e5e9f0'
}
$env.config.ls = {
clickable_links: true
use_ls_colors: true
}
$env.config.rm.always_trash = true
$env.config.table = {
header_on_separator: true
footer_inheritance: true
index_mode: always
mode: compact
missing_value_symbol: kek
padding: {left: 1 right: 1}
show_empty: false
trim: {
methodology: wrapping
truncating_suffix: "..."
wrapping_try_keep_words: true
}
}
$env.config.explore = {
command_bar_text: {fg: "#C4C9C6"}
highlight: {fg: black bg: yellow}
status: {
error: {fg: white bg: red}
warn: {}
info: {}
}
status_bar_background: {fg: "#1D1F21" bg: "#C4C9C6"}
table: {
split_line: {fg: "#404040"}
selected_cell: {bg: light_blue}
selected_row: {}
selected_column: {}
}
}
$env.config.history = {
file_format: sqlite
isolation: false
max_size: 100_000
sync_on_enter: true
}
$env.config.cursor_shape = {
vi_insert: line
vi_normal: block
}
$env.config.hooks = {
command_not_found: {|| }
pre_execution: [
{
let prompt = commandline | str trim
if ($prompt | is-empty) {
return
}
print $"(ansi title)($prompt) — nu(char bel)"
}
]
env_change: {
PWD: [
{||
if not ($env.PWD | path join .envrc | path exists) {
return
}
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
$env.PATH = $env.PATH | split row (char env_sep)
}
]
}
}
let menus = [
{
name: completion_menu
only_buffer_difference: false
marker: $"(ansi yellow)╋ "
type: {
layout: ide
min_completion_width: 0
max_completion_width: 150
max_completion_height: 25
padding: 0
border: false
cursor_offset: 0
description_mode: "prefer_right"
min_description_width: 0
max_description_width: 50
max_description_height: 10
description_offset: 1
correct_cursor_pos: true
}
style: {
text: white
selected_text: white_reverse
description_text: yellow
match_text: { attr: u }
selected_match_text: { attr: ur }
}
}
{
name: history_menu
only_buffer_difference: true
marker: $env.PROMPT_INDICATOR
type: {
layout: list
page_size: 10
}
style: {
text: white
selected_text: white_reverse
}
}
]
$env.config.menus = $env.config.menus
| where name not-in ($menus | get name)
| append $menus
$env.config.keybindings ++= [
{
name: copy_commandline
modifier: alt
keycode: char_c
mode: [vi_normal vi_insert]
event: {
send: executehostcommand
cmd: 'commandline | nu-highlight | $"```ansi\n($in)\n```" | wl-copy $in'
}
}
]
let env_vars_file = '/tmp/nushell-env-vars'
if not ($env_vars_file | path exists) {
open /etc/profile
| lines
| select 11
| str trim
| split column ' ' del path
| get path.0
| open $in
| str trim
| lines
| parse 'export {name}="{value}"'
| transpose --header-row --as-record
| tee { load-env $in }
| to nuon
| save --force $env_vars_file
} else {
open $env_vars_file
| from nuon
| load-env $in
}
def switch [] {
nh os switch --file ($env.NH_FLAKE | path join default.nix) (open /etc/hostname | str trim)
}
# fix sudo by prepending /run/wrappers/bin to the PATH.
$env.PATH = ($env.PATH | split row (char esep) | prepend '/run/wrappers/bin')
$env.PATH = ($env.PATH | split row (char esep) | prepend '/etc/profiles/per-user/cr/bin')
carapace _carapace nushell
| save -f ($nu.user-autoload-dirs | path join carapace.nu)
source ./prompt.nu
source ./zoxide.nu

View file

@ -0,0 +1,22 @@
{
pkgs,
...
}:
{
packages = with pkgs; [
nushell
inshellisense
carapace
];
environment.sessionVariables = {
CARAPACE_BRIDGES = "inshellisense,carapace,clap,bash";
CARAPACE_MATCH = 1;
};
files = {
".config/nushell/config.nu".source = ./config.nu;
".config/nushell/prompt.nu".source = ./prompt.nu;
".config/nushell/zoxide.nu".source = ./zoxide.nu;
};
}

View file

@ -0,0 +1,54 @@
# Initialize hook to add new entries to the database.
export-env {
$env.config = (
$env.config?
| default {}
| upsert hooks { default {} }
| upsert hooks.env_change { default {} }
| upsert hooks.env_change.PWD { default [] }
)
let __zoxide_hooked = (
$env.config.hooks.env_change.PWD | any { try { get __zoxide_hook } catch { false } }
)
if not $__zoxide_hooked {
$env.config.hooks.env_change.PWD = ($env.config.hooks.env_change.PWD | append {
__zoxide_hook: true,
code: {|_, dir| zoxide add -- $dir}
})
}
}
def zoxide_completions [context: string] {
let parts = $context | split row " " | skip 1
{
options: {
sort: false,
completion_algorithm: substring,
case_sensitive: false,
},
completions: (^zoxide query --list --exclude $env.PWD -- ...$parts | lines | first 10)
}
}
# Jump to a directory using only keywords.
def --env --wrapped __zoxide_z [...rest: string@zoxide_completions] {
let path = match $rest {
[] => {'~'},
[ '-' ] => {'-'},
[ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg}
_ => {
zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n"
}
}
cd $path
}
# Jump to a directory using interactive search.
def --env --wrapped __zoxide_zi [...rest:string] {
cd $'(zoxide query --interactive -- ...$rest | str trim -r -c "\n")'
}
# =============================================================================
alias z = __zoxide_z
alias zi = __zoxide_zi

View file

@ -1,6 +1,6 @@
{ {
config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: }:
@ -10,8 +10,7 @@ let
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep; inherit (lib.strings) concatStringsSep;
inherit (config.meta.mainUser.defaultShell) name package; inherit (osConfig.meta.mainUser.defaultShell) name package;
inherit (config.modules.style.colorScheme) slug;
# Shell integration for ghostty only supports # Shell integration for ghostty only supports
# bash, fish and zsh for now. # bash, fish and zsh for now.
@ -30,11 +29,9 @@ let
ghostty-settings = { ghostty-settings = {
font-size = 14; font-size = 14;
font-family = "JetBrainsMonoNerdFont"; font-family = "JetBrainsMonoNerdFont";
# font-style-bold = JetBrainsMono NF Regular;
# font-style-bold-italic = JetBrainsMono NF Italic;
app-notifications = "no-clipboard-copy"; app-notifications = "no-clipboard-copy";
background-opacity = 0.9; background-opacity = 0.7;
bold-is-bright = "true"; bold-is-bright = "true";
confirm-close-surface = "false"; confirm-close-surface = "false";
cursor-style-blink = "false"; cursor-style-blink = "false";
@ -45,7 +42,7 @@ let
resize-overlay-duration = "0s"; resize-overlay-duration = "0s";
shell-integration-features = "cursor,sudo,no-title"; shell-integration-features = "cursor,sudo,no-title";
term = "xterm-256color"; term = "xterm-256color";
theme = slug; theme = "nightfox";
window-decoration = "none"; window-decoration = "none";
window-padding-balance = true; window-padding-balance = true;
window-padding-x = 8; window-padding-x = 8;
@ -60,23 +57,13 @@ let
command = getExe package; command = getExe package;
}; };
settingsFile =
pkgs.writeText "config"
<| concatStringsSep "\n"
<| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings;
ghostty-wrapped = pkgs.symlinkJoin {
name = "ghostty-wrapped";
paths = [ pkgs.ghostty ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/ghostty --add-flags "--config-file=${settingsFile}"
'';
};
in in
{ {
environment.systemPackages = builtins.attrValues { packages = builtins.attrValues {
inherit ghostty-wrapped; inherit (pkgs) ghostty;
}; };
files.".config/ghostty/config".text =
concatStringsSep "\n"
<| mapAttrsToList (name: value: "${name} = ${toString value}") ghostty-settings;
} }

View file

@ -2,7 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
self, sources,
... ...
}: }:
let let
@ -10,10 +10,9 @@ let
inherit (lib.options) mkOption; inherit (lib.options) mkOption;
inherit (lib.types) listOf str package; inherit (lib.types) listOf str package;
inherit (config.meta.mainUser) username; inherit (config.meta.mainUser) username;
nushell = pkgs.callPackage (self + "/packages/nushell") { };
in in
{ {
imports = [ (sources.hjem + "/modules/nixos") ];
options.meta = { options.meta = {
users = mkOption { users = mkOption {
type = listOf str; type = listOf str;
@ -52,7 +51,7 @@ in
}; };
package = mkOption { package = mkOption {
type = package; type = package;
default = nushell; default = pkgs.nushell;
}; };
}; };
}; };
@ -72,7 +71,7 @@ in
"nix" "nix"
"docker" "docker"
]; ];
shell = nushell; shell = pkgs.nushell;
}; };
}; };
}; };

View file

@ -7,7 +7,71 @@ let
nixfmt = pkgs.callPackage "${sources.nixfmt}/default.nix" { }; nixfmt = pkgs.callPackage "${sources.nixfmt}/default.nix" { };
in in
{ {
environment.systemPackages = [ environment.systemPackages =
nixfmt with pkgs;
]; [
emacs-pgtk
# better cd
zoxide
# pipe viewer
pv
# hex editor
bvi
#better ls
eza
atuin
# better cat
bat
# clipboard
# yazi
serpl
diff-so-fancy
tig
direnv
sesh
mprocs
curlie
entr
procs
sd
# mult
glow
# dua-cli
dust
kondo
# better grep
ripgrep
# IP stuff
dig
# simply the best fetch tool out there
microfetch
fzf
element
difftastic
hexyl
yazi
gnumake
asciinema
inetutils
tokei
starship
wget
cpufetch
watchman
# yt-dlp # borked check phase
tealdeer
hyperfine
imagemagick
ffmpeg-full
# catimg
timg
nmap
fd
jq
rsync
figlet
unzip
zip
]
++ [ nixfmt ];
} }

View file

@ -123,15 +123,15 @@ in
Disallow: / Disallow: /
''; '';
base-brand = fetchurl { base-brand = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/base-brand.css"; url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/src/branch/codeberg-11/web_src/css/themes/codeberg/base-brand.css";
hash = "sha256-QJ775HpINf8klO3d/8h+tEw0vk34p19dWUCWWuVwcho="; hash = "sha256-rYZolA7maYEjzfx7mKJtEfyK62kfpGxvQ1eaC9qlZNw=";
}; };
dark-variables = fetchurl { dark-variables = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/codeberg/dark-variables.css"; url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-11/web_src/css/themes/codeberg/dark-variables.css";
hash = "sha256-nCSJUOU9/R1fldoKXTTZmP7vmRjYUk/OKkbgrJ/NrXQ="; hash = "sha256-nCSJUOU9/R1fldoKXTTZmP7vmRjYUk/OKkbgrJ/NrXQ=";
}; };
theme-codeberg-dark = fetchurl { theme-codeberg-dark = fetchurl {
url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-10/web_src/css/themes/theme-codeberg-dark.css"; url = "https://codeberg.org/Codeberg-Infrastructure/forgejo/raw/branch/codeberg-11/web_src/css/themes/theme-codeberg-dark.css";
hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs="; hash = "sha256-KyXznH49koRGlzIDDqagN4PvFGD/zCX//wrctmtfgBs=";
}; };
in in

View file

@ -1 +0,0 @@
/run/user/1000/quickshell/vfs/4f7a8066a49ba487f5b2754750896151/.qmlls.ini

View file

@ -0,0 +1 @@
/run/user/1000/quickshell/vfs/4f7a8066a49ba487f5b2754750896151/.qmlls.ini

View file

@ -1,70 +0,0 @@
{
config,
lib,
pkgs,
sources,
...
}:
let
determinate = (import sources.flake-compat { src = sources.determinate; }).outputs;
dix =
(import sources.flake-compat { src = determinate.inputs.nix; })
.outputs.packages.${pkgs.stdenv.system}.nix;
# Stronger than mkDefault (1000), weaker than mkForce (50) and the "default override priority"
# (100).
mkPreferable = lib.mkOverride 750;
# Stronger than the "default override priority", as the upstream module uses that, and weaker than mkForce (50).
mkMorePreferable = lib.mkOverride 75;
in
{
config = {
nix = {
package = dix;
};
environment.systemPackages = [
determinate.packages.${pkgs.stdenv.system}.default
];
# NOTE(cole-h): Move the generated nix.conf to /etc/nix/nix.custom.conf, which is included from
# the Determinate Nixd-managed /etc/nix/nix.conf.
environment.etc."nix/nix.conf".target = "nix/nix.custom.conf";
systemd = {
services.nix-daemon.serviceConfig = {
ExecStart = [
""
"@${
determinate.packages.${pkgs.stdenv.system}.default
}/bin/determinate-nixd determinate-nixd --nix-bin ${config.nix.package}/bin daemon"
];
KillMode = mkPreferable "process";
LimitNOFILE = mkMorePreferable 1048576;
LimitSTACK = mkPreferable "64M";
TasksMax = mkPreferable 1048576;
};
sockets = {
nix-daemon.socketConfig.FileDescriptorName = "nix-daemon.socket";
determinate-nixd = {
description = "Determinate Nixd Daemon Socket";
wantedBy = [ "sockets.target" ];
before = [ "multi-user.target" ];
unitConfig = {
RequiresMountsFor = [
"/nix/store"
"/nix/var/determinate"
];
};
socketConfig = {
Service = "nix-daemon.service";
FileDescriptorName = "determinate-nixd.socket";
ListenStream = "/nix/var/determinate/determinate-nixd.socket";
DirectoryMode = "0755";
};
};
};
};
};
}

View file

@ -1,17 +1,20 @@
# credits to raf # credits to raf
{ {
config,
sources, sources,
lib, lib,
pkgs, pkgs,
... ...
}: }:
let let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.modules) mkForce; inherit (lib.modules) mkForce;
lix = pkgs.callPackage "${sources.lix}/package.nix" {
stdenv = pkgs.clangStdenv;
};
in in
{ {
nix = { nix = {
package = lix;
# Check that Nix can parse the generated nix.conf. # Check that Nix can parse the generated nix.conf.
checkConfig = true; checkConfig = true;
@ -26,10 +29,14 @@ in
# registry = # registry =
# lib.mapAttrs (_: v: {flake = v.outPath;}) sources # lib.mapAttrs (_: v: {flake = v.outPath;}) sources
# // {system.flake = sources.nichts;}; # // {system.flake = sources.nichts;};
registry.nixpkgs.to = {
type = "path";
source = sources.nixpkgs;
};
# Add inputs to the system's legacy channels # Add inputs to the system's legacy channels
# to make legacy nix commands consistent as well # to make legacy nix commands consistent as well
nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; nixPath = [ "nixpkgs=/etc/nixos/nixpkgs" ];
# Run the Nix daemon on lowest possible priority # Run the Nix daemon on lowest possible priority
daemonCPUSchedPolicy = "idle"; daemonCPUSchedPolicy = "idle";
@ -116,7 +123,7 @@ in
"flakes" # flakes "flakes" # flakes
"nix-command" # experimental nix commands "nix-command" # experimental nix commands
"cgroups" # allow nix to execute builds inside cgroups "cgroups" # allow nix to execute builds inside cgroups
"pipe-operators" "pipe-operator"
]; ];
# Ensures that the result of Nix expressions is fully determined by # Ensures that the result of Nix expressions is fully determined by
@ -168,6 +175,9 @@ in
}; };
}; };
environment.etc = {
"nixos/nixpkgs".source = builtins.storePath sources.nixpkgs;
};
systemd.services = { systemd.services = {
# WE DONT WANT TO BUILD STUFF ON TMPFS # WE DONT WANT TO BUILD STUFF ON TMPFS
# ITS NOT A GOOD IDEA # ITS NOT A GOOD IDEA

View file

@ -1,18 +1,32 @@
# taken from raf
{ sources, ... }:
{ {
# Global nixpkgs configuration. lib,
# This is ignored if nixpkgs.pkgs is set, which should be avoided. sources,
nixpkgs = { pkgs,
flake = { ...
source = sources.nixpkgs; }:
setFlakeRegistry = true; let
setNixPath = true; inherit (lib.options) mkOption;
inherit (lib.types) str;
in
{
imports = [
# Going full schizo
"${sources.nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix"
];
options.nixpkgs.system = mkOption {
type = str;
default = pkgs.system;
readOnly = true;
}; };
config.nixpkgs.pkgs = (
import sources.nixpkgs {
hostPlatform = pkgs.stdenv.hostPlatform;
overlays = [ ];
config = {
# Configuration reference: # Configuration reference:
# <https://nixos.org/manual/nixpkgs/unstable/#chap-packageconfig> # <https://nixos.org/manual/nixpkgs/unstable/#chap-packageconfig>
config = {
# Disallow broken packages to be built. # Disallow broken packages to be built.
allowBroken = false; allowBroken = false;
@ -43,5 +57,6 @@
# See: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/check-meta.nix> # See: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/check-meta.nix>
showDerivationWarnings = [ ]; showDerivationWarnings = [ ];
}; };
}; }
);
} }

View file

@ -85,7 +85,7 @@ switch-events {
} }
} }
overview { overview {
zoom 0.65 zoom 0.60
backdrop-color "#777777" backdrop-color "#777777"
} }
animations { animations {

View file

@ -2,32 +2,100 @@
config, config,
lib, lib,
pkgs, pkgs,
sources,
... ...
}: }:
let let
inherit (lib.modules) mkForce mkIf; inherit (lib.modules) mkForce mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (config.modules.system) isGraphical; inherit (config.modules.system) isGraphical;
inherit (config.meta.mainUser) username;
cfg = config.modules.desktops.niri; cfg = config.modules.desktops.niri;
patched-niri = pkgs.niri.overrideAttrs (prev: { niri = pkgs.callPackage (_: pkgs.rustPlatform.buildRustPackage {
src = pkgs.fetchFromGitHub { pname = "niri";
inherit (prev.src) owner repo; version = "unstable";
rev = "37458d94b288945f6cfbd3c5c233f634d59f246c";
hash = "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg="; src = sources.niri;
postPatch = ''
patchShebangs resources/niri-session
substituteInPlace resources/niri.service \
--replace-fail '/usr/bin' "$out/bin"
'';
cargoLock = {
allowBuiltinFetchGit = true;
lockFile = "${sources.niri}/Cargo.lock";
}; };
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (patched-niri) src; strictDeps = true;
hash = "sha256-fT0L/OTlQ9BnKHnckKsLi+tN+oevEU+eJWrh1INqQhA="; doInstallCheck = false;
};
patches = [ nativeBuildInputs = with pkgs; [
(pkgs.fetchpatch { rustPlatform.bindgenHook
url = "https://github.com/YaLTeR/niri/commit/ab71a6c553f9c53ea484ec6dedc5dcede708929f.diff"; pkg-config
hash = "sha256-C3TJIK5/YTAcmdSP6NyOwX+1oA36u6nrMuJuVYIvAHQ="; installShellFiles
})
]; ];
});
buildInputs = with pkgs; [
cairo
dbus
libGL
libdisplay-info
libinput
seatd
libxkbcommon
libgbm
pango
wayland
dbus
pipewire
# Also includes libudev
systemd
];
buildFeatures = [
"dbus"
"dinit"
"xdp-gnome-screencast"
"systemd"
];
buildNoDefaultFeatures = true;
postInstall = ''
installShellCompletion --cmd niri \
--bash <($out/bin/niri completions bash) \
--fish <($out/bin/niri completions fish) \
--zsh <($out/bin/niri completions zsh)
install -Dm644 resources/niri.desktop -t $out/share/wayland-sessions
install -Dm644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal
install -Dm755 resources/niri-session $out/bin/niri-session
install -Dm644 resources/niri{.service,-shutdown.target} -t $out/share/systemd/user
'';
env = {
# Force linking with libEGL and libwayland-client
# so they can be discovered by `dlopen()`
RUSTFLAGS = toString (
map (arg: "-C link-arg=" + arg) [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
]
);
};
passthru = {
providedSessions = [ "niri" ];
};
meta.mainProgram = "niri";
}) { };
in in
{ {
options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor"; options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor";
@ -35,13 +103,13 @@ in
config = mkIf (cfg.enable || isGraphical) { config = mkIf (cfg.enable || isGraphical) {
programs.niri = { programs.niri = {
enable = true; enable = true;
package = patched-niri; package = niri;
}; };
# The niri module auto enables the gnome keyring, # The niri module auto enables the gnome keyring,
# which is something I direly want to avoid. # which is something I direly want to avoid.
services.gnome.gnome-keyring.enable = mkForce false; services.gnome.gnome-keyring.enable = mkForce false;
environment.etc."niri/config.kdl".source = ./config.kdl; hjem.users.${username}.files.".config/niri/config.kdl".source = ./config.kdl;
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)

View file

@ -1,49 +1,31 @@
{ {
"pins": { "pins": {
"determinate": { "flake-compat": {
"type": "Git", "type": "Git",
"repository": { "repository": {
"type": "GitHub", "type": "Forgejo",
"owner": "determinatesystems", "server": "https://git.lix.systems/",
"repo": "determinate" "owner": "lix-project",
"repo": "flake-compat"
}, },
"branch": "main", "branch": "main",
"submodules": false, "submodules": false,
"revision": "5e73b5071ece6da51aa50c55e3438335e2ef9d9c", "revision": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
"url": "https://github.com/determinatesystems/determinate/archive/5e73b5071ece6da51aa50c55e3438335e2ef9d9c.tar.gz", "url": "https://git.lix.systems/lix-project/flake-compat/archive/549f2762aebeff29a2e5ece7a7dc0f955281a1d1.tar.gz",
"hash": "sha256-UFzMWhD4rN/9C5Rnf6VHB63gHLFgaPxh0meZlRQrbnU=" "hash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw="
}, },
"dix": { "hjem": {
"type": "GitRelease", "type": "Git",
"repository": { "repository": {
"type": "GitHub", "type": "GitHub",
"owner": "determinatesystems", "owner": "feel-co",
"repo": "nix-src" "repo": "hjem"
}, },
"pre_releases": false, "branch": "main",
"version_upper_bound": null,
"release_prefix": null,
"submodules": false, "submodules": false,
"version": "v3.8.3", "revision": "3093a74542b30f8155954d585d0ae2401e3adbe5",
"revision": "aa49e142fc30f0598f954abdc0b83c2f290f12d1", "url": "https://github.com/feel-co/hjem/archive/3093a74542b30f8155954d585d0ae2401e3adbe5.tar.gz",
"url": "https://api.github.com/repos/determinatesystems/nix-src/tarball/v3.8.3", "hash": "sha256-LzojKFWAAreWyH56aupj/MLwuPPnnyzplw/xdbavC9c="
"hash": "sha256-Z+nd/hOF4mpn1OqjvtrJZAoXwiXJ36wtoubd1kAWhmE="
},
"flake-compat": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "edolstra",
"repo": "flake-compat"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v1.1.0",
"revision": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"url": "https://api.github.com/repos/edolstra/flake-compat/tarball/v1.1.0",
"hash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU="
}, },
"impermanence": { "impermanence": {
"type": "Git", "type": "Git",
@ -71,6 +53,34 @@
"url": "https://github.com/nix-community/lanzaboote/archive/5a776450d904b7ccd377c2a759703152b2553e98.tar.gz", "url": "https://github.com/nix-community/lanzaboote/archive/5a776450d904b7ccd377c2a759703152b2553e98.tar.gz",
"hash": "sha256-9Cc0YqL9ZUpaybJsrRJfXex91QlPmQNqpTLgw/KvJGA=" "hash": "sha256-9Cc0YqL9ZUpaybJsrRJfXex91QlPmQNqpTLgw/KvJGA="
}, },
"lix": {
"type": "Git",
"repository": {
"type": "Forgejo",
"server": "https://git.lix.systems/",
"owner": "lix-project",
"repo": "lix"
},
"branch": "main",
"submodules": false,
"revision": "9d8ab804355d95d38a61ad5053d415ca1882d554",
"url": "https://git.lix.systems/lix-project/lix/archive/9d8ab804355d95d38a61ad5053d415ca1882d554.tar.gz",
"hash": "sha256-CFoDQz2mnfKWtAb6Y01xu+bfM+Q/6dHGkxKq6W+dzN8="
},
"lix-module": {
"type": "Git",
"repository": {
"type": "Forgejo",
"server": "https://git.lix.systems/",
"owner": "lix-project",
"repo": "nixos-module"
},
"branch": "main",
"submodules": false,
"revision": "4d4c2b8f0a801c91ce5b717c77fe3a17efa1402f",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/4d4c2b8f0a801c91ce5b717c77fe3a17efa1402f.tar.gz",
"hash": "sha256-gbpuESxl/An4GTh7QEbQRYJozVIxWkwVGbWK0/0GoRc="
},
"nh": { "nh": {
"type": "Git", "type": "Git",
"repository": { "repository": {
@ -84,6 +94,35 @@
"url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz", "url": "https://github.com/nix-community/nh/archive/a90e3124111d9c3eb64e97a5334db09a8e2a4bae.tar.gz",
"hash": "sha256-KKaUEg1/ntHVsG61CkKFr2mfdsoK9Nj5FM/W1PBhe5o=" "hash": "sha256-KKaUEg1/ntHVsG61CkKFr2mfdsoK9Nj5FM/W1PBhe5o="
}, },
"nil": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "oxalica",
"repo": "nil"
},
"branch": "main",
"submodules": false,
"revision": "524ae2d67dd84d99a10f409ed6cd8e4e7b3cae3f",
"url": "https://github.com/oxalica/nil/archive/524ae2d67dd84d99a10f409ed6cd8e4e7b3cae3f.tar.gz",
"hash": "sha256-Uy2qzd+fMoBcp4NPSO7DavEC1pGMegmAqoEMvmXbIQU="
},
"niri": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "yalter",
"repo": "niri"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v25.05.1",
"revision": "61e306c1c6b13ae99bf7f51532a6aa86cd50d690",
"url": "https://api.github.com/repos/yalter/niri/tarball/refs/tags/v25.05.1",
"hash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs="
},
"nixfmt": { "nixfmt": {
"type": "GitRelease", "type": "GitRelease",
"repository": { "repository": {

View file

@ -5,16 +5,12 @@
}: }:
let let
inherit (pkgs) lib; inherit (pkgs) lib;
helix = pkgs.callPackage ./helix { };
kakoune = pkgs.callPackage ./kakoune.nix { }; kakoune = pkgs.callPackage ./kakoune.nix { };
fish = pkgs.callPackage ./fish { inherit lib; }; fish = pkgs.callPackage ./fish { inherit lib; };
nushell = pkgs.callPackage ./nushell { };
in in
{ {
inherit inherit
kakoune kakoune
fish fish
helix
nushell
; ;
} }

View file

@ -1,4 +0,0 @@
{
inherits = "gruvbox_dark_hard";
"ui.background" = { };
}

View file

@ -1,220 +0,0 @@
{
sources,
basedpyright,
bash-language-server,
callPackage,
clang-tools,
clippy,
cmake-format,
cmake-language-server,
deadnix,
deno,
dprint,
fetchzip,
formats,
gdb,
golangci-lint-langserver,
gopls,
helix,
kdePackages,
kdlfmt,
lazygit,
lib,
lldb_19,
makeWrapper,
nixd,
ruff,
rust-analyzer,
rustPlatform,
rustfmt,
shellcheck,
shfmt,
simple-completion-language-server,
superhtml,
symlinkJoin,
taplo,
tinymist,
typescript-language-server,
vscode-langservers-extracted,
zls,
...
}:
let
inherit (lib.meta) getExe;
custom-helix = helix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "25.07.2";
src = fetchzip {
url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
hash = "sha256-ZNsQwFfPXe6oewajx1tl68W60kVo7q2SuvTgy/o1HKk=";
stripRoot = false;
};
doInstallCheck = false;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (custom-helix) src;
hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg=";
};
}
);
toml = formats.toml { };
helix-languages = callPackage ./languages.nix { inherit lib sources; };
colorscheme = toml.generate "colorscheme.toml" (import ./colorscheme.nix);
helix-config = {
theme = "theme_transparent";
editor = {
cursorline = false;
color-modes = true;
true-color = true;
indent-guides.render = true;
lsp = {
enable = true;
auto-signature-help = true;
display-inlay-hints = false;
display-messages = true;
snippets = true;
};
file-picker = {
hidden = true;
};
line-number = "relative";
auto-format = true;
completion-timeout = 5;
mouse = true;
bufferline = "multiple";
soft-wrap.enable = true;
word-completion = {
enable = true;
trigger-length = 2;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = [
"spinner"
"version-control"
"diagnostics"
"file-name"
];
right = [
"file-base-name"
"file-type"
"position"
"file-encoding"
];
};
gutters.layout = [
"diff"
"diagnostics"
"line-numbers"
"spacer"
];
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
};
keys = {
normal = {
space = {
g = [
":new"
":insert-output XDG_CONFIG_HOME=~/.config ${getExe lazygit}"
":buffer-close!"
":redraw"
];
i = ":toggle lsp.display-inlay-hints";
};
esc = [
"collapse_selection"
"keep_primary_selection"
"normal_mode"
];
A-H = "goto_previous_buffer";
A-L = "goto_next_buffer";
A-w = ":buffer-close";
A-f = ":format";
A-r = ":reload";
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
";" = "flip_selections";
"A-;" = "collapse_selection";
# Kakoune-like config
H = "extend_char_left";
J = "extend_line_down";
K = "extend_line_up";
L = "extend_char_right";
};
select = {
A-x = "extend_to_line_bounds";
X = [
"extend_line_up"
"extend_to_line_bounds"
];
g = {
e = "goto_file_end";
};
};
};
};
wrapped-helix = symlinkJoin {
name = "helix-wrapped";
paths = [
custom-helix
# Bash
bash-language-server
# C/C++
clang-tools
clippy
golangci-lint-langserver
gopls
lldb_19
# Markdown
taplo
nixd
rust-analyzer
rustfmt
# Shell
shellcheck
kdlfmt
superhtml
# toml
taplo
# typst
tinymist
# typst lsp
vscode-langservers-extracted
kdlfmt
# zig language server
zls
];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
mkdir -p $out/config/helix/themes
cp "${toml.generate "config.toml" helix-config}" $out/config/helix/config.toml
cp "${helix-languages}" $out/config/helix/languages.toml
cp "${colorscheme}" $out/config/helix/themes/theme_transparent.toml
wrapProgram $out/bin/hx --set \
XDG_CONFIG_HOME $out/config
'';
};
in
wrapped-helix

View file

@ -1,344 +0,0 @@
{
sources,
basedpyright,
bash-language-server,
callPackage,
clang-tools,
cmake-format,
cmake-language-server,
deadnix,
deno,
dprint,
fetchFromGitHub,
formats,
gdb,
kdePackages,
lib,
nil,
ruff,
rustPlatform,
shfmt,
typescript-language-server,
vscode-langservers-extracted,
zls,
...
}:
let
inherit (lib.meta) getExe getExe';
toml = formats.toml { };
nixfmt = callPackage "${sources.nixfmt}/default.nix" { };
# a newer nil version, for pipes support.
new-nil = nil.overrideAttrs (_: {
version = "unstable-18-07-2025";
src = fetchFromGitHub {
owner = "oxalica";
repo = "nil";
rev = "524ae2d67dd84d99a10f409ed6cd8e4e7b3cae3f";
hash = "sha256-Uy2qzd+fMoBcp4NPSO7DavEC1pGMegmAqoEMvmXbIQU=";
};
doInstallCheck = false;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (new-nil) src;
hash = "sha256-Sljr3ff8hl/qm/0wqc1GXsEr1wWn7NAXmdrd5wHzUX8=";
};
});
new-deadnix = deadnix.overrideAttrs (
finalAttrs: previousAttrs: {
version = "unstable-15-07-2025";
src = fetchFromGitHub {
owner = "astro";
repo = "deadnix";
rev = "d75457b95d7cfa82fcd60970939f76fccfce19e5";
hash = "sha256-O/z2neAXL8JNkGosvxC+DyZnnJ8zYP9XHApxHVmlzfY=";
};
doInstallCheck = false;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (new-deadnix) src;
hash = "sha256-O8yhqyPflOvQXAA19k1XpbrHysgV5VNWLBX0l5Q5GkM=";
};
}
);
helix-languages = {
language =
let
mark = lang: {
command = getExe deno;
args = [
"fmt"
"-"
"--ext"
lang
];
};
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = getExe shfmt;
args = [
"-i"
"2"
];
};
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
}
{
name = "cmake";
auto-format = true;
language-servers = [ "cmake-language-server" ];
formatter = {
command = getExe cmake-format;
args = [ "-" ];
};
}
{
name = "javascript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "json";
formatter = mark "json";
}
{
name = "markdown";
auto-format = true;
formatter = mark "md";
language-servers = [ "taplo" ];
}
{
name = "nix";
language-servers = [ "nil" ];
}
{
name = "qml";
language-servers = [ "qmlls" ];
}
{
name = "python";
auto-format = true;
language-servers = [
"basedpyright"
"ruff"
];
}
{
name = "typescript";
auto-format = true;
language-servers = [
"dprint"
"typescript-language-server"
];
}
{
name = "rust";
}
{
name = "c";
auto-format = true;
language-servers = [ "clangd" ];
}
{
name = "zig";
auto-format = true;
}
{
name = "c";
debugger = {
name = "gdb";
command = getExe gdb;
transport = "stdio";
templates = [
{
name = "binary";
request = "launch";
completion = [
{
name = "binary";
completion = "filename";
}
];
args = {
program = "{0}";
runInTerminal = true;
};
}
];
};
}
];
language-server = {
bash-language-server = {
command = getExe bash-language-server;
args = [ "start" ];
};
rust-analyzer = {
config.rust-analyzer = {
checkOnSave.command = "clippy";
procMacro.enable = true;
cargo = {
loadOutDirsFromCheck = true;
features = "all";
};
assist = {
preferSelf = true;
};
check = {
command = "clippy";
extraArgs = [
"--"
"-W"
"clippy::pedantic"
"-W"
"clippy::nursery"
"-W"
"clippy::perf"
];
};
lens = {
references = true;
methodReferences = true;
};
completion.autoimport.enable = true;
experimental.procAttrMacros = true;
interpret.tests = true;
};
};
clangd = {
command = "${clang-tools}/bin/clangd";
clangd.fallbackFlags = [ "-std=c++2b" ];
};
cmake-language-server = {
command = getExe cmake-language-server;
};
deno-lsp = {
command = getExe deno;
args = [ "lsp" ];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
lint = true;
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {
hosts."https://deno.land" = true;
};
};
inlayHints = {
enumMemberValues.enabled = true;
functionLikeReturnTypes.enabled = true;
parameterNames.enabled = "all";
parameterTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
variableTypes.enabled = true;
};
};
};
dprint = {
command = getExe dprint;
args = [ "lsp" ];
};
nil = {
command = getExe new-nil;
config.nil = {
formatting.command = [ "${getExe nixfmt}" ];
diagnostics = {
bindingEndHintMinLines = 3;
};
nix.flake = {
autoArchive = true;
# autoEvalInputs = true;
nixpkgsInputName = "nixpkgs";
};
};
};
deadnix = {
command = getExe new-deadnix;
};
typescript-language-server = {
command = getExe typescript-language-server;
args = [ "--stdio" ];
config = {
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
};
};
ruff = {
command = getExe ruff;
args = [ "server" ];
};
qmlls = {
command = getExe' kdePackages.qtdeclarative "qmlls";
args = [ "-E" ];
};
basedpyright.command = "${basedpyright}/bin/basedpyright-langserver";
vscode-css-language-server = {
command = "${vscode-langservers-extracted}/bin/vscode-css-language-server";
args = [ "--stdio" ];
config = {
provideFormatter = true;
css.validate.enable = true;
scss.validate.enable = true;
};
};
zls = {
command = getExe zls;
config = {
enable_build_on_save = true;
build_on_save_args = [
"check"
"-fincremental"
"--watch"
];
enable_autofix = false;
warn_style = true;
highlight_global_var_declarations = true;
};
};
};
};
in
toml.generate "languages.toml" helix-languages

View file

@ -1,332 +0,0 @@
#! /usr/bin/env nu
$env.config = {
bracketed_paste: true
buffer_editor: "hx"
datetime_format: {}
edit_mode: vi
error_style: fancy
float_precision: 2
footer_mode: 25
render_right_prompt_on_last_line: false
show_banner: false
use_ansi_coloring: true
use_kitty_protocol: true
shell_integration: {
osc2: false
osc7: true
osc8: true
osc9_9: false
osc133: true
osc633: true
reset_application_mode: true
}
}
$env.config.ls = {
clickable_links: true
use_ls_colors: true
}
$env.config.rm.always_trash = true
$env.config.table = {
header_on_separator: true
footer_inheritance: true
index_mode: always
mode: compact
missing_value_symbol: kek
padding: {left: 1 right: 1}
show_empty: false
trim: {
methodology: wrapping
truncating_suffix: "..."
wrapping_try_keep_words: true
}
}
$env.config.explore = {
command_bar_text: {fg: "#C4C9C6"}
highlight: {fg: black bg: yellow}
status: {
error: {fg: white bg: red}
warn: {}
info: {}
}
status_bar_background: {fg: "#1D1F21" bg: "#C4C9C6"}
table: {
split_line: {fg: "#404040"}
selected_cell: {bg: light_blue}
selected_row: {}
selected_column: {}
}
}
$env.config.history = {
file_format: sqlite
isolation: false
max_size: 100_000
sync_on_enter: true
}
$env.config.cursor_shape = {
vi_insert: line
vi_normal: block
}
$env.config.hooks = {
command_not_found: {|| }
pre_execution: [
{
let prompt = commandline | str trim
if ($prompt | is-empty) {
return
}
print $"(ansi title)($prompt) — nu(char bel)"
}
]
env_change: {
PWD: [
{||
if not ($env.PWD | path join .envrc | path exists) {
return
}
if (which direnv | is-empty) {
return
}
direnv export json | from json | default {} | load-env
$env.PATH = $env.PATH | split row (char env_sep)
}
]
}
}
$env.config.menus = [
{
marker: $"(ansi yellow)╋ "
name: help_menu
only_buffer_difference: true
style: {
description_text: yellow
selected_text: red_reverse
text: yellow
}
type: {
col_padding: 2
col_width: 20
columns: 4
description_rows: 10
layout: description
selection_rows: 4
}
}
]
$env.config.keybindings = [
{
name: copy_commandline
modifier: alt
keycode: char_c
mode: [vi_normal vi_insert]
event: {
send: executehostcommand
cmd: 'commandline | nu-highlight | $"```ansi\n($in)\n```" | wl-copy $in'
}
}
{
name: escape
modifier: none
keycode: escape
mode: [vi_normal vi_insert]
event: {send: esc}
}
{
name: cancel_command
modifier: control
keycode: char_c
mode: [vi_normal vi_insert]
event: {send: ctrlc}
}
{
name: quit_shell
modifier: control
keycode: char_d
mode: [vi_normal vi_insert]
event: {send: ctrld}
}
{
name: clear_screen
modifier: control
keycode: char_l
mode: [vi_normal vi_insert]
event: {send: clearscreen}
}
{
name: open_command_editor
modifier: control
keycode: char_o
mode: [vi_normal vi_insert]
event: {send: openeditor}
}
{
name: abbr
modifier: control
keycode: space
mode: [vi_normal vi_insert]
event: [
{send: menu name: abbr_menu}
{edit: insertchar value: " "}
]
}
{
name: move_down
modifier: none
keycode: down
mode: [vi_normal vi_insert]
event: {
until: [
{send: menudown}
{send: down}
]
}
}
{
name: move_left
modifier: none
keycode: left
mode: [vi_normal vi_insert]
event: {
until: [
{send: menuleft}
{send: left}
]
}
}
{
name: move_right_or_take_history_hint
modifier: none
keycode: right
mode: [vi_normal vi_insert]
event: {
until: [
{send: historyhintcomplete}
{send: menuright}
{send: right}
]
}
}
{
name: move_one_word_left
modifier: control
keycode: left
mode: [vi_normal vi_insert]
event: {edit: movewordleft}
}
{
name: move_one_word_right_or_take_history_hint
modifier: control
keycode: right
mode: [vi_normal vi_insert]
event: {
until: [
{send: historyhintwordcomplete}
{edit: movewordright}
]
}
}
{
name: move_to_line_start
modifier: control
keycode: char_a
mode: [vi_normal vi_insert]
event: {edit: movetolinestart}
}
{
name: move_to_line_end_or_take_history_hint
modifier: control
keycode: char_e
mode: [vi_normal vi_insert]
event: {
until: [
{send: historyhintcomplete}
{edit: movetolineend}
]
}
}
{
name: delete_one_character_backward
modifier: none
keycode: backspace
mode: vi_insert
event: {edit: backspace}
}
{
name: delete_one_word_backward
modifier: control
keycode: backspace
mode: vi_insert
event: {edit: backspaceword}
}
{
name: newline_or_run_command
modifier: none
keycode: enter
mode: vi_insert
event: {send: enter}
}
{
name: take_history_hint
modifier: control
keycode: char_f
mode: [vi_normal vi_insert]
event: {
until: [
{send: historyhintcomplete}
]
}
}
]
let env_vars_file = '/tmp/nushell-env-vars'
if not ($env_vars_file | path exists) {
open /etc/profile
| lines
| select 11
| str trim
| split column ' ' del path
| get path.0
| open $in
| str trim
| lines
| parse 'export {name}="{value}"'
| transpose --header-row --as-record
| tee { load-env $in }
| to nuon
| save --force $env_vars_file
} else {
open $env_vars_file
| from nuon
| load-env $in
}
def switch [] {
nh os switch --file ($env.NH_FLAKE | path join default.nix) (open /etc/hostname | str trim)
}
# fix sudo by prepending /run/wrappers/bin to the PATH.
$env.PATH = ($env.PATH | split row (char esep) | prepend '/run/wrappers/bin')
$env.CARAPACE_BRIDGES = 'inshellisense,fish,carapace,clap,bash'
$env.CARAPACE_MATCH = 1
# Set environment variables according to the path of the clone
$env.TOPIARY_CONFIG_FILE = ($env.HOME | path join .config | path join topiary languages.ncl)
$env.TOPIARY_LANGUAGE_DIR = ($env.HOME | path join .config | path join topiary languages)
# The prompt indicators are environmental variables that represent
# the state of the prompt.

View file

@ -1,47 +0,0 @@
{ pkgs, ... }:
let
inherit (pkgs) lib;
inherit (lib.meta) getExe;
nu-config =
pkgs.writeText "nu-init"
# nu
''
#!/usr/bin/env nu
source ${./config.nu}
source ${./prompt.nu}
let autoload_dir = $nu.user-autoload-dirs.0
mkdir $autoload_dir
let zoxide_path = $autoload_dir | path join zoxide.nu
if not ($zoxide_path | path exists) {
${getExe pkgs.zoxide} init nushell --cmd cd | save -f $zoxide_path
}
# Atuin is too slow, sadly.
# let atuin_path = $autoload_dir | path join atuin.nu
# if not ($atuin_path | path exists) {
# ${getExe pkgs.atuin} init nu | save -f $atuin_path
# }
let carapace_path = $autoload_dir | path join carapace.nu
if not ($carapace_path | path exists) {
${getExe pkgs.carapace} _carapace nushell | save -f $carapace_path
}
'';
packages = import ./packages.nix pkgs;
in
(pkgs.symlinkJoin {
name = "nushell";
paths = [ pkgs.nushell ] ++ packages;
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/nu --add-flags "\
--config ${nu-config}"
'';
}).overrideAttrs
(_: {
passthru = {
shellPath = "/bin/nu";
};
meta.mainProgram = "nu";
})

View file

@ -1,65 +0,0 @@
pkgs:
builtins.attrValues {
inherit (pkgs)
# better cd
zoxide
# pipe viewer
pv
# hex editor
bvi
#better ls
eza
atuin
# better cat
bat
# clipboard
# yazi
serpl
diff-so-fancy
tig
direnv
sesh
mprocs
curlie
entr
procs
sd
# mult
glow
# dua-cli
dust
kondo
# better grep
ripgrep
# IP stuff
dig
# simply the best fetch tool out there
microfetch
fzf
element
difftastic
hexyl
yazi
gnumake
asciinema
inetutils
tokei
starship
wget
cpufetch
watchman
tealdeer
hyperfine
imagemagick
ffmpeg-full
timg
nmap
fd
jq
rsync
figlet
unzip
zip
ouch
;
}