Compare commits

..

26 commits

Author SHA1 Message Date
dbea825ed3
wip: niri take 2
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 15s
/ build-vm (push) Successful in 7m28s
/ report-size (push) Successful in 1m8s
Take two, since one wasn't enough.
2025-04-01 20:06:42 +02:00
3c8d299f22
fix(deps): update rust crate clap to v4.5.35
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 5s
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| crate      | clap    | 4.5.34 | 4.5.35 |
2025-04-01 19:20:09 +02:00
12675acc21
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 15s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
2025-04-01 00:00:31 +02:00
7ff376d0f3
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
2025-03-31 00:00:15 +02:00
b489a09085
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 10s
/ check-renovaterc (push) Successful in 4s
/ build-packages (push) Successful in 15s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 5s
2025-03-30 00:19:55 +01:00
57b7e9f151
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 4s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
2025-03-30 00:00:16 +01:00
e8299f98b0
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
2025-03-29 00:00:14 +01:00
b51df570e1
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 10s
/ check-renovaterc (push) Successful in 5s
/ build-packages (push) Successful in 15s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
2025-03-28 00:00:32 +01:00
7b93918ac0
fix: update lix-module to pull overlay fixes
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
The overlay was broken and it was causing the configuration to fail to
build.

Hopefully now I fixed the CI issues that caused the automerge to work
even though CI was failing, and this won't happen again.
2025-03-27 22:10:54 +01:00
8801e1ce0e
fix(deps): update rust crate clap to v4.5.34
Some checks failed
/ check (push) Successful in 10s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Failing after 3s
/ report-size (push) Has been skipped
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| crate      | clap    | 4.5.33 | 4.5.34 |
2025-03-27 03:10:10 +01:00
5b06bb7d65
chore(deps): lock file maintenance
Some checks failed
/ check (push) Successful in 10s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Failing after 2s
/ report-size (push) Has been skipped
2025-03-27 00:00:15 +01:00
0c4fb0948f
fix(deps): update rust crate clap to v4.5.33
Some checks failed
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 4s
/ build-packages (push) Successful in 14s
/ build-vm (push) Failing after 2s
/ report-size (push) Has been skipped
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| crate      | clap    | 4.5.32 | 4.5.33 |
2025-03-26 20:30:11 +01:00
8f3fe0c6f1
chore(deps): lock file maintenance
Some checks failed
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Failing after 1s
/ report-size (push) Has been skipped
2025-03-26 00:00:14 +01:00
3753304eab
chore(deps): lock file maintenance
Some checks failed
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 15s
/ build-vm (push) Failing after 3s
/ report-size (push) Has been skipped
2025-03-25 00:00:24 +01:00
cd4fb19335
feat: switch to fish as an interactive shell
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 4s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
Now that it is written in Rust I am interested!
2025-03-24 21:16:23 +01:00
6bf3851d5a
fix(deps): update rust crate log to v0.4.27
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 5s
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| crate      | log     | 0.4.26 | 0.4.27 |
2025-03-24 10:50:11 +01:00
d089abd113
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
2025-03-24 00:00:10 +01:00
a7195317a1 chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 2s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
2025-03-23 17:10:38 +01:00
4ce7e35327
fix: typo
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
Hopefully last issue??
2025-03-22 03:11:03 +01:00
aa77690b7a
fix: small error that slipped by
All checks were successful
/ check (push) Successful in 8s
/ check-renovaterc (push) Successful in 2s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
Leftover from the refactor T-T
2025-03-22 03:06:32 +01:00
843cfda2ad
docs: add nuschtosSearch to book
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 4s
This provides a nice option search.
2025-03-22 02:52:08 +01:00
6116711cbd
chore(deps): lock file maintenance
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
2025-03-22 00:00:39 +01:00
17ef89c1a0
fix(modules/hm): don't set stateVersion
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 2s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
Prefer setting it on the configuration. Also bump the example-vm to
stateVersion 24.11.
2025-03-21 19:19:24 +01:00
0df4e76404
refactor(modules/hm): tidy up the modules
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
Should make further additions and refactors easier.
2025-03-21 19:09:56 +01:00
917d131cde
refactor(modules/nixos): move stuff around
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 14s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
This makes the module a bit clearer and easier to extend.
2025-03-21 18:45:47 +01:00
673f989e99
ci: remove magic-nix-cache-action
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 1s
/ report-size (push) Successful in 4s
It is deprecated due to the GitHub cache v1 API sunsetting
2025-03-21 17:21:44 +01:00
25 changed files with 752 additions and 669 deletions

View file

@ -16,7 +16,6 @@ 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
@ -25,7 +24,6 @@ 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 module" title = "Jalil's NixOS configuration modules"
[preprocessor.toc] [preprocessor.toc]
command = "mdbook-toc" command = "mdbook-toc"

View file

@ -1,6 +1,9 @@
# 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,6 +16,7 @@
home = { home = {
username = "jdoe"; username = "jdoe";
homeDirectory = "/home/jdoe"; homeDirectory = "/home/jdoe";
stateVersion = "24.11";
}; };
jhome = { jhome = {
enable = true; enable = true;

View file

@ -1,46 +1,50 @@
{ lib, inputs, ... }: { lib, ... }:
{ {
perSystem = perSystem =
{ pkgs, ... }: { inputs', 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; };
home-eval = lib.evalModules { genOptionsDoc =
modules = [ (modules + "/hm/options.nix") ]; toplevelOption: module:
specialArgs = { pkgs.nixosOptionsDoc {
inherit pkgs; inherit (lib.evalModules { modules = [ module ]; }) options;
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/";
}; };
nvim-eval = lib.evalModules { modules = [ (modules + "/nixvim/options.nix") ]; }; search = inputs'.nuschtosSearch.packages.mkMultiSearch {
nixos-eval = lib.evalModules { modules = [ (modules + "/nixos/options.nix") ]; }; title = "Search Jalil's configuration.nix";
home-markdown = baseHref = "/";
(pkgs.nixosOptionsDoc {
inherit (home-eval) options; scopes = [
transformOptions = filterVisible "jhome"; (mkScope "NixOS" nixos)
}).optionsCommonMark; (mkScope "Home-Manager" home)
nvim-markdown = (mkScope "NixVIM" nvim)
(pkgs.nixosOptionsDoc { ];
inherit (nvim-eval) options; };
transformOptions = filterVisible "jhome"; home = genOptionsDoc "jhome" ../modules/hm/options.nix;
}).optionsCommonMark; nvim = genOptionsDoc "jhome" ../modules/nixvim/options.nix;
nixos-markdown = nixos = genOptionsDoc "jconfig" ../modules/nixos/options.nix;
(pkgs.nixosOptionsDoc { nixos-markdown = nixos.optionsCommonMark;
inherit (nixos-eval) options; home-markdown = home.optionsCommonMark;
transformOptions = filterVisible "jconfig"; nvim-markdown = nvim.optionsCommonMark;
}).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 = inputs.self + "/docs"; src = ../docs;
patchPhase = '' patchPhase = ''
cleanup_md() { cleanup_md() {
@ -53,10 +57,12 @@
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; } { nix.registry.nixpkgs.flake = inputs.nixpkgs; } # pin nixpkgs to the one used by the system
]; ];
}; };

100
flake.lock generated
View file

@ -226,11 +226,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742234739, "lastModified": 1743387206,
"narHash": "sha256-zFL6zsf/5OztR1NSNQF33dvS1fL/BzVUjabZq4qrtY4=", "narHash": "sha256-24N3NAuZZbYqZ39NgToZgHUw6M7xHrtrAm18kv0+2Wo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f6af7280a3390e65c2ad8fd059cdc303426cbd59", "rev": "15c5f9d04fabd176f30286c8f52bbdb2c853a146",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -240,18 +240,44 @@
"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-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g=", "narHash": "sha256-pgDJZjj4jpzkFxsqBTI/9Yb0n3gW+DvDtuv9SwQZZcs=",
"rev": "2837da71ec1588c1187d2e554719b15904a46c8b", "rev": "079528098f5998ba13c88821a2eca1005c1695de",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2837da71ec1588c1187d2e554719b15904a46c8b.tar.gz?rev=2837da71ec1588c1187d2e554719b15904a46c8b" "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/079528098f5998ba13c88821a2eca1005c1695de.tar.gz?rev=079528098f5998ba13c88821a2eca1005c1695de"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/2.92.0.tar.gz" "url": "https://git.lix.systems/lix-project/lix/archive/release-2.92.tar.gz"
} }
}, },
"lix-module": { "lix-module": {
@ -264,15 +290,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1737237494, "lastModified": 1742943028,
"narHash": "sha256-YMLrcBpf0TR5r/eaqm8lxzFPap2TxCor0ZGcK3a7+b8=", "narHash": "sha256-fprwZKE1uMzO9tiWWOrmLWBW3GPkMayQfb0xOvVFIno=",
"rev": "b90bf629bbd835e61f1317b99e12f8c831017006", "rev": "3fae818597ca2f1474de62022f850c23be50528d",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/b90bf629bbd835e61f1317b99e12f8c831017006.tar.gz?rev=b90bf629bbd835e61f1317b99e12f8c831017006" "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/3fae818597ca2f1474de62022f850c23be50528d.tar.gz?rev=3fae818597ca2f1474de62022f850c23be50528d"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz" "url": "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz"
} }
}, },
"niri": { "niri": {
@ -321,11 +347,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1742388435, "lastModified": 1743367904,
"narHash": "sha256-GheQGRNYAhHsvPxWVOhAmg9lZKkis22UPbEHlmZMthg=", "narHash": "sha256-sOos1jZGKmT6xxPvxGQyPTApOunXvScV4lNjBCXd/CI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b75693fb46bfaf09e662d09ec076c5a162efa9f6", "rev": "7ffe0edc685f14b8c635e3d6591b0bbb97365e6c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -337,11 +363,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1742272065, "lastModified": 1742800061,
"narHash": "sha256-ud8vcSzJsZ/CK+r8/v0lyf4yUntVmDq6Z0A41ODfWbE=", "narHash": "sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3549532663732bfd89993204d40543e9edaec4f2", "rev": "1750f3c1c89488e2ffdd47cab9d05454dddfb734",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -360,11 +386,11 @@
"nuschtosSearch": [] "nuschtosSearch": []
}, },
"locked": { "locked": {
"lastModified": 1742488644, "lastModified": 1743362786,
"narHash": "sha256-vXpu7G4aupNCPlv8kAo7Y/jocfSUwglkvNx5cR0XjBo=", "narHash": "sha256-XbXIRDbb8/vLBX1M096l7lM5wfzBTp1ZXfUl9bUhVGU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "d44b33a1ea1a3e584a8c93164dbe0ba2ad4f3a13", "rev": "d81f37256d0a8691b837b74979d27bf89be8ecdd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -373,6 +399,31 @@
"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",
@ -381,6 +432,7 @@
"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",
@ -504,11 +556,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742370146, "lastModified": 1743081648,
"narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=", "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "adc195eef5da3606891cedf80c0d9ce2d3190808", "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7",
"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/2.92.0.tar.gz"; url = "https://git.lix.systems/lix-project/nixos-module/archive/release-2.92.tar.gz";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
flake-utils.inputs.systems.follows = "systems"; flake-utils.inputs.systems.follows = "systems";
@ -58,10 +58,19 @@
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,6 +16,7 @@ in
imports = [ imports = [
./options.nix ./options.nix
./gui ./gui
./dev.nix
./users.nix ./users.nix
]; ];
@ -23,7 +24,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 doing it myself targets.nixvim.enable = false; # I prefer styling it myself
}; };
}) })
(lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
@ -35,6 +36,7 @@ in
"settings" "settings"
"use-xdg-base-directories" "use-xdg-base-directories"
] true; ] true;
programs = { programs = {
# Better cat (bat) # Better cat (bat)
bat = { bat = {
@ -56,6 +58,11 @@ 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;
@ -73,17 +80,8 @@ 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 = {
@ -103,9 +101,8 @@ 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";
@ -127,6 +124,7 @@ in
tree = "eza --tree"; tree = "eza --tree";
}; };
}; };
# XDG directories # XDG directories
xdg = { xdg = {
enable = true; enable = true;
@ -136,86 +134,5 @@ 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}";
};
};
};
})
]; ];
} }

101
modules/hm/dev.nix Normal file
View file

@ -0,0 +1,101 @@
{
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
zsh.loginExtra = fish.loginShellInit =
lib.optionalString cfg.sway.autostart # sh lib.optionalString cfg.sway.autostart # fish
'' ''
# Start Sway on login to TTY 1 # Start Sway on login to TTY 1
if [ "$TTY" = /dev/tty1 ]; then if test "$(tty)" = /dev/tty1
exec sway exec sway
fi end
''; '';
}; };
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 swaylock --image ${cfg.background}"; "XF86ScreenSaver" = "exec ${pkgs.swaylock}/bin/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,15 +4,12 @@ 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.mkMerge [ config = lib.mkIf (jhome.enable && cfg != null) {
(lib.mkIf hasConfig { programs = {
programs.git = { 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 {
@ -20,7 +17,8 @@ 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 {
@ -29,14 +27,14 @@ in
key = signingKey; key = signingKey;
}; };
}; };
}) };
(lib.mkIf unlockKey {
xdg.configFile.pam-gnupg.text =
''
${gpgHome}
'' xdg.configFile.pam-gnupg = lib.mkIf (cfg.gpg.unlockKeys != [ ]) {
+ (lib.strings.concatLines cfg.gpg.unlockKeys); text = ''
}) ${config.programs.gpg.homedir}
];
${lib.strings.concatLines cfg.gpg.unlockKeys}
'';
};
};
} }

27
modules/lib.nix Normal file
View file

@ -0,0 +1,27 @@
{ 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,11 +1,6 @@
{ { pkgs, lib, ... }@args:
config,
pkgs,
lib,
...
}:
let let
cfg = config.jconfig; cfg = args.config.jconfig;
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: { keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
name = "pubkeys/${username}"; name = "pubkeys/${username}";
value = { value = {
@ -20,17 +15,12 @@ in
{ {
imports = [ imports = [
./options.nix ./options.nix
./gui ./dev.nix
{ stylix = import ./stylix-config.nix { inherit config pkgs; }; } ./gui.nix
./styling.nix
]; ];
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable {
lib.mkMerge [
{
boot.plymouth = {
inherit (cfg.styling) enable;
};
# Enable unlocking the gpg-agent at boot (configured through home.nix) # Enable unlocking the gpg-agent at boot (configured through home.nix)
security.pam.services.login.gnupg.enable = true; security.pam.services.login.gnupg.enable = true;
@ -44,11 +34,18 @@ in
pkgs.unzip pkgs.unzip
]; ];
# Enable dev documentation
documentation.dev = {
inherit (cfg.dev) enable;
};
programs = { programs = {
# Launch fish if shell is interactive (from https://wiki.nixos.org/wiki/Fish)
bash.interactiveShellInit = # bash
''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
# Default shell
fish.enable = true;
# Shell prompt # Shell prompt
starship = { starship = {
enable = true; enable = true;
@ -69,26 +66,23 @@ in
# Add nerdfont symbols # Add nerdfont symbols
(lib.mkIf cfg.styling.enable (import ./starship-nerdfont-symbols.nix)) (lib.mkIf cfg.styling.enable (import ./starship-nerdfont-symbols.nix))
# Remove the `in`s and `on`s from the prompt # Remove the `in`s and `on`s from the prompt
(lib.mkIf cfg.styling.enable (import ./starship-shorter-text.nix)) (import ./starship-shorter-text.nix)
]; ];
}; };
# Default shell
zsh.enable = true;
}; };
environment.etc = keysFromGithub; environment.etc = keysFromGithub;
services = { services = {
# Enable printer autodiscovery if printing is enabled # Enable printer autodiscovery if printing is enabled
avahi = { avahi = {
inherit (config.services.printing) enable; inherit (args.config.services.printing) enable;
nssmdns4 = true; nssmdns4 = true;
openFirewall = true; openFirewall = true;
}; };
openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") ( openssh.authorizedKeysFiles = builtins.map (keys: "/etc/${keys}") (
builtins.attrNames keysFromGithub builtins.attrNames keysFromGithub
); );
}; };
users.defaultUserShell = pkgs.zsh;
# Open ports for spotifyd # Open ports for spotifyd
networking.firewall = { networking.firewall = {
allowedUDPPorts = [ 5353 ]; allowedUDPPorts = [ 5353 ];
@ -112,16 +106,5 @@ in
]; ];
}; };
}; };
}
# 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";
}; };
})
]
);
} }

18
modules/nixos/dev.nix Normal file
View file

@ -0,0 +1,18 @@
{ 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";
};
};
}

117
modules/nixos/gui.nix Normal file
View file

@ -0,0 +1,117 @@
{ 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

@ -1,118 +0,0 @@
{
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,80 +1,18 @@
{ lib, ... }: { lib, ... }:
let let
inherit (lib) types; inherit (lib) types;
# Like mkEnableOption but defaults to true inherit (import ../lib.nix { inherit lib; })
mkDisableOption = mkDisableOption
option: mkImageOption
(lib.mkEnableOption option) ;
// { in
default = true;
example = false;
};
mkImageOption =
{ {
description, options.jconfig = lib.mkOption {
url, description = "Jalil's default NixOS configuration.";
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 = { }; default = { };
type = types.submodule { type = types.submodule {
options.enable = mkDisableOption "ydotool"; options = {
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."; 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 { importSSHKeysFromGithub = lib.mkOption {
description = '' description = ''
Import public ssh keys from a github username. Import public ssh keys from a github username.
@ -95,12 +33,63 @@ let
}; };
type = types.attrsOf types.str; type = types.attrsOf types.str;
}; };
};
in dev = lib.mkOption {
{ description = "Options for setting up a dev environment";
options.jconfig = lib.mkOption {
description = "Jalil's default NixOS configuration.";
default = { }; default = { };
type = types.submodule config; 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=";
};
};
};
};
};
};
}; };
} }

43
modules/nixos/styling.nix Normal file
View file

@ -0,0 +1,43 @@
{ 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

@ -1,36 +0,0 @@
{ 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,6 +21,7 @@ let
"typos_lsp" "typos_lsp"
# "typst_lsp" # Not using it # "typst_lsp" # Not using it
"zls" "zls"
"fish_lsp"
]; ];
in in
{ {
@ -95,6 +96,7 @@ 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;
@ -111,6 +113,7 @@ in
toml = [ "taplo" ]; toml = [ "taplo" ];
yaml = [ "yamlfmt" ]; yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ]; zig = [ "zigfmt" ];
fish = [ "fish_indent" ];
}; };
}; };
}; };
@ -127,7 +130,6 @@ in
# latex = [ "chktex" ]; # Not in use # latex = [ "chktex" ]; # Not in use
nix = [ "statix" ]; nix = [ "statix" ];
sh = [ "dash" ]; sh = [ "dash" ];
zsh = [ "zsh" ];
}; };
}; };
} }

View file

@ -4,7 +4,11 @@ let
in in
{ {
config.plugins = { config.plugins = {
cmp = { cmp =
let
srcWithIndex = groupIndex: name: { inherit name groupIndex; };
in
{
enable = true; enable = true;
cmdline = { cmdline = {
"/" = { "/" = {
@ -23,9 +27,7 @@ in
mapping = mapping =
mkRaw mkRaw
# lua # lua
'' "cmp.mapping.preset.cmdline()";
cmp.mapping.preset.cmdline()
'';
sources = [ sources = [
{ name = "path"; } { name = "path"; }
{ name = "cmdline"; } { name = "cmdline"; }
@ -36,55 +38,25 @@ in
# Snippets # Snippets
snippet.expand = snippet.expand =
# lua # lua
'' "function(args) require('luasnip').lsp_expand(args.body) end";
function(args) require('luasnip').lsp_expand(args.body) end
'';
# Completion Sources # Completion Sources
sources = [ sources = [
{ # very specific (not noisy)
name = "buffer"; (srcWithIndex 1 "calc")
groupIndex = 3; (srcWithIndex 1 "crates")
} (srcWithIndex 1 "fish")
{ (srcWithIndex 1 "luasnip")
name = "calc"; (srcWithIndex 1 "nvim_lsp")
groupIndex = 2; # Generally ok
} (srcWithIndex 2 "conventionalcommits")
{ (srcWithIndex 2 "nvim_lsp_document_symbol")
name = "conventionalcommits"; (srcWithIndex 2 "nvim_lsp_signature_help")
groupIndex = 1; # Noisy
} (srcWithIndex 2 "path")
{ (srcWithIndex 3 "spell")
name = "crates"; (srcWithIndex 3 "treesitter")
groupIndex = 1; # Very noisy
} (srcWithIndex 4 "buffer")
{
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 = mapping =
mkRaw mkRaw
@ -127,6 +99,7 @@ in
''; '';
}; };
}; };
cmp-fish.enable = 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.32" version = "4.5.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944"
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.32" version = "4.5.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -281,9 +281,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.21.1" version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[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.32" version = "4.5.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944"
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.32" version = "4.5.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -293,9 +293,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]] [[package]]
name = "jiff" name = "jiff"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260"
dependencies = [ dependencies = [
"jiff-static", "jiff-static",
"log", "log",
@ -306,9 +306,9 @@ dependencies = [
[[package]] [[package]]
name = "jiff-static" name = "jiff-static"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -341,9 +341,9 @@ checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.26" version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
[[package]] [[package]]
name = "memchr" name = "memchr"
@ -402,9 +402,9 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.21.1" version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]] [[package]]
name = "os_pipe" name = "os_pipe"