Compare commits

..

1 commit

Author SHA1 Message Date
b5eae95898
wip: niri take 2 [skip-ci]
All checks were successful
/ check (push) Successful in 1m6s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 1m22s
/ build-vm (push) Successful in 7m36s
/ report-size (push) Successful in 1m7s
Take two, since one wasn't enough.
2025-03-21 17:11:23 +01:00
25 changed files with 665 additions and 748 deletions

View file

@ -16,6 +16,7 @@ jobs:
with: with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux" source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"
diagnostic-endpoint: "" diagnostic-endpoint: ""
- uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4 # v9
- name: Run `nix flake check` - name: Run `nix flake check`
run: | run: |
nix flake check --verbose --keep-going nix flake check --verbose --keep-going
@ -24,6 +25,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4 # v9
- uses: DeterminateSystems/nix-installer-action@v13 - uses: DeterminateSystems/nix-installer-action@v13
with: with:
source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux" source-url: "https://install.lix.systems/lix/lix-installer-x86_64-linux"

View file

@ -3,7 +3,7 @@ authors = ["Jalil David Salamé Messina"]
language = "en" language = "en"
multilingual = false multilingual = false
src = "src" src = "src"
title = "Jalil's NixOS configuration modules" title = "Jalil's NixOS configuration module"
[preprocessor.toc] [preprocessor.toc]
command = "mdbook-toc" command = "mdbook-toc"

View file

@ -1,9 +1,6 @@
# Summary # Summary
[Nix Based Configuration](./configuration-overview.md) - [Nix Based Configuration](./configuration-overview.md)
- [NixOS Module Options](./nixos-options.md)
- [NixOS Module Options](./nixos-options.md) - [Neovim Module Options](./nvim-options.md)
- [Neovim Module Options](./nvim-options.md) - [Home Manager Module Options](./home-options.md)
- [Home Manager Module Options](./home-options.md)
[Search](./search/index.html)

View file

@ -16,7 +16,6 @@
home = { home = {
username = "jdoe"; username = "jdoe";
homeDirectory = "/home/jdoe"; homeDirectory = "/home/jdoe";
stateVersion = "24.11";
}; };
jhome = { jhome = {
enable = true; enable = true;

View file

@ -1,50 +1,46 @@
{ lib, ... }: { lib, inputs, ... }:
{ {
perSystem = perSystem =
{ inputs', pkgs, ... }: { pkgs, ... }:
{ {
packages = packages =
let let
modules = ../modules;
filterVisible = filterVisible =
toplevelOption: option: toplevelOption: option:
option // { visible = option.visible && builtins.elemAt option.loc 0 == toplevelOption; }; option // { visible = option.visible && builtins.elemAt option.loc 0 == toplevelOption; };
genOptionsDoc = home-eval = lib.evalModules {
toplevelOption: module: modules = [ (modules + "/hm/options.nix") ];
pkgs.nixosOptionsDoc { specialArgs = {
inherit (lib.evalModules { modules = [ module ]; }) options; inherit pkgs;
transformOptions = filterVisible toplevelOption;
}; };
mkScope = name: options: {
inherit name;
optionsJSON = "${options.optionsJSON}/share/doc/nixos/options.json";
urlPrefix = "https://github.com/jalil-salame/configuration.nix/blob/main/";
}; };
search = inputs'.nuschtosSearch.packages.mkMultiSearch { nvim-eval = lib.evalModules { modules = [ (modules + "/nixvim/options.nix") ]; };
title = "Search Jalil's configuration.nix"; nixos-eval = lib.evalModules { modules = [ (modules + "/nixos/options.nix") ]; };
baseHref = "/"; home-markdown =
(pkgs.nixosOptionsDoc {
scopes = [ inherit (home-eval) options;
(mkScope "NixOS" nixos) transformOptions = filterVisible "jhome";
(mkScope "Home-Manager" home) }).optionsCommonMark;
(mkScope "NixVIM" nvim) nvim-markdown =
]; (pkgs.nixosOptionsDoc {
}; inherit (nvim-eval) options;
home = genOptionsDoc "jhome" ../modules/hm/options.nix; transformOptions = filterVisible "jhome";
nvim = genOptionsDoc "jhome" ../modules/nixvim/options.nix; }).optionsCommonMark;
nixos = genOptionsDoc "jconfig" ../modules/nixos/options.nix; nixos-markdown =
nixos-markdown = nixos.optionsCommonMark; (pkgs.nixosOptionsDoc {
home-markdown = home.optionsCommonMark; inherit (nixos-eval) options;
nvim-markdown = nvim.optionsCommonMark; transformOptions = filterVisible "jconfig";
}).optionsCommonMark;
in in
{ {
inherit search;
docs-home-markdown = home-markdown; docs-home-markdown = home-markdown;
docs-nixos-markdown = nixos-markdown; docs-nixos-markdown = nixos-markdown;
docs-nvim-markdown = nvim-markdown; docs-nvim-markdown = nvim-markdown;
# Documentation # Documentation
docs = pkgs.stdenvNoCC.mkDerivation { docs = pkgs.stdenvNoCC.mkDerivation {
name = "nixos-configuration-book"; name = "nixos-configuration-book";
src = ../docs; src = inputs.self + "/docs";
patchPhase = '' patchPhase = ''
cleanup_md() { cleanup_md() {
@ -57,12 +53,10 @@
cleanup_md ${home-markdown} >> ./src/home-options.md cleanup_md ${home-markdown} >> ./src/home-options.md
cleanup_md ${nvim-markdown} >> ./src/nvim-options.md cleanup_md ${nvim-markdown} >> ./src/nvim-options.md
cleanup_md ${nixos-markdown} >> ./src/nixos-options.md cleanup_md ${nixos-markdown} >> ./src/nixos-options.md
# link search site '';
ln -s "${search.override { baseHref = "/configuration.nix/search/"; }}" ./src/search
''; # FIXME: only add the `/configuration.nix/` part for GH CI
nativeBuildInputs = [ pkgs.mdbook-toc ]; nativeBuildInputs = [ pkgs.mdbook-toc ];
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir \"$out\""; buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
}; };
}; };
}; };

View file

@ -12,7 +12,7 @@ in
modules = [ modules = [
inputs.self.nixosModules.default inputs.self.nixosModules.default
../example-vm # import vm configuration ../example-vm # import vm configuration
{ nix.registry.nixpkgs.flake = inputs.nixpkgs; } # pin nixpkgs to the one used by the system { nix.registry.nixpkgs.flake = inputs.nixpkgs; }
]; ];
}; };

100
flake.lock generated
View file

@ -226,11 +226,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1743387206, "lastModified": 1742234739,
"narHash": "sha256-24N3NAuZZbYqZ39NgToZgHUw6M7xHrtrAm18kv0+2Wo=", "narHash": "sha256-zFL6zsf/5OztR1NSNQF33dvS1fL/BzVUjabZq4qrtY4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "15c5f9d04fabd176f30286c8f52bbdb2c853a146", "rev": "f6af7280a3390e65c2ad8fd059cdc303426cbd59",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -240,44 +240,18 @@
"type": "github" "type": "github"
} }
}, },
"ixx": {
"inputs": {
"flake-utils": [
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1737234286, "lastModified": 1737234286,
"narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=", "narHash": "sha256-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g=",
"rev": "079528098f5998ba13c88821a2eca1005c1695de", "rev": "2837da71ec1588c1187d2e554719b15904a46c8b",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de" "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2837da71ec1588c1187d2e554719b15904a46c8b.tar.gz?rev=2837da71ec1588c1187d2e554719b15904a46c8b"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz" "url": "https://git.lix.systems/lix-project/lix/archive/2.92.0.tar.gz"
} }
}, },
"lix-module": { "lix-module": {
@ -290,15 +264,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742943028, "lastModified": 1737237494,
"narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=", "narHash": "sha256-YMLrcBpf0TR5r/eaqm8lxzFPap2TxCor0ZGcK3a7+b8=",
"rev": "3fae818597ca2f1474de62022f850c23be50528d", "rev": "b90bf629bbd835e61f1317b99e12f8c831017006",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/3fae818597ca2f1474de62022f850c23be50528d.tar.gz?rev=3fae818597ca2f1474de62022f850c23be50528d" "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/b90bf629bbd835e61f1317b99e12f8c831017006.tar.gz?rev=b90bf629bbd835e61f1317b99e12f8c831017006"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz" "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"
} }
}, },
"niri": { "niri": {
@ -347,11 +321,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1743367904, "lastModified": 1742388435,
"narHash": "sha256-sOos1jZGKmT6xxPvxGQyPTApOunXvScV4lNjBCXd/CI=", "narHash": "sha256-GheQGRNYAhHsvPxWVOhAmg9lZKkis22UPbEHlmZMthg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7ffe0edc685f14b8c635e3d6591b0bbb97365e6c", "rev": "b75693fb46bfaf09e662d09ec076c5a162efa9f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -363,11 +337,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1742800061, "lastModified": 1742272065,
"narHash": "sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs=", "narHash": "sha256-ud8vcSzJsZ/CK+r8/v0lyf4yUntVmDq6Z0A41ODfWbE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1750f3c1c89488e2ffdd47cab9d05454dddfb734", "rev": "3549532663732bfd89993204d40543e9edaec4f2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -386,11 +360,11 @@
"nuschtosSearch": [] "nuschtosSearch": []
}, },
"locked": { "locked": {
"lastModified": 1743362786, "lastModified": 1742488644,
"narHash": "sha256-XbXIRDbb8/vLBX1M096l7lM5wfzBTp1ZXfUl9bUhVGU=", "narHash": "sha256-vXpu7G4aupNCPlv8kAo7Y/jocfSUwglkvNx5cR0XjBo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "d81f37256d0a8691b837b74979d27bf89be8ecdd", "rev": "d44b33a1ea1a3e584a8c93164dbe0ba2ad4f3a13",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -399,31 +373,6 @@
"type": "github" "type": "github"
} }
}, },
"nuschtosSearch": {
"inputs": {
"flake-utils": [
"lix-module",
"flake-utils"
],
"ixx": "ixx",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1743201766,
"narHash": "sha256-bb/dqoIjtIWtJRzASOe8g4m8W2jUIWtuoGPXdNjM/Tk=",
"owner": "NuschtOS",
"repo": "search",
"rev": "2651dbfad93d6ef66c440cbbf23238938b187bde",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -432,7 +381,6 @@
"niri": "niri", "niri": "niri",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixvim": "nixvim", "nixvim": "nixvim",
"nuschtosSearch": "nuschtosSearch",
"stylix": "stylix", "stylix": "stylix",
"systems": "systems", "systems": "systems",
"treefmt-nix": "treefmt-nix", "treefmt-nix": "treefmt-nix",
@ -556,11 +504,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1743081648, "lastModified": 1742370146,
"narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", "narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", "rev": "adc195eef5da3606891cedf80c0d9ce2d3190808",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -12,7 +12,7 @@
unstable.follows = "nixvim/nixpkgs"; unstable.follows = "nixvim/nixpkgs";
# Lix # Lix
lix-module = { lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz"; url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
flake-utils.inputs.systems.follows = "systems"; flake-utils.inputs.systems.follows = "systems";
@ -58,19 +58,10 @@
url = "github:hercules-ci/flake-parts"; url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs"; inputs.nixpkgs-lib.follows = "nixpkgs";
}; };
# For the formatter (can be set to null)
treefmt-nix = { treefmt-nix = {
url = "github:numtide/treefmt-nix"; url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# For generating the docs (can be set to null)
nuschtosSearch = {
url = "github:NuschtOS/search";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "lix-module/flake-utils";
};
};
# For deduplication # For deduplication
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
}; };

View file

@ -16,7 +16,6 @@ in
imports = [ imports = [
./options.nix ./options.nix
./gui ./gui
./dev.nix
./users.nix ./users.nix
]; ];
@ -24,7 +23,7 @@ in
(lib.mkIf (cfg.enable && cfg.styling.enable) { (lib.mkIf (cfg.enable && cfg.styling.enable) {
stylix = { stylix = {
enable = true; enable = true;
targets.nixvim.enable = false; # I prefer styling it myself targets.nixvim.enable = false; # I prefer doing it myself
}; };
}) })
(lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
@ -36,7 +35,6 @@ in
"settings" "settings"
"use-xdg-base-directories" "use-xdg-base-directories"
] true; ] true;
programs = { programs = {
# Better cat (bat) # Better cat (bat)
bat = { bat = {
@ -58,11 +56,6 @@ in
git = true; git = true;
icons = "auto"; icons = "auto";
}; };
# Shell
fish = {
enable = true;
preferAbbrs = true; # when defining an alias, prefer instead to define an abbreviation
};
# GnuPG # GnuPG
gpg = { gpg = {
enable = true; enable = true;
@ -80,8 +73,17 @@ in
ssh.enable = true; ssh.enable = true;
# cd replacement # cd replacement
zoxide.enable = true; zoxide.enable = true;
# Shell
zsh = {
enable = true;
autosuggestion.enable = true;
enableCompletion = true;
autocd = true;
dotDir = ".config/zsh";
history.path = "${config.xdg.dataHome}/zsh/zsh_history";
syntaxHighlighting.enable = true;
};
}; };
services = { services = {
# GPG Agent # GPG Agent
gpg-agent = { gpg-agent = {
@ -101,8 +103,9 @@ in
}; };
}; };
}; };
home = { home = {
stateVersion = "22.11";
# Extra packages
# Extra variables # Extra variables
sessionVariables = { sessionVariables = {
CARGO_HOME = "${config.xdg.dataHome}/cargo"; CARGO_HOME = "${config.xdg.dataHome}/cargo";
@ -124,7 +127,6 @@ in
tree = "eza --tree"; tree = "eza --tree";
}; };
}; };
# XDG directories # XDG directories
xdg = { xdg = {
enable = true; enable = true;
@ -134,5 +136,86 @@ in
}; };
}; };
}) })
(lib.mkIf (cfg.enable && devcfg.enable) {
home = {
sessionVariables.MANPAGER = lib.optionalString devcfg.neovimAsManPager "nvim -c 'Man!' -o -";
packages = devcfg.extraPackages;
};
# Github CLI
programs = {
gh.enable = true;
gh-dash.enable = true;
# Git
git = {
enable = true;
difftastic = {
enable = true;
background = "dark";
};
lfs.enable = true;
extraConfig = {
# Add diff to the commit message editor
commit.verbose = true;
# Improve submodule diff
diff.submodule = "log";
# Set the default branch name for new branches
init.defaultBranch = "main";
# Better conflicts (also shows parent commit state)
merge.conflictStyle = "zdiff3";
# Do not create merge commits when pulling (rebase but abort on conflict)
pull.ff = "only";
# Use `--set-upstream` if the remote does not have the branch
push.autoSetupRemote = true;
rebase = {
# If there are uncommitted changes, stash them before rebasing
autoStash = true;
# If there are fixup! commits, squash them while rebasing
autoSquash = true;
};
# Enable ReReRe (Reuse Recovered Resolution) auto resolve previously resolved conflicts
rerere.enabled = true;
# Improve submodule status
status.submoduleSummary = true;
};
};
lazygit.enable = true;
# Jujutsu (alternative DVCS (git-compatible))
jujutsu = {
enable = true;
package = pkgs.unstable.jujutsu;
settings = {
ui.pager = "bat";
# mimic git commit --verbose by adding a diff
templates.draft_commit_description = ''
concat(
description,
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
surround(
"\nJJ: Diff:\n", "",
indent("JJ: ", diff.git()),
),
)
'';
};
};
};
})
(lib.mkIf (cfg.enable && devcfg.enable && devcfg.rust.enable) {
home.packages = [ pkgs.rustup ] ++ devcfg.rust.extraPackages;
# Background code checker (for Rust)
programs.bacon = {
enable = true;
settings = {
export = {
enabled = true;
path = ".bacon-locations";
line_format = "{kind} {path}:{line}:{column} {message}";
};
};
};
})
]; ];
} }

View file

@ -1,101 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
cfg = config.jhome.dev;
in
{
config =
lib.flip lib.pipe
[
lib.mkMerge
(lib.mkIf (config.jhome.enable && cfg.enable))
]
[
(lib.mkIf cfg.rust.enable {
home.packages = [ pkgs.rustup ] ++ cfg.rust.extraPackages;
# Background code checker (for Rust)
programs.bacon = {
enable = true;
settings = {
export = {
enabled = true;
path = ".bacon-locations";
line_format = "{kind} {path}:{line}:{column} {message}";
};
};
};
})
{
home = {
sessionVariables.MANPAGER = lib.optionalString cfg.neovimAsManPager "nvim -c 'Man!' -o -";
packages = cfg.extraPackages;
};
# Github CLI
programs = {
gh.enable = true;
gh-dash.enable = true;
# Git
git = {
enable = true;
difftastic = {
enable = true;
background = "dark";
};
lfs.enable = true;
extraConfig = {
# Add diff to the commit message editor
commit.verbose = true;
# Improve submodule diff
diff.submodule = "log";
# Set the default branch name for new branches
init.defaultBranch = "main";
# Better conflicts (also shows parent commit state)
merge.conflictStyle = "zdiff3";
# Do not create merge commits when pulling (rebase but abort on conflict)
pull.ff = "only";
# Use `--set-upstream` if the remote does not have the branch
push.autoSetupRemote = true;
rebase = {
# If there are uncommitted changes, stash them before rebasing
autoStash = true;
# If there are fixup! commits, squash them while rebasing
autoSquash = true;
};
# Enable ReReRe (Reuse Recovered Resolution) auto resolve previously resolved conflicts
rerere.enabled = true;
# Improve submodule status
status.submoduleSummary = true;
};
};
lazygit.enable = true;
# Jujutsu (alternative DVCS (git-compatible))
jujutsu = {
enable = true;
package = pkgs.unstable.jujutsu;
settings = {
ui.pager = "bat";
# mimic git commit --verbose by adding a diff
templates.draft_commit_description = ''
concat(
description,
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
surround(
"\nJJ: Diff:\n", "",
indent("JJ: ", diff.git()),
),
)
'';
};
};
};
}
];
}

View file

@ -129,13 +129,13 @@ in
# PDF reader # PDF reader
zathura.enable = true; zathura.enable = true;
# Auto start sway # Auto start sway
fish.loginShellInit = zsh.loginExtra =
lib.optionalString cfg.sway.autostart # fish lib.optionalString cfg.sway.autostart # sh
'' ''
# Start Sway on login to TTY 1 # Start Sway on login to TTY 1
if test "$(tty)" = /dev/tty1 if [ "$TTY" = /dev/tty1 ]; then
exec sway exec sway
end fi
''; '';
}; };
services = { services = {

View file

@ -93,7 +93,7 @@ builtins.foldl' (l: r: l // r)
"XF86AudioRaiseVolume" = "exec ${pkgs.avizo}/bin/volumectl up"; "XF86AudioRaiseVolume" = "exec ${pkgs.avizo}/bin/volumectl up";
"XF86AudioLowerVolume" = "exec ${pkgs.avizo}/bin/volumectl down"; "XF86AudioLowerVolume" = "exec ${pkgs.avizo}/bin/volumectl down";
"XF86AudioMute" = "exec ${pkgs.avizo}/bin/volumectl toggle-mute"; "XF86AudioMute" = "exec ${pkgs.avizo}/bin/volumectl toggle-mute";
"XF86ScreenSaver" = "exec ${pkgs.swaylock}/bin/swaylock --image ${cfg.background}"; "XF86ScreenSaver" = "exec swaylock --image ${cfg.background}";
"XF86MonBrightnessUp" = "exec ${pkgs.avizo}/bin/lightctl up"; "XF86MonBrightnessUp" = "exec ${pkgs.avizo}/bin/lightctl up";
"XF86MonBrightnessDown" = "exec ${pkgs.avizo}/bin/lightctl down"; "XF86MonBrightnessDown" = "exec ${pkgs.avizo}/bin/lightctl down";
# Floating # Floating

View file

@ -4,12 +4,15 @@ let
inherit (cfg.defaultIdentity) signingKey; inherit (cfg.defaultIdentity) signingKey;
cfg = jhome.user; cfg = jhome.user;
hasConfig = jhome.enable && cfg != null;
hasKey = signingKey != null; hasKey = signingKey != null;
gpgHome = config.programs.gpg.homedir;
unlockKey = hasConfig && cfg.gpg.unlockKeys != [ ];
in in
{ {
config = lib.mkIf (jhome.enable && cfg != null) { config = lib.mkMerge [
programs = { (lib.mkIf hasConfig {
git = { programs.git = {
userName = cfg.defaultIdentity.name; userName = cfg.defaultIdentity.name;
userEmail = cfg.defaultIdentity.email; userEmail = cfg.defaultIdentity.email;
signing = lib.mkIf hasKey { signing = lib.mkIf hasKey {
@ -17,8 +20,7 @@ in
key = signingKey; key = signingKey;
}; };
}; };
programs.jujutsu.settings = {
jujutsu.settings = {
user = lib.mkIf (cfg.defaultIdentity != null) { inherit (cfg.defaultIdentity) name email; }; user = lib.mkIf (cfg.defaultIdentity != null) { inherit (cfg.defaultIdentity) name email; };
git.sign-on-push = lib.mkDefault hasKey; git.sign-on-push = lib.mkDefault hasKey;
signing = lib.mkIf hasKey { signing = lib.mkIf hasKey {
@ -27,14 +29,14 @@ in
key = signingKey; key = signingKey;
}; };
}; };
}; })
(lib.mkIf unlockKey {
xdg.configFile.pam-gnupg.text =
''
${gpgHome}
xdg.configFile.pam-gnupg = lib.mkIf (cfg.gpg.unlockKeys != [ ]) { ''
text = '' + (lib.strings.concatLines cfg.gpg.unlockKeys);
${config.programs.gpg.homedir} })
];
${lib.strings.concatLines cfg.gpg.unlockKeys}
'';
};
};
} }

View file

@ -1,27 +0,0 @@
{ lib }:
let
inherit (lib) types;
in
{
# Like mkEnableOption but defaults to true
mkDisableOption =
option:
(lib.mkEnableOption option)
// {
default = true;
example = false;
};
# A option that accepts an image (and shows it in the docs)
mkImageOption =
{
description,
url,
sha256 ? "",
}:
lib.mkOption {
inherit description;
type = types.path;
default = builtins.fetchurl { inherit url sha256; };
defaultText = lib.literalMD "![${description}](${url})";
};
}

View file

@ -1,6 +1,11 @@
{ pkgs, lib, ... }@args: {
config,
pkgs,
lib,
...
}:
let let
cfg = args.config.jconfig; cfg = config.jconfig;
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: { keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
name = "pubkeys/${username}"; name = "pubkeys/${username}";
value = { value = {
@ -15,96 +20,108 @@ in
{ {
imports = [ imports = [
./options.nix ./options.nix
./dev.nix ./gui
./gui.nix { stylix = import ./stylix-config.nix { inherit config pkgs; }; }
./styling.nix
]; ];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable (
# Enable unlocking the gpg-agent at boot (configured through home.nix) lib.mkMerge [
security.pam.services.login.gnupg.enable = true; {
boot.plymouth = {
inherit (cfg.styling) enable;
};
environment.systemPackages = [ # Enable unlocking the gpg-agent at boot (configured through home.nix)
# CLI tools security.pam.services.login.gnupg.enable = true;
pkgs.fd
pkgs.ripgrep
pkgs.du-dust
pkgs.curl
pkgs.zip
pkgs.unzip
];
programs = { environment.systemPackages = [
# Launch fish if shell is interactive (from https://wiki.nixos.org/wiki/Fish) # CLI tools
bash.interactiveShellInit = # bash pkgs.fd
'' pkgs.ripgrep
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] pkgs.du-dust
then pkgs.curl
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" pkgs.zip
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION pkgs.unzip
fi
'';
# Default shell
fish.enable = true;
# Shell prompt
starship = {
enable = true;
settings = lib.mkMerge [
{
format = "$time$all";
add_newline = false;
cmd_duration.min_time = 500;
cmd_duration.show_milliseconds = true;
time.disabled = false;
status = {
format = "[$signal_name$common_meaning$maybe_int](red)";
symbol = "[](bold red)";
disabled = false;
};
sudo.disabled = false;
}
# Add nerdfont symbols
(lib.mkIf cfg.styling.enable (import ./starship-nerdfont-symbols.nix))
# Remove the `in`s and `on`s from the prompt
(import ./starship-shorter-text.nix)
]; ];
};
};
environment.etc = keysFromGithub; # Enable dev documentation
services = { documentation.dev = {
# Enable printer autodiscovery if printing is enabled inherit (cfg.dev) enable;
avahi = { };
inherit (args.config.services.printing) enable; programs = {
nssmdns4 = true; # Shell prompt
openFirewall = true; starship = {
}; enable = true;
openssh.authorizedKeysFiles = builtins.map (keys: "/etc/${keys}") ( settings = lib.mkMerge [
builtins.attrNames keysFromGithub {
); format = "$time$all";
}; add_newline = false;
# Open ports for spotifyd cmd_duration.min_time = 500;
networking.firewall = { cmd_duration.show_milliseconds = true;
allowedUDPPorts = [ 5353 ]; time.disabled = false;
allowedTCPPorts = [ 2020 ]; status = {
}; format = "[$signal_name$common_meaning$maybe_int](red)";
# Nix Settings symbol = "[](bold red)";
nix = { disabled = false;
gc = { };
automatic = true; sudo.disabled = false;
dates = "weekly"; }
options = "--delete-older-than 30d"; # Add nerdfont symbols
# run between 0 and 45min after boot if run was missed (lib.mkIf cfg.styling.enable (import ./starship-nerdfont-symbols.nix))
randomizedDelaySec = "45min"; # Remove the `in`s and `on`s from the prompt
}; (lib.mkIf cfg.styling.enable (import ./starship-shorter-text.nix))
settings = { ];
use-xdg-base-directories = true; };
auto-optimise-store = true; # Default shell
experimental-features = [ zsh.enable = true;
"nix-command" };
"flakes"
]; environment.etc = keysFromGithub;
}; services = {
}; # Enable printer autodiscovery if printing is enabled
}; avahi = {
inherit (config.services.printing) enable;
nssmdns4 = true;
openFirewall = true;
};
openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") (
builtins.attrNames keysFromGithub
);
};
users.defaultUserShell = pkgs.zsh;
# Open ports for spotifyd
networking.firewall = {
allowedUDPPorts = [ 5353 ];
allowedTCPPorts = [ 2020 ];
};
# Nix Settings
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
# run between 0 and 45min after boot if run was missed
randomizedDelaySec = "45min";
};
settings = {
use-xdg-base-directories = true;
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
};
}
# dev configuration
(lib.mkIf cfg.dev.enable {
users.extraUsers = lib.mkIf cfg.dev.jupyter.enable { jupyter.group = "jupyter"; };
services.jupyter = {
inherit (cfg.dev.jupyter) enable;
group = "jupyter";
user = "jupyter";
};
})
]
);
} }

View file

@ -1,18 +0,0 @@
{ lib, config, ... }:
let
cfg = config.jconfig.dev;
in
{
config = lib.mkIf (config.jconfig.enable && cfg.enable) {
# Enable dev documentation
documentation.dev = { inherit (cfg) enable; };
users.extraUsers = lib.mkIf cfg.jupyter.enable { jupyter.group = "jupyter"; };
services.jupyter = {
inherit (cfg.jupyter) enable;
group = "jupyter";
user = "jupyter";
};
};
}

View file

@ -1,117 +0,0 @@
{ lib, pkgs, ... }@args:
let
cfg = args.config.jconfig.gui;
enable = args.config.jconfig.enable && cfg.enable;
linuxOlderThan6_3 = lib.versionOlder args.config.boot.kernelPackages.kernel.version "6.3";
in
{
config =
lib.flip lib.pipe
[ lib.mkMerge (lib.mkIf enable) ]
[
{
environment.systemPackages = [
pkgs.adwaita-icon-theme
pkgs.adwaita-qt
pkgs.nordzy-cursor-theme
pkgs.pinentry-qt
];
# Fix xdg-portals issue issue: https://github.com/NixOS/nixpkgs/issues/189851
systemd.user.extraConfig = ''
DefaultEnvironment="PATH=/run/wrappers/bin:/etc/profiles/per-user/%u/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
'';
fonts.fontDir.enable = true;
programs = {
dconf.enable = true;
sway = {
enable = cfg.sway;
# No extra packages (by default it adds foot, dmenu, and other stuff)
extraPackages = [ ];
wrapperFeatures = {
base = true;
gtk = true;
};
};
};
security = {
polkit.enable = true;
rtkit.enable = true; # Recommended for pipewire
};
services = {
flatpak.enable = true;
# Audio
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
wireplumber.enable = true;
};
# Dbus
dbus.enable = true;
# Virtual Filesystem (for PCManFM)
gvfs.enable = true;
};
xdg.portal = {
# XDG portals
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
config.preferred = {
# Default to the gtk portal
default = "gtk";
# Use wlr for screenshots and screen recording
"org.freedesktop.impl.portal.Screenshot" = "wlr";
};
# Consider using darkman like upstream
};
hardware = {
graphics.enable = true;
uinput.enable = true;
steam-hardware.enable = cfg.steamHardwareSupport;
};
}
(lib.mkIf cfg.ydotool.enable {
environment.systemPackages = [ pkgs.ydotool ];
systemd.user.services.ydotool = {
enable = cfg.ydotool.autoStart;
wantedBy = [ "default.target" ];
description = "Generic command-line automation tool";
documentation = [
"man:ydotool(1)"
"man:ydotoold(8)"
];
serviceConfig = {
Type = "simple";
Restart = "always";
ExecStart = "${pkgs.ydotool}/bin/ydotoold";
ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
KillMode = "process";
TimeoutSec = 180;
};
};
})
(lib.mkIf (linuxOlderThan6_3 && cfg."8bitdoFix") {
# Udev rules to start or stop systemd service when controller is connected or disconnected
services.udev.extraRules = # udev
''
# May vary depending on your controller model, find product id using 'lsusb'
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl start 8bitdo-ultimate-xinput@2dc8:3106"
# This device (2dc8:3016) is "connected" when the above device disconnects
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3016", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl stop 8bitdo-ultimate-xinput@2dc8:3106"
'';
# Systemd service which starts xboxdrv in xbox360 mode
systemd.services."8bitdo-ultimate-xinput@" = {
unitConfig.Description = "8BitDo Ultimate Controller XInput mode xboxdrv daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.xboxdrv}/bin/xboxdrv --mimic-xpad --silent --type xbox360 --device-by-id %I --force-feedback";
};
};
})
];
}

View file

@ -0,0 +1,118 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.jconfig.gui;
enable = config.jconfig.enable && cfg.enable;
linuxOlderThan6_3 = lib.versionOlder config.boot.kernelPackages.kernel.version "6.3";
in
{
config = lib.mkMerge [
(lib.mkIf enable {
environment.systemPackages = [
pkgs.adwaita-icon-theme
pkgs.adwaita-qt
pkgs.nordzy-cursor-theme
pkgs.pinentry-qt
] ++ lib.optional cfg.ydotool.enable pkgs.ydotool;
systemd = {
user.services.ydotool = lib.mkIf cfg.ydotool.enable {
enable = cfg.ydotool.autoStart;
wantedBy = [ "default.target" ];
description = "Generic command-line automation tool";
documentation = [
"man:ydotool(1)"
"man:ydotoold(8)"
];
serviceConfig = {
Type = "simple";
Restart = "always";
ExecStart = "${pkgs.ydotool}/bin/ydotoold";
ExecReload = "${pkgs.util-linux}/bin/kill -HUP $MAINPID";
KillMode = "process";
TimeoutSec = 180;
};
};
# Fix xdg-portals issue issue: https://github.com/NixOS/nixpkgs/issues/189851
user.extraConfig = ''
DefaultEnvironment="PATH=/run/wrappers/bin:/etc/profiles/per-user/%u/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
'';
};
fonts.fontDir.enable = true;
programs = {
dconf.enable = true;
sway = {
enable = cfg.sway;
# No extra packages (by default it adds foot, dmenu, and other stuff)
extraPackages = [ ];
wrapperFeatures = {
base = true;
gtk = true;
};
};
};
security = {
polkit.enable = true;
rtkit.enable = true; # Recommended for pipewire
};
services = {
flatpak.enable = true;
# Audio
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
wireplumber.enable = true;
};
# Dbus
dbus.enable = true;
# Virtual Filesystem (for PCManFM)
gvfs.enable = true;
};
xdg.portal = {
# XDG portals
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
config.preferred = {
# Default to the gtk portal
default = "gtk";
# Use wlr for screenshots and screen recording
"org.freedesktop.impl.portal.Screenshot" = "wlr";
};
# Consider using darkman like upstream
};
hardware = {
graphics.enable = true;
uinput.enable = true;
steam-hardware.enable = cfg.steamHardwareSupport;
};
})
(lib.mkIf (enable && linuxOlderThan6_3 && cfg."8bitdoFix") {
# Udev rules to start or stop systemd service when controller is connected or disconnected
services.udev.extraRules = # udev
''
# May vary depending on your controller model, find product id using 'lsusb'
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl start 8bitdo-ultimate-xinput@2dc8:3106"
# This device (2dc8:3016) is "connected" when the above device disconnects
SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3016", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl stop 8bitdo-ultimate-xinput@2dc8:3106"
'';
# Systemd service which starts xboxdrv in xbox360 mode
systemd.services."8bitdo-ultimate-xinput@" = {
unitConfig.Description = "8BitDo Ultimate Controller XInput mode xboxdrv daemon";
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.xboxdrv}/bin/xboxdrv --mimic-xpad --silent --type xbox360 --device-by-id %I --force-feedback";
};
};
})
];
}

View file

@ -1,95 +1,106 @@
{ lib, ... }: { lib, ... }:
let let
inherit (lib) types; inherit (lib) types;
inherit (import ../lib.nix { inherit lib; }) # Like mkEnableOption but defaults to true
mkDisableOption mkDisableOption =
mkImageOption option:
; (lib.mkEnableOption option)
// {
default = true;
example = false;
};
mkImageOption =
{
description,
url,
sha256 ? "",
}:
lib.mkOption {
inherit description;
type = types.path;
default = builtins.fetchurl { inherit url sha256; };
defaultText = lib.literalMD "![${description}](${url})";
};
gui.options = {
enable = lib.mkEnableOption "jalil's default gui configuration.";
# Fix for using Xinput mode on 8bitdo Ultimate C controller
# Inspired by https://aur.archlinux.org/packages/8bitdo-ultimate-controller-udev
# Adapted from: https://gist.github.com/interdependence/28452fbfbe692986934fbe1e54c920d4
"8bitdoFix" = mkDisableOption "a fix for 8bitdo controllers";
steamHardwareSupport = mkDisableOption "steam hardware support";
ydotool = lib.mkOption {
description = "Jalil's default ydotool configuration.";
default = { };
type = types.submodule {
options.enable = mkDisableOption "ydotool";
options.autoStart = mkDisableOption "autostarting ydotool at login";
};
};
sway = mkDisableOption "sway";
};
styling.options = {
enable = mkDisableOption "jalil's default styling (disables stylix)";
wallpaper = mkImageOption {
description = "The wallpaper to use.";
url = "https://raw.githubusercontent.com/lunik1/nixos-logo-gruvbox-wallpaper/d4937c424fad79c1136a904599ba689fcf8d0fad/png/gruvbox-dark-rainbow.png";
sha256 = "036gqhbf6s5ddgvfbgn6iqbzgizssyf7820m5815b2gd748jw8zc";
};
bootLogo = mkImageOption {
description = "The logo used by plymouth at boot.";
# http://xenia-linux-site.glitch.me/images/cathodegaytube-splash.png
url = "https://efimero.github.io/xenia-images/cathodegaytube-splash.png";
sha256 = "qKugUfdRNvMwSNah+YmMepY3Nj6mWlKFh7jlGlAQDo8=";
};
};
config.options = {
enable = lib.mkEnableOption "jalil's default configuration.";
dev = lib.mkOption {
description = "Options for setting up a dev environment";
default = { };
type = types.submodule {
options.enable = lib.mkEnableOption "dev configuration";
options.jupyter.enable = lib.mkEnableOption "jupyter configuration";
};
};
gui = lib.mkOption {
description = "Jalil's default configuration for a NixOS gui.";
default = { };
type = types.submodule gui;
};
styling = lib.mkOption {
description = "Jalil's styling options";
default = { };
type = types.submodule styling;
};
importSSHKeysFromGithub = lib.mkOption {
description = ''
Import public ssh keys from a github username.
This will fetch the keys from https://github.com/$${username}.keys.
The format is `"$${github-username}" = $${sha256-hash}`. The example
will try to fetch the keys from <https://github.com/jalil-salame.keys>.
**Warning**: this will interfere with services like gitea that override
the default ssh behaviour. In that case you want to use
`users.users.<name>.openssh.authorizedKeys.keyFiles` on the users you
want to allow ssh logins.
'';
default = { };
example = {
"jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
};
type = types.attrsOf types.str;
};
};
in in
{ {
options.jconfig = lib.mkOption { options.jconfig = lib.mkOption {
description = "Jalil's default NixOS configuration."; description = "Jalil's default NixOS configuration.";
default = { }; default = { };
type = types.submodule { type = types.submodule config;
options = {
enable = lib.mkEnableOption "jalil's default configuration.";
importSSHKeysFromGithub = lib.mkOption {
description = ''
Import public ssh keys from a github username.
This will fetch the keys from https://github.com/$${username}.keys.
The format is `"$${github-username}" = $${sha256-hash}`. The example
will try to fetch the keys from <https://github.com/jalil-salame.keys>.
**Warning**: this will interfere with services like gitea that override
the default ssh behaviour. In that case you want to use
`users.users.<name>.openssh.authorizedKeys.keyFiles` on the users you
want to allow ssh logins.
'';
default = { };
example = {
"jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
};
type = types.attrsOf types.str;
};
dev = lib.mkOption {
description = "Options for setting up a dev environment";
default = { };
type = types.submodule {
options = {
enable = lib.mkEnableOption "dev configuration";
jupyter.enable = lib.mkEnableOption "jupyter configuration";
};
};
};
gui = lib.mkOption {
description = "Jalil's default configuration for a NixOS gui.";
default = { };
type = types.submodule {
options = {
enable = lib.mkEnableOption "jalil's default gui configuration.";
# Fix for using Xinput mode on 8bitdo Ultimate C controller
# Inspired by https://aur.archlinux.org/packages/8bitdo-ultimate-controller-udev
# Adapted from: https://gist.github.com/interdependence/28452fbfbe692986934fbe1e54c920d4
"8bitdoFix" = mkDisableOption "a fix for 8bitdo controllers";
steamHardwareSupport = mkDisableOption "steam hardware support";
ydotool = lib.mkOption {
description = "Jalil's default ydotool configuration.";
default = { };
type = types.submodule {
options.enable = mkDisableOption "ydotool";
options.autoStart = mkDisableOption "autostarting ydotool at login";
};
};
sway = mkDisableOption "sway";
};
};
};
styling = lib.mkOption {
description = "Jalil's styling options";
default = { };
type = types.submodule {
options = {
enable = mkDisableOption "jalil's default styling (disables stylix)";
wallpaper = mkImageOption {
description = "The wallpaper to use.";
url = "https://raw.githubusercontent.com/lunik1/nixos-logo-gruvbox-wallpaper/d4937c424fad79c1136a904599ba689fcf8d0fad/png/gruvbox-dark-rainbow.png";
sha256 = "036gqhbf6s5ddgvfbgn6iqbzgizssyf7820m5815b2gd748jw8zc";
};
bootLogo = mkImageOption {
description = "The logo used by plymouth at boot.";
# http://xenia-linux-site.glitch.me/images/cathodegaytube-splash.png
url = "https://efimero.github.io/xenia-images/cathodegaytube-splash.png";
sha256 = "qKugUfdRNvMwSNah+YmMepY3Nj6mWlKFh7jlGlAQDo8=";
};
};
};
};
};
};
}; };
} }

View file

@ -1,43 +0,0 @@
{ lib, pkgs, ... }@args:
let
cfg = args.config.jconfig.styling;
enable = args.config.jconfig.enable && cfg.enable;
in
{
config = lib.mkIf enable {
boot.plymouth = { inherit (cfg) enable; };
stylix = {
inherit (cfg) enable;
image = cfg.wallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
polarity = "dark";
fonts = {
monospace = {
name = "JetBrains Mono";
package = pkgs.jetbrains-mono;
};
sansSerif = {
name = "Noto Sans";
package = pkgs.noto-fonts;
};
serif = {
name = "Noto Serif";
package = pkgs.noto-fonts;
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
sizes.popups = 12;
};
targets = {
plymouth = {
logoAnimated = false;
logo = cfg.bootLogo;
};
nixvim.enable = false;
};
};
};
}

View file

@ -0,0 +1,36 @@
{ config, pkgs }:
let
cfg = config.jconfig.styling;
in
{
inherit (cfg) enable;
image = cfg.wallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
polarity = "dark";
fonts = {
monospace = {
name = "JetBrains Mono";
package = pkgs.jetbrains-mono;
};
sansSerif = {
name = "Noto Sans";
package = pkgs.noto-fonts;
};
serif = {
name = "Noto Serif";
package = pkgs.noto-fonts;
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
sizes.popups = 12;
};
targets = {
plymouth = {
logoAnimated = false;
logo = cfg.bootLogo;
};
nixvim.enable = false;
};
}

View file

@ -21,7 +21,6 @@ let
"typos_lsp" "typos_lsp"
# "typst_lsp" # Not using it # "typst_lsp" # Not using it
"zls" "zls"
"fish_lsp"
]; ];
in in
{ {
@ -96,7 +95,6 @@ in
pkgs.stylua pkgs.stylua
pkgs.taplo pkgs.taplo
pkgs.yamlfmt pkgs.yamlfmt
pkgs.fish
]; ];
plugins.conform-nvim = { plugins.conform-nvim = {
enable = true; enable = true;
@ -113,7 +111,6 @@ in
toml = [ "taplo" ]; toml = [ "taplo" ];
yaml = [ "yamlfmt" ]; yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ]; zig = [ "zigfmt" ];
fish = [ "fish_indent" ];
}; };
}; };
}; };
@ -130,6 +127,7 @@ in
# latex = [ "chktex" ]; # Not in use # latex = [ "chktex" ]; # Not in use
nix = [ "statix" ]; nix = [ "statix" ];
sh = [ "dash" ]; sh = [ "dash" ];
zsh = [ "zsh" ];
}; };
}; };
} }

View file

@ -4,102 +4,129 @@ let
in in
{ {
config.plugins = { config.plugins = {
cmp = cmp = {
let enable = true;
srcWithIndex = groupIndex: name: { inherit name groupIndex; }; cmdline = {
in "/" = {
{
enable = true;
cmdline = {
"/" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "rg"; }
{ name = "buffer"; }
];
};
":" = {
mapping =
mkRaw
# lua
"cmp.mapping.preset.cmdline()";
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
};
};
settings = {
# Snippets
snippet.expand =
# lua
"function(args) require('luasnip').lsp_expand(args.body) end";
# Completion Sources
sources = [
# very specific (not noisy)
(srcWithIndex 1 "calc")
(srcWithIndex 1 "crates")
(srcWithIndex 1 "fish")
(srcWithIndex 1 "luasnip")
(srcWithIndex 1 "nvim_lsp")
# Generally ok
(srcWithIndex 2 "conventionalcommits")
(srcWithIndex 2 "nvim_lsp_document_symbol")
(srcWithIndex 2 "nvim_lsp_signature_help")
# Noisy
(srcWithIndex 2 "path")
(srcWithIndex 3 "spell")
(srcWithIndex 3 "treesitter")
# Very noisy
(srcWithIndex 4 "buffer")
];
mapping = mapping =
mkRaw mkRaw
# lua # lua
'' ''
cmp.mapping.preset.insert({ cmp.mapping.preset.cmdline()
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end,
["<C-u>"] = cmp.mapping(function(fallback)
if require("luasnip").choice_active() then
require("luasnip").next_choice()
else
fallback()
end
end),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete { },
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
})
''; '';
sources = [
{ name = "rg"; }
{ name = "buffer"; }
];
};
":" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
}; };
}; };
cmp-fish.enable = true; settings = {
# Snippets
snippet.expand =
# lua
''
function(args) require('luasnip').lsp_expand(args.body) end
'';
# Completion Sources
sources = [
{
name = "buffer";
groupIndex = 3;
}
{
name = "calc";
groupIndex = 2;
}
{
name = "conventionalcommits";
groupIndex = 1;
}
{
name = "crates";
groupIndex = 1;
}
{
name = "luasnip";
groupIndex = 1;
}
{
name = "nvim_lsp";
groupIndex = 1;
}
{
name = "nvim_lsp_document_symbol";
groupIndex = 1;
}
{
name = "nvim_lsp_signature_help";
groupIndex = 1;
}
{
name = "path";
groupIndex = 2;
}
{
name = "spell";
groupIndex = 2;
}
{
name = "treesitter";
groupIndex = 2;
}
];
mapping =
mkRaw
# lua
''
cmp.mapping.preset.insert({
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end,
["<C-u>"] = cmp.mapping(function(fallback)
if require("luasnip").choice_active() then
require("luasnip").next_choice()
else
fallback()
end
end),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete { },
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
})
'';
};
};
gitsigns.enable = true; gitsigns.enable = true;
lualine = { lualine = {
enable = true; enable = true;

View file

@ -116,9 +116,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.35" version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -126,9 +126,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.35" version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -281,9 +281,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.21.3" version = "1.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
[[package]] [[package]]
name = "os_pipe" name = "os_pipe"

View file

@ -124,9 +124,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.35" version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -134,9 +134,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.35" version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -293,9 +293,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]] [[package]]
name = "jiff" name = "jiff"
version = "0.2.5" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e"
dependencies = [ dependencies = [
"jiff-static", "jiff-static",
"log", "log",
@ -306,9 +306,9 @@ dependencies = [
[[package]] [[package]]
name = "jiff-static" name = "jiff-static"
version = "0.2.5" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -341,9 +341,9 @@ checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.27" version = "0.4.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
[[package]] [[package]]
name = "memchr" name = "memchr"
@ -402,9 +402,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.21.3" version = "1.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
[[package]] [[package]]
name = "os_pipe" name = "os_pipe"