├── .github
├── screenshots
│ └── neovim.png
└── workflows
│ └── ci.yml
├── .gitignore
├── LICENSE
├── README.md
├── assets
├── dwm-actualfullscreen.patch
├── dwm-adjacenttag.patch
├── dwm-remove-floating-indicator.patch
├── dwm-remove-layout-indicator.patch
├── dwm-savefloats-alwayscenter.patch
└── nadesiko3-package-lock.json
├── cover.jpg
├── example
├── configuration.nix
└── flake.nix
├── flake.lock
├── flake.nix
├── home
├── bat.nix
├── batsignal.nix
├── chromium.nix
├── dunst.nix
├── dwm.nix
├── editorconfig.nix
├── eza.nix
├── fcitx.nix
├── fish.nix
├── fzf.nix
├── git.nix
├── gpg.nix
├── gtk.nix
├── htop.nix
├── hypridle.nix
├── hyprland.nix
├── hyprlock.nix
├── ironbar.nix
├── kitty.nix
├── librewolf.nix
├── mime-apps.nix
├── mpdris2.nix
├── mpv.nix
├── neovim.nix
├── picom.nix
├── pqiv.nix
├── presenterm.nix
├── ripgrep.nix
├── rmpc.nix
├── rofi.nix
├── starship.nix
├── thunar.nix
├── tmux.nix
├── udiskie.nix
├── xdg-user-dirs.nix
├── xresources.nix
├── yazi.nix
└── zathura.nix
├── hosts
└── laptop
│ ├── configuration.nix
│ └── hardware-configuration.nix
├── modules
├── containers.nix
├── desktop.nix
├── fonts.nix
├── hardware.nix
├── librewolf.nix
├── shell.nix
├── stylix.nix
└── system.nix
├── overlays
└── phinger-cursors.nix
├── packages
├── coord.nix
├── dunst-scripts.nix
├── mpv-websocket.nix
├── nadesiko3.nix
├── new-tab-identity.nix
├── nixf-tidy.nix
├── numen.nix
├── osu-backgrounds.nix
├── record.nix
└── stylix-background.nix
└── tests
└── neovim.nix
/.github/screenshots/neovim.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/donovanglover/nix-config/aef4a7cbd89df897af18c0e470d59eea5d51bff9/.github/screenshots/neovim.png
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: ci
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | permissions: {}
10 |
11 | jobs:
12 | build:
13 | name: nix build packages/*.nix
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v4
17 | with:
18 | persist-credentials: false
19 | - uses: cachix/install-nix-action@v27
20 | - run: basename -s .nix packages/* | sed 's/.*/.#&/' | xargs nix build
21 | test:
22 | name: nix flake check --all-systems
23 | runs-on: ubuntu-latest
24 | steps:
25 | - uses: actions/checkout@v4
26 | with:
27 | persist-credentials: false
28 | - uses: cachix/install-nix-action@v27
29 | with:
30 | extra_nix_config: "extra-platforms = aarch64-linux"
31 | - run: nix flake check --all-systems
32 | format:
33 | name: nix fmt -- --check **/*.nix
34 | runs-on: ubuntu-latest
35 | steps:
36 | - uses: actions/checkout@v4
37 | with:
38 | persist-credentials: false
39 | - uses: cachix/install-nix-action@v27
40 | - run: nix fmt -- --check **/*.nix
41 | example:
42 | name: nix flake check ./example
43 | runs-on: ubuntu-latest
44 | steps:
45 | - uses: actions/checkout@v4
46 | with:
47 | persist-credentials: false
48 | - uses: cachix/install-nix-action@v27
49 | - run: cp ./hosts/laptop/hardware-configuration.nix ./example/hardware-configuration.nix
50 | - run: git add .
51 | - run: nix flake check ./example --no-write-lock-file --override-input nix-config "git+file://$(pwd | sed -e 's/\s/%20/g')?shallow=1"
52 | statix:
53 | name: statix check
54 | runs-on: ubuntu-latest
55 | steps:
56 | - uses: actions/checkout@v4
57 | with:
58 | persist-credentials: false
59 | - uses: cachix/install-nix-action@v27
60 | - run: nix run nixpkgs#statix check
61 | nixd:
62 | name: nixf-tidy --variable-lookup
63 | runs-on: ubuntu-latest
64 | steps:
65 | - uses: actions/checkout@v4
66 | with:
67 | persist-credentials: false
68 | - uses: cachix/install-nix-action@v27
69 | - run: nix run .#nixf-tidy
70 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.qcow2
2 | result
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2017-2025 Donovan Glover
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nix-config
2 |
3 | My [NixOS] configuration with [Nix Flakes], [Home Manager], [Stylix], and [Hyprland].
4 |
5 | 
6 | Background art: [The market](https://www.peppercarrot.com/en/viewer/artworks__2022-02-21_The-market_by-David-Revoy.html), [In Bloom](https://www.peppercarrot.com/en/viewer/artworks__2022-03-02_In-Bloom_by-David-Revoy.html) and [Vertical cover book two screen](https://www.peppercarrot.com/en/viewer/artworks__2016-11-14_vertical-cover-book-two_screen_by-David-Revoy.html) by David Revoy − [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en).
7 |
8 | 
9 | Background art: [Video game jam](https://www.peppercarrot.com/en/viewer/misc__2023-06-12_video-game-jam_by-David-Revoy.html) by David Revoy − [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en).
10 |
11 | ## Features
12 |
13 | - Clean, readable code that can be easily modified to add/remove things as needed.
14 | - Fully reproducible and declarative environment thanks to NixOS.
15 | - Reasonably secure containers isolated from your personal files and network.
16 | - Nix Flakes + Home Manager + Btrfs on LUKS.
17 | - Simple yet effective Neovim setup with nvim-lspconfig.
18 | - Modern Wayland support with Hyprland and the master-stack layout.
19 | - Easily switch to a similar dwm config if X is necessary.
20 | - Full Japanese support with fonts, input method, and wine covered.
21 | - A universal color scheme inherited by all applications.
22 |
23 | ## Usage
24 |
25 | ```fish
26 | git clone https://github.com/donovanglover/nix-config && cd nix-config
27 | nixos-rebuild build-vm --flake .#nixos
28 | ./result/bin/run-nixos-vm
29 | ```
30 |
31 | The code base is designed to be small so it's easy to adjust things as needed. Have fun!
32 |
33 | [NixOS]: https://nixos.org/
34 | [Nix Flakes]: https://wiki.nixos.org/wiki/Flakes
35 | [Home Manager]: https://nix-community.github.io/home-manager/
36 | [Stylix]: https://danth.github.io/stylix/
37 | [Hyprland]: https://hyprland.org/
38 |
--------------------------------------------------------------------------------
/assets/dwm-actualfullscreen.patch:
--------------------------------------------------------------------------------
1 | diff --git a/config.def.h b/config.def.h
2 | index 9efa774..5150c08 100644
3 | --- a/config.def.h
4 | +++ b/config.def.h
5 | @@ -79,6 +79,7 @@ static const Key keys[] = {
6 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
7 | { MODKEY, XK_space, setlayout, {0} },
8 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
9 | + { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
10 | { MODKEY, XK_0, view, {.ui = ~0 } },
11 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
12 | { MODKEY, XK_comma, focusmon, {.i = -1 } },
13 | diff --git a/dwm.1 b/dwm.1
14 | index ddc8321..3d310ac 100644
15 | --- a/dwm.1
16 | +++ b/dwm.1
17 | @@ -116,6 +116,9 @@ Zooms/cycles focused window to/from master area (tiled layouts only).
18 | .B Mod1\-Shift\-c
19 | Close focused window.
20 | .TP
21 | +.B Mod1\-Shift\-f
22 | +Toggle fullscreen for focused window.
23 | +.TP
24 | .B Mod1\-Shift\-space
25 | Toggle focused window between tiled and floating state.
26 | .TP
27 | diff --git a/dwm.c b/dwm.c
28 | index 67c6b2b..4c20b38 100644
29 | --- a/dwm.c
30 | +++ b/dwm.c
31 | @@ -211,6 +211,7 @@ static void tagmon(const Arg *arg);
32 | static void tile(Monitor *m);
33 | static void togglebar(const Arg *arg);
34 | static void togglefloating(const Arg *arg);
35 | +static void togglefullscr(const Arg *arg);
36 | static void toggletag(const Arg *arg);
37 | static void toggleview(const Arg *arg);
38 | static void unfocus(Client *c, int setfocus);
39 | @@ -1735,6 +1736,13 @@ togglefloating(const Arg *arg)
40 | arrange(selmon);
41 | }
42 |
43 | +void
44 | +togglefullscr(const Arg *arg)
45 | +{
46 | + if(selmon->sel)
47 | + setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
48 | +}
49 | +
50 | void
51 | toggletag(const Arg *arg)
52 | {
53 |
--------------------------------------------------------------------------------
/assets/dwm-adjacenttag.patch:
--------------------------------------------------------------------------------
1 | diff --git a/config.def.h b/config.def.h
2 | index 9efa774..8d45ea7 100644
3 | --- a/config.def.h
4 | +++ b/config.def.h
5 | @@ -85,6 +85,10 @@ static const Key keys[] = {
6 | { MODKEY, XK_period, focusmon, {.i = +1 } },
7 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
8 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
9 | + { MODKEY, XK_Right, viewnext, {0} },
10 | + { MODKEY, XK_Left, viewprev, {0} },
11 | + { MODKEY|ShiftMask, XK_Right, tagtonext, {0} },
12 | + { MODKEY|ShiftMask, XK_Left, tagtoprev, {0} },
13 | TAGKEYS( XK_1, 0)
14 | TAGKEYS( XK_2, 1)
15 | TAGKEYS( XK_3, 2)
16 | diff --git a/dwm.c b/dwm.c
17 | index 67c6b2b..6fd967c 100644
18 | --- a/dwm.c
19 | +++ b/dwm.c
20 | @@ -227,6 +227,12 @@ static void updatetitle(Client *c);
21 | static void updatewindowtype(Client *c);
22 | static void updatewmhints(Client *c);
23 | static void view(const Arg *arg);
24 | +static unsigned int nexttag(void);
25 | +static unsigned int prevtag(void);
26 | +static void tagtonext(const Arg *arg);
27 | +static void tagtoprev(const Arg *arg);
28 | +static void viewnext(const Arg *arg);
29 | +static void viewprev(const Arg *arg);
30 | static Client *wintoclient(Window w);
31 | static Monitor *wintomon(Window w);
32 | static int xerror(Display *dpy, XErrorEvent *ee);
33 | @@ -1202,6 +1208,13 @@ movemouse(const Arg *arg)
34 | }
35 | }
36 |
37 | +unsigned int
38 | +nexttag(void)
39 | +{
40 | + unsigned int seltag = selmon->tagset[selmon->seltags];
41 | + return seltag == (1 << (LENGTH(tags) - 1)) ? 1 : seltag << 1;
42 | +}
43 | +
44 | Client *
45 | nexttiled(Client *c)
46 | {
47 | @@ -1218,6 +1231,13 @@ pop(Client *c)
48 | arrange(c->mon);
49 | }
50 |
51 | +unsigned int
52 | +prevtag(void)
53 | +{
54 | + unsigned int seltag = selmon->tagset[selmon->seltags];
55 | + return seltag == 1 ? (1 << (LENGTH(tags) - 1)) : seltag >> 1;
56 | +}
57 | +
58 | void
59 | propertynotify(XEvent *e)
60 | {
61 | @@ -1684,6 +1704,32 @@ tagmon(const Arg *arg)
62 | sendmon(selmon->sel, dirtomon(arg->i));
63 | }
64 |
65 | +void
66 | +tagtonext(const Arg *arg)
67 | +{
68 | + unsigned int tmp;
69 | +
70 | + if (selmon->sel == NULL)
71 | + return;
72 | +
73 | + tmp = nexttag();
74 | + tag(&(const Arg){.ui = tmp });
75 | + view(&(const Arg){.ui = tmp });
76 | +}
77 | +
78 | +void
79 | +tagtoprev(const Arg *arg)
80 | +{
81 | + unsigned int tmp;
82 | +
83 | + if (selmon->sel == NULL)
84 | + return;
85 | +
86 | + tmp = prevtag();
87 | + tag(&(const Arg){.ui = tmp });
88 | + view(&(const Arg){.ui = tmp });
89 | +}
90 | +
91 | void
92 | tile(Monitor *m)
93 | {
94 | @@ -2062,6 +2108,18 @@ view(const Arg *arg)
95 | arrange(selmon);
96 | }
97 |
98 | +void
99 | +viewnext(const Arg *arg)
100 | +{
101 | + view(&(const Arg){.ui = nexttag()});
102 | +}
103 | +
104 | +void
105 | +viewprev(const Arg *arg)
106 | +{
107 | + view(&(const Arg){.ui = prevtag()});
108 | +}
109 | +
110 | Client *
111 | wintoclient(Window w)
112 | {
113 |
--------------------------------------------------------------------------------
/assets/dwm-remove-floating-indicator.patch:
--------------------------------------------------------------------------------
1 | diff --git a/dwm.c b/dwm.c
2 | index 67c6b2b..6be8ef8 100644
3 | --- a/dwm.c
4 | +++ b/dwm.c
5 | @@ -738,8 +738,6 @@ drawbar(Monitor *m)
6 | if (m->sel) {
7 | drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
8 | drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
9 | - if (m->sel->isfloating)
10 | - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
11 | } else {
12 | drw_setscheme(drw, scheme[SchemeNorm]);
13 | drw_rect(drw, x, 0, w, bh, 1, 1);
14 |
--------------------------------------------------------------------------------
/assets/dwm-remove-layout-indicator.patch:
--------------------------------------------------------------------------------
1 | diff --git a/dwm.c b/dwm.c
2 | index 67c6b2b..da9bb87 100644
3 | --- a/dwm.c
4 | +++ b/dwm.c
5 | @@ -730,9 +730,6 @@ drawbar(Monitor *m)
6 | urg & 1 << i);
7 | x += w;
8 | }
9 | - w = TEXTW(m->ltsymbol);
10 | - drw_setscheme(drw, scheme[SchemeNorm]);
11 | - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
12 |
13 | if ((w = m->ww - tw - x) > bh) {
14 | if (m->sel) {
15 |
--------------------------------------------------------------------------------
/assets/dwm-savefloats-alwayscenter.patch:
--------------------------------------------------------------------------------
1 | diff --git a/dwm.c b/dwm.c
2 | index 67c6b2b..ed46374 100644
3 | --- a/dwm.c
4 | +++ b/dwm.c
5 | @@ -88,6 +88,7 @@ struct Client {
6 | char name[256];
7 | float mina, maxa;
8 | int x, y, w, h;
9 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */
10 | int oldx, oldy, oldw, oldh;
11 | int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid;
12 | int bw, oldbw;
13 | @@ -1068,6 +1069,12 @@ manage(Window w, XWindowAttributes *wa)
14 | updatewindowtype(c);
15 | updatesizehints(c);
16 | updatewmhints(c);
17 | + c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
18 | + c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
19 | + c->sfx = c->x;
20 | + c->sfy = c->y;
21 | + c->sfw = c->w;
22 | + c->sfh = c->h;
23 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
24 | grabbuttons(c, 0);
25 | if (!c->isfloating)
26 | @@ -1730,8 +1737,16 @@ togglefloating(const Arg *arg)
27 | return;
28 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
29 | if (selmon->sel->isfloating)
30 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y,
31 | - selmon->sel->w, selmon->sel->h, 0);
32 | + /* restore last known float dimensions */
33 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy,
34 | + selmon->sel->sfw, selmon->sel->sfh, False);
35 | + else {
36 | + /* save last known float dimensions */
37 | + selmon->sel->sfx = selmon->sel->x;
38 | + selmon->sel->sfy = selmon->sel->y;
39 | + selmon->sel->sfw = selmon->sel->w;
40 | + selmon->sel->sfh = selmon->sel->h;
41 | + }
42 | arrange(selmon);
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/donovanglover/nix-config/aef4a7cbd89df897af18c0e470d59eea5d51bff9/cover.jpg
--------------------------------------------------------------------------------
/example/configuration.nix:
--------------------------------------------------------------------------------
1 | {
2 | nix-config,
3 | pkgs,
4 | lib,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (lib) singleton mkMerge;
10 | inherit (builtins) attrValues;
11 | in
12 | {
13 | imports = with nix-config.nixosModules; [
14 | desktop
15 | fonts
16 | shell
17 | stylix
18 | system
19 | ];
20 |
21 | home-manager.sharedModules =
22 | attrValues nix-config.homeModules
23 | ++ singleton {
24 | programs.btop.enable = true;
25 | };
26 |
27 | environment.systemPackages = mkMerge [
28 | (with pkgs; [
29 | ruby
30 | php
31 | ])
32 |
33 | (with nix-config.packages.${pkgs.system}; [
34 | dunst-scripts
35 | ])
36 | ];
37 |
38 | nixpkgs.overlays = attrValues nix-config.overlays ++ [
39 | (final: prev: {
40 | btop = prev.btop.overrideAttrs (oldAttrs: {
41 | postInstall =
42 | (oldAttrs.postInstall or "")
43 | # bash
44 | + ''
45 | echo "#!/usr/bin/env sh" >> btop-overlay
46 | echo "echo 'hello world'" >> btop-overlay
47 |
48 | install -Dm755 btop-overlay $out/bin/btop-overlay
49 | '';
50 | });
51 | })
52 | ];
53 |
54 | modules.system.username = "asuna";
55 | }
56 |
--------------------------------------------------------------------------------
/example/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "An example of creating your own flake that extends this nix-config";
3 |
4 | inputs = {
5 | nix-config.url = "github:donovanglover/nix-config";
6 | };
7 |
8 | outputs =
9 | { nix-config, ... }@attrs:
10 | let
11 | inherit (nix-config.inputs) nixpkgs;
12 | inherit (nixpkgs.lib) nixosSystem optional;
13 | inherit (builtins) pathExists;
14 | in
15 | {
16 | nixosConfigurations = {
17 | hyprland = nixosSystem {
18 | system = "x86_64-linux";
19 | specialArgs = attrs;
20 |
21 | modules = [
22 | ./configuration.nix
23 | ] ++ optional (pathExists ./hardware-configuration.nix) ./hardware-configuration.nix;
24 | };
25 | };
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "base16": {
4 | "inputs": {
5 | "fromYaml": "fromYaml"
6 | },
7 | "locked": {
8 | "lastModified": 1746562888,
9 | "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=",
10 | "owner": "SenchoPens",
11 | "repo": "base16.nix",
12 | "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89",
13 | "type": "github"
14 | },
15 | "original": {
16 | "owner": "SenchoPens",
17 | "repo": "base16.nix",
18 | "type": "github"
19 | }
20 | },
21 | "base16-fish": {
22 | "flake": false,
23 | "locked": {
24 | "lastModified": 1622559957,
25 | "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
26 | "owner": "tomyun",
27 | "repo": "base16-fish",
28 | "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
29 | "type": "github"
30 | },
31 | "original": {
32 | "owner": "tomyun",
33 | "repo": "base16-fish",
34 | "type": "github"
35 | }
36 | },
37 | "base16-helix": {
38 | "flake": false,
39 | "locked": {
40 | "lastModified": 1748408240,
41 | "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=",
42 | "owner": "tinted-theming",
43 | "repo": "base16-helix",
44 | "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e",
45 | "type": "github"
46 | },
47 | "original": {
48 | "owner": "tinted-theming",
49 | "repo": "base16-helix",
50 | "type": "github"
51 | }
52 | },
53 | "base16-vim": {
54 | "flake": false,
55 | "locked": {
56 | "lastModified": 1732806396,
57 | "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=",
58 | "owner": "tinted-theming",
59 | "repo": "base16-vim",
60 | "rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
61 | "type": "github"
62 | },
63 | "original": {
64 | "owner": "tinted-theming",
65 | "repo": "base16-vim",
66 | "rev": "577fe8125d74ff456cf942c733a85d769afe58b7",
67 | "type": "github"
68 | }
69 | },
70 | "firefox-gnome-theme": {
71 | "flake": false,
72 | "locked": {
73 | "lastModified": 1748383148,
74 | "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=",
75 | "owner": "rafaelmardojai",
76 | "repo": "firefox-gnome-theme",
77 | "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf",
78 | "type": "github"
79 | },
80 | "original": {
81 | "owner": "rafaelmardojai",
82 | "repo": "firefox-gnome-theme",
83 | "type": "github"
84 | }
85 | },
86 | "flake-compat": {
87 | "locked": {
88 | "lastModified": 1747046372,
89 | "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
90 | "owner": "edolstra",
91 | "repo": "flake-compat",
92 | "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
93 | "type": "github"
94 | },
95 | "original": {
96 | "owner": "edolstra",
97 | "repo": "flake-compat",
98 | "type": "github"
99 | }
100 | },
101 | "flake-parts": {
102 | "inputs": {
103 | "nixpkgs-lib": [
104 | "stylix",
105 | "nixpkgs"
106 | ]
107 | },
108 | "locked": {
109 | "lastModified": 1743550720,
110 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
111 | "owner": "hercules-ci",
112 | "repo": "flake-parts",
113 | "rev": "c621e8422220273271f52058f618c94e405bb0f5",
114 | "type": "github"
115 | },
116 | "original": {
117 | "owner": "hercules-ci",
118 | "repo": "flake-parts",
119 | "type": "github"
120 | }
121 | },
122 | "fromYaml": {
123 | "flake": false,
124 | "locked": {
125 | "lastModified": 1731966426,
126 | "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=",
127 | "owner": "SenchoPens",
128 | "repo": "fromYaml",
129 | "rev": "106af9e2f715e2d828df706c386a685698f3223b",
130 | "type": "github"
131 | },
132 | "original": {
133 | "owner": "SenchoPens",
134 | "repo": "fromYaml",
135 | "type": "github"
136 | }
137 | },
138 | "git-hooks": {
139 | "inputs": {
140 | "flake-compat": [
141 | "stylix",
142 | "flake-compat"
143 | ],
144 | "gitignore": "gitignore",
145 | "nixpkgs": [
146 | "stylix",
147 | "nixpkgs"
148 | ]
149 | },
150 | "locked": {
151 | "lastModified": 1747372754,
152 | "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
153 | "owner": "cachix",
154 | "repo": "git-hooks.nix",
155 | "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
156 | "type": "github"
157 | },
158 | "original": {
159 | "owner": "cachix",
160 | "repo": "git-hooks.nix",
161 | "type": "github"
162 | }
163 | },
164 | "gitignore": {
165 | "inputs": {
166 | "nixpkgs": [
167 | "stylix",
168 | "git-hooks",
169 | "nixpkgs"
170 | ]
171 | },
172 | "locked": {
173 | "lastModified": 1709087332,
174 | "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
175 | "owner": "hercules-ci",
176 | "repo": "gitignore.nix",
177 | "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
178 | "type": "github"
179 | },
180 | "original": {
181 | "owner": "hercules-ci",
182 | "repo": "gitignore.nix",
183 | "type": "github"
184 | }
185 | },
186 | "gnome-shell": {
187 | "flake": false,
188 | "locked": {
189 | "lastModified": 1744584021,
190 | "narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=",
191 | "owner": "GNOME",
192 | "repo": "gnome-shell",
193 | "rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae",
194 | "type": "github"
195 | },
196 | "original": {
197 | "owner": "GNOME",
198 | "ref": "48.1",
199 | "repo": "gnome-shell",
200 | "type": "github"
201 | }
202 | },
203 | "home-manager": {
204 | "inputs": {
205 | "nixpkgs": [
206 | "nixpkgs"
207 | ]
208 | },
209 | "locked": {
210 | "lastModified": 1748925027,
211 | "narHash": "sha256-BJ0qRIdvt5aeqm3zg/5if7b5rruG05zrSX3UpLqjDRk=",
212 | "owner": "nix-community",
213 | "repo": "home-manager",
214 | "rev": "cb809ec1ff15cf3237c6592af9bbc7e4d983e98c",
215 | "type": "github"
216 | },
217 | "original": {
218 | "owner": "nix-community",
219 | "repo": "home-manager",
220 | "type": "github"
221 | }
222 | },
223 | "nixpkgs": {
224 | "locked": {
225 | "lastModified": 1748693115,
226 | "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
227 | "owner": "NixOS",
228 | "repo": "nixpkgs",
229 | "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
230 | "type": "github"
231 | },
232 | "original": {
233 | "owner": "NixOS",
234 | "ref": "nixos-unstable",
235 | "repo": "nixpkgs",
236 | "type": "github"
237 | }
238 | },
239 | "nur": {
240 | "inputs": {
241 | "flake-parts": [
242 | "stylix",
243 | "flake-parts"
244 | ],
245 | "nixpkgs": [
246 | "stylix",
247 | "nixpkgs"
248 | ],
249 | "treefmt-nix": "treefmt-nix"
250 | },
251 | "locked": {
252 | "lastModified": 1748730660,
253 | "narHash": "sha256-5LKmRYKdPuhm8j5GFe3AfrJL8dd8o57BQ34AGjJl1R0=",
254 | "owner": "nix-community",
255 | "repo": "NUR",
256 | "rev": "2c0bc52fe14681e9ef60e3553888c4f086e46ecb",
257 | "type": "github"
258 | },
259 | "original": {
260 | "owner": "nix-community",
261 | "repo": "NUR",
262 | "type": "github"
263 | }
264 | },
265 | "root": {
266 | "inputs": {
267 | "home-manager": "home-manager",
268 | "nixpkgs": "nixpkgs",
269 | "sakaya": "sakaya",
270 | "stylix": "stylix"
271 | }
272 | },
273 | "sakaya": {
274 | "inputs": {
275 | "nixpkgs": [
276 | "nixpkgs"
277 | ]
278 | },
279 | "locked": {
280 | "lastModified": 1746120897,
281 | "narHash": "sha256-joPvzJwuCE0thZzKPSsK5k37EIIYHomx+Y8t+gZunLk=",
282 | "owner": "donovanglover",
283 | "repo": "sakaya",
284 | "rev": "449d31702e9d91219eb3f005087308972fb6d7f2",
285 | "type": "github"
286 | },
287 | "original": {
288 | "owner": "donovanglover",
289 | "repo": "sakaya",
290 | "type": "github"
291 | }
292 | },
293 | "stylix": {
294 | "inputs": {
295 | "base16": "base16",
296 | "base16-fish": "base16-fish",
297 | "base16-helix": "base16-helix",
298 | "base16-vim": "base16-vim",
299 | "firefox-gnome-theme": "firefox-gnome-theme",
300 | "flake-compat": "flake-compat",
301 | "flake-parts": "flake-parts",
302 | "git-hooks": "git-hooks",
303 | "gnome-shell": "gnome-shell",
304 | "home-manager": [
305 | "home-manager"
306 | ],
307 | "nixpkgs": [
308 | "nixpkgs"
309 | ],
310 | "nur": "nur",
311 | "systems": "systems",
312 | "tinted-foot": "tinted-foot",
313 | "tinted-kitty": "tinted-kitty",
314 | "tinted-schemes": "tinted-schemes",
315 | "tinted-tmux": "tinted-tmux",
316 | "tinted-zed": "tinted-zed"
317 | },
318 | "locked": {
319 | "lastModified": 1748887638,
320 | "narHash": "sha256-AExfT8rMb6Ya37Gm3dimm+e4eeLGzya55JS6VWb3nfQ=",
321 | "owner": "danth",
322 | "repo": "stylix",
323 | "rev": "3ca2c4478a1e984d2007c57467c6986bcdcb2629",
324 | "type": "github"
325 | },
326 | "original": {
327 | "owner": "danth",
328 | "repo": "stylix",
329 | "type": "github"
330 | }
331 | },
332 | "systems": {
333 | "locked": {
334 | "lastModified": 1681028828,
335 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
336 | "owner": "nix-systems",
337 | "repo": "default",
338 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
339 | "type": "github"
340 | },
341 | "original": {
342 | "owner": "nix-systems",
343 | "repo": "default",
344 | "type": "github"
345 | }
346 | },
347 | "tinted-foot": {
348 | "flake": false,
349 | "locked": {
350 | "lastModified": 1726913040,
351 | "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=",
352 | "owner": "tinted-theming",
353 | "repo": "tinted-foot",
354 | "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
355 | "type": "github"
356 | },
357 | "original": {
358 | "owner": "tinted-theming",
359 | "repo": "tinted-foot",
360 | "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
361 | "type": "github"
362 | }
363 | },
364 | "tinted-kitty": {
365 | "flake": false,
366 | "locked": {
367 | "lastModified": 1735730497,
368 | "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=",
369 | "owner": "tinted-theming",
370 | "repo": "tinted-kitty",
371 | "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa",
372 | "type": "github"
373 | },
374 | "original": {
375 | "owner": "tinted-theming",
376 | "repo": "tinted-kitty",
377 | "type": "github"
378 | }
379 | },
380 | "tinted-schemes": {
381 | "flake": false,
382 | "locked": {
383 | "lastModified": 1748180480,
384 | "narHash": "sha256-7n0XiZiEHl2zRhDwZd/g+p38xwEoWtT0/aESwTMXWG4=",
385 | "owner": "tinted-theming",
386 | "repo": "schemes",
387 | "rev": "87d652edd26f5c0c99deda5ae13dfb8ece2ffe31",
388 | "type": "github"
389 | },
390 | "original": {
391 | "owner": "tinted-theming",
392 | "repo": "schemes",
393 | "type": "github"
394 | }
395 | },
396 | "tinted-tmux": {
397 | "flake": false,
398 | "locked": {
399 | "lastModified": 1748740859,
400 | "narHash": "sha256-OEM12bg7F4N5WjZOcV7FHJbqRI6jtCqL6u8FtPrlZz4=",
401 | "owner": "tinted-theming",
402 | "repo": "tinted-tmux",
403 | "rev": "57d5f9683ff9a3b590643beeaf0364da819aedda",
404 | "type": "github"
405 | },
406 | "original": {
407 | "owner": "tinted-theming",
408 | "repo": "tinted-tmux",
409 | "type": "github"
410 | }
411 | },
412 | "tinted-zed": {
413 | "flake": false,
414 | "locked": {
415 | "lastModified": 1725758778,
416 | "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=",
417 | "owner": "tinted-theming",
418 | "repo": "base16-zed",
419 | "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9",
420 | "type": "github"
421 | },
422 | "original": {
423 | "owner": "tinted-theming",
424 | "repo": "base16-zed",
425 | "type": "github"
426 | }
427 | },
428 | "treefmt-nix": {
429 | "inputs": {
430 | "nixpkgs": [
431 | "stylix",
432 | "nur",
433 | "nixpkgs"
434 | ]
435 | },
436 | "locked": {
437 | "lastModified": 1733222881,
438 | "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
439 | "owner": "numtide",
440 | "repo": "treefmt-nix",
441 | "rev": "49717b5af6f80172275d47a418c9719a31a78b53",
442 | "type": "github"
443 | },
444 | "original": {
445 | "owner": "numtide",
446 | "repo": "treefmt-nix",
447 | "type": "github"
448 | }
449 | }
450 | },
451 | "root": "root",
452 | "version": 7
453 | }
454 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | inputs = {
3 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4 |
5 | home-manager = {
6 | url = "github:nix-community/home-manager";
7 | inputs.nixpkgs.follows = "nixpkgs";
8 | };
9 |
10 | stylix = {
11 | url = "github:danth/stylix";
12 |
13 | inputs = {
14 | nixpkgs.follows = "nixpkgs";
15 | home-manager.follows = "home-manager";
16 | };
17 | };
18 |
19 | sakaya = {
20 | url = "github:donovanglover/sakaya";
21 | inputs.nixpkgs.follows = "nixpkgs";
22 | };
23 | };
24 |
25 | outputs =
26 | { self, nixpkgs, ... }:
27 | let
28 | inherit (nixpkgs.lib) nixosSystem genAttrs replaceStrings;
29 | inherit (nixpkgs.lib.filesystem) packagesFromDirectoryRecursive listFilesRecursive;
30 |
31 | forAllSystems =
32 | function:
33 | genAttrs [
34 | "x86_64-linux"
35 | "aarch64-linux"
36 | ] (system: function nixpkgs.legacyPackages.${system});
37 |
38 | nameOf = path: replaceStrings [ ".nix" ] [ "" ] (baseNameOf (toString path));
39 | in
40 | {
41 | packages = forAllSystems (
42 | pkgs:
43 | packagesFromDirectoryRecursive {
44 | inherit (pkgs) callPackage;
45 |
46 | directory = ./packages;
47 | }
48 | );
49 |
50 | nixosModules = genAttrs (map nameOf (listFilesRecursive ./modules)) (
51 | name: import ./modules/${name}.nix
52 | );
53 |
54 | homeModules = genAttrs (map nameOf (listFilesRecursive ./home)) (name: import ./home/${name}.nix);
55 |
56 | overlays = genAttrs (map nameOf (listFilesRecursive ./overlays)) (
57 | name: import ./overlays/${name}.nix
58 | );
59 |
60 | checks = forAllSystems (
61 | pkgs:
62 | genAttrs (map nameOf (listFilesRecursive ./tests)) (
63 | name:
64 | import ./tests/${name}.nix {
65 | inherit self pkgs;
66 | }
67 | )
68 | );
69 |
70 | nixosConfigurations = {
71 | nixos = nixosSystem {
72 | system = "x86_64-linux";
73 | specialArgs.nix-config = self;
74 | modules = listFilesRecursive ./hosts/laptop;
75 | };
76 | };
77 |
78 | formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
79 | };
80 | }
81 |
--------------------------------------------------------------------------------
/home/bat.nix:
--------------------------------------------------------------------------------
1 | { lib, ... }:
2 |
3 | {
4 | programs.bat = {
5 | enable = true;
6 |
7 | config = {
8 | theme = lib.mkForce "base16";
9 | };
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/home/batsignal.nix:
--------------------------------------------------------------------------------
1 | {
2 | services.batsignal.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/home/chromium.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | programs.chromium = {
5 | enable = true;
6 | package = pkgs.ungoogled-chromium;
7 |
8 | commandLineArgs = [
9 | "--extension-mime-request-handling=always-prompt-for-install"
10 | "--webrtc-ip-handling-policy=default_public_interface_only"
11 | ];
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/home/dunst.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | pkgs,
4 | lib,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (lib) mkForce;
10 |
11 | inherit (config.lib.stylix.colors.withHashtag)
12 | base02
13 | base03
14 | base08
15 | base0A
16 | ;
17 | in
18 | {
19 | services.dunst = {
20 | enable = true;
21 |
22 | iconTheme = {
23 | package = pkgs.papirus-icon-theme;
24 | name = "Papirus";
25 | };
26 |
27 | settings = {
28 | global = {
29 | follow = "keyboard";
30 | width = 370;
31 | separator_height = 1;
32 | padding = 24;
33 | horizontal_padding = 24;
34 | frame_width = 1;
35 | sort = "update";
36 | idle_threshold = 120;
37 | alignment = "center";
38 | word_wrap = "yes";
39 | transparency = 5;
40 | format = "%s: %b";
41 | markup = "full";
42 | min_icon_size = 32;
43 | max_icon_size = 128;
44 | highlight = mkForce base03;
45 | };
46 |
47 | urgency_low = {
48 | foreground = mkForce base0A;
49 | frame_color = mkForce base02;
50 | };
51 |
52 | urgency_normal.frame_color = mkForce base02;
53 |
54 | urgency_critical = {
55 | foreground = mkForce base08;
56 | frame_color = mkForce base02;
57 | };
58 | };
59 | };
60 | }
61 |
--------------------------------------------------------------------------------
/home/dwm.nix:
--------------------------------------------------------------------------------
1 | {
2 | nixosConfig,
3 | config,
4 | pkgs,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (nixosConfig._module.specialArgs) nix-config;
10 |
11 | inherit (config.lib.stylix.colors.withHashtag) base00 base03 base05;
12 | inherit (config.home) homeDirectory;
13 |
14 | inherit (nix-config.packages.${pkgs.system})
15 | osu-backgrounds
16 | dunst-scripts
17 | ;
18 |
19 | barScript = "dwm/bar.fish";
20 | wallpaperScript = "dwm/wallpaper.fish";
21 | areaScript = "dwm/area.fish";
22 | in
23 | {
24 | home = {
25 | packages = with pkgs; [
26 | feh
27 | xclip
28 | scrot
29 | maim
30 | mpdris2
31 | xdotool
32 |
33 | (dwm.override {
34 | conf = # c
35 | ''
36 | #include
37 |
38 | static const unsigned int borderpx = 0;
39 | static const unsigned int snap = 32;
40 | static const int user_bh = 10;
41 | static const int showbar = 1;
42 | static const int topbar = 1;
43 |
44 | static const char *fonts[] = {
45 | "Maple Mono:size=10",
46 | "Noto Sans Mono CJK JP:size=10",
47 | "Noto Color Emoji:size=10",
48 | };
49 |
50 | static const char *colors[][3] = {
51 | [SchemeNorm] = { "${base03}", "${base00}", "${base03}" },
52 | [SchemeSel] = { "${base05}", "${base00}", "${base05}" },
53 | };
54 |
55 | static const char *const autostart[] = {
56 | "xrdb", "-merge", "${homeDirectory}/.Xresources", NULL,
57 | "mpDris2", NULL,
58 | "dunst", NULL,
59 | "picom", NULL,
60 | "fcitx5", NULL,
61 | "xset", "r", "rate", "300", "50", NULL,
62 | "xset", "-dpms", NULL,
63 | "fish", "${homeDirectory}/.config/${barScript}", NULL,
64 | "fish", "${homeDirectory}/.config/${wallpaperScript}", NULL,
65 | "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1", NULL,
66 | NULL
67 | };
68 |
69 | static const unsigned int baralpha = 243;
70 |
71 | static const unsigned int alphas[][3] = {
72 | [SchemeNorm] = { OPAQUE, baralpha, baralpha },
73 | [SchemeSel] = { OPAQUE, baralpha, baralpha },
74 | };
75 |
76 | static const char *tags[] = { "⬤", "⬤", "⬤", "⬤", "⬤", "⬤" };
77 |
78 | static const Rule rules[] = {
79 | { "librewolf", NULL, NULL, 0, 1, -1 },
80 | { "coord", NULL, NULL, 0, 1, -1 },
81 | };
82 |
83 | static const float mfact = 0.55;
84 | static const int nmaster = 1;
85 | static const int resizehints = 1;
86 | static const int lockfullscreen = 1;
87 |
88 | static const Layout layouts[] = {
89 | { "[]=", tile },
90 | };
91 |
92 | #define MODKEY Mod4Mask
93 |
94 | static char dmenumon[2] = "0";
95 | static const char *dmenucmd[] = { "rofi", "-show", NULL };
96 | static const char *quitcmd[] = { "kill", "xinit", NULL };
97 | static const char *termcmd[] = { "kitty", NULL };
98 | static const char *explorercmd[] = { "kitty", "yazi", NULL };
99 | static const char *brighter[] = { "${dunst-scripts}/bin/mb-up", NULL };
100 | static const char *dimmer[] = { "${dunst-scripts}/bin/mb-down", NULL };
101 | static const char *print[] = { "scrot", NULL };
102 | static const char *record[] = { "record", NULL };
103 | static const char *up_vol[] = { "${dunst-scripts}/bin/mv-up", NULL };
104 | static const char *down_vol[] = { "${dunst-scripts}/bin/mv-down", NULL };
105 | static const char *mute_vol[] = { "${dunst-scripts}/bin/mv-mute", NULL };
106 | static const char *mute_mic[] = { "${dunst-scripts}/bin/mv-mic", NULL };
107 | static const char *wallpaper[] = { "fish", "${homeDirectory}/.config/${wallpaperScript}", NULL };
108 | static const char *area[] = { "fish", "${homeDirectory}/.config/${areaScript}", NULL };
109 | static const char *audio_prev[] = { "playerctl", "-p", "playerctld", "previous", NULL };
110 | static const char *audio_next[] = { "playerctl", "-p", "playerctld", "next", NULL };
111 | static const char *audio_play_pause[] = { "playerctl", "-p", "playerctld", "play-pause", NULL };
112 | static const char *audio_forward[] = { "playerctl", "-p", "playerctld", "position", "10+", NULL };
113 | static const char *audio_rewind[] = { "playerctl", "-p", "playerctld", "position", "10-", NULL };
114 |
115 | static const Key keys[] = {
116 | { 0, XF86XK_AudioMute, spawn, {.v = mute_vol } },
117 | { 0, XF86XK_AudioMicMute, spawn, {.v = mute_mic } },
118 | { 0, XF86XK_AudioLowerVolume, spawn, {.v = down_vol } },
119 | { 0, XF86XK_AudioRaiseVolume, spawn, {.v = up_vol } },
120 | { 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
121 | { 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
122 | { 0, XF86XK_AudioPrev, spawn, {.v = audio_prev } },
123 | { 0, XF86XK_AudioNext, spawn, {.v = audio_next } },
124 | { 0, XF86XK_AudioPlay, spawn, {.v = audio_play_pause } },
125 | { 0, XF86XK_AudioPause, spawn, {.v = audio_play_pause } },
126 | { 0, XF86XK_AudioForward, spawn, {.v = audio_forward } },
127 | { 0, XF86XK_AudioRewind, spawn, {.v = audio_rewind } },
128 | { 0, XK_Print, spawn, {.v = area } },
129 | { MODKEY, XK_bracketleft, spawn, {.v = dmenucmd } },
130 | { MODKEY, XK_bracketright, spawn, {.v = explorercmd } },
131 | { MODKEY, XK_o, togglebar, {0} },
132 | { MODKEY, XK_f, togglefullscr, {0} },
133 | { MODKEY, XK_v, togglefloating, {0} },
134 | { MODKEY, XK_j, focusstack, {.i = +1 } },
135 | { MODKEY, XK_k, focusstack, {.i = -1 } },
136 | { MODKEY, XK_m, tagmon, {.i = +1 } },
137 | { MODKEY, XK_p, spawn, {.v = print } },
138 | { MODKEY, XK_w, spawn, {.v = wallpaper } },
139 | { MODKEY, XK_r, spawn, {.v = record } },
140 | { MODKEY, XK_Return, zoom, {0} },
141 | { MODKEY, XK_comma, focusmon, {.i = -1 } },
142 | { MODKEY, XK_period, focusmon, {.i = +1 } },
143 | { MODKEY, XK_1, viewprev, {0} },
144 | { MODKEY, XK_2, viewnext, {0} },
145 | { MODKEY|ShiftMask, XK_1, tagtoprev, {0} },
146 | { MODKEY|ShiftMask, XK_1, reorganizetags, {0} },
147 | { MODKEY|ShiftMask, XK_2, tagtonext, {0} },
148 | { MODKEY|ShiftMask, XK_2, reorganizetags, {0} },
149 | { MODKEY|ShiftMask, XK_m, tagmon, {.i = -1 } },
150 | { MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} },
151 | { MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} },
152 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
153 | { MODKEY|ShiftMask, XK_q, killclient, {0} },
154 | { MODKEY|Mod1Mask, XK_Delete, spawn, {.v = quitcmd } },
155 | };
156 |
157 | static const Button buttons[] = {
158 | { ClkTagBar, 0, Button1, view, {0} },
159 | { ClkClientWin, MODKEY, Button1, movemouse, {0} },
160 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
161 | };
162 | '';
163 |
164 | patches = with pkgs; [
165 | ../assets/dwm-actualfullscreen.patch
166 | ../assets/dwm-adjacenttag.patch
167 | ../assets/dwm-remove-layout-indicator.patch
168 | ../assets/dwm-remove-floating-indicator.patch
169 | ../assets/dwm-savefloats-alwayscenter.patch
170 |
171 | (fetchpatch {
172 | url = "https://dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff";
173 | hash = "sha256-GIbRW0Inwbp99rsKLfIDGvPwZ3pqihROMBp5vFlHx5Q=";
174 | })
175 |
176 | (fetchpatch {
177 | url = "https://dwm.suckless.org/patches/alpha/dwm-alpha-20230401-348f655.diff";
178 | hash = "sha256-ZhuqyDpY+nQQgrjniQ9DNheUgE9o/MUXKaJYRU3Uyl4=";
179 | })
180 |
181 | (fetchpatch {
182 | url = "https://dwm.suckless.org/patches/reorganizetags/dwm-reorganizetags-6.2.diff";
183 | hash = "sha256-Fj+cfw+5d7i6UrakMbebhZsfmu8ZfooduQA08STovK4=";
184 | })
185 |
186 | (fetchpatch {
187 | url = "https://dwm.suckless.org/patches/bar_height/dwm-bar-height-spacing-6.3.diff";
188 | hash = "sha256-usMIMmloUG4NrX10AVbgr8kFs9ZG6Krn1NxXTVcLq70=";
189 | })
190 |
191 | (fetchpatch {
192 | url = "https://dwm.suckless.org/patches/cool_autostart/dwm-cool-autostart-20240312-9f88553.diff";
193 | hash = "sha256-pgXbgoAAewCjZP16smKkTVh5p7P/FK+Rue0F6gjmGVo=";
194 | })
195 | ];
196 | })
197 | ];
198 |
199 | file.".xinitrc" = {
200 | executable = true;
201 | text = # bash
202 | ''
203 | #!/usr/bin/env sh
204 |
205 | export XDG_SESSION_TYPE=x11
206 | export GDK_BACKEND=x11
207 | export XDG_CURRENT_DESKTOP=dwm
208 | export GTK_IM_MODULE=fcitx
209 | export QT_IM_MODULE=fcitx
210 | export XMODIFIERS=@im=fcitx
211 | export SDL_IM_MODULE=fcitx
212 | export GLFW_IM_MODULE=ibus
213 | export GTK_CSD=0
214 | export QT_QPA_PLATFORMTHEME=qt5ct
215 | export QT_STYLE_OVERRIDE=kvantum
216 |
217 | while true; do
218 | dbus-launch --sh-syntax --exit-with-session dwm
219 | done
220 | '';
221 | };
222 | };
223 |
224 | xdg.configFile = {
225 | ${wallpaperScript} = {
226 | executable = true;
227 | text = # fish
228 | ''
229 | #!/usr/bin/env fish
230 |
231 | set LATEST $(ls -1 ${osu-backgrounds} | tail -n 1)
232 |
233 | feh --bg-fill \
234 | (random choice (fd . ${osu-backgrounds}/$LATEST --follow -e jpg -e png)) \
235 | (random choice (fd . ${osu-backgrounds}/$LATEST --follow -e jpg -e png))
236 | '';
237 | };
238 |
239 | ${barScript} = {
240 | executable = true;
241 | text = # fish
242 | ''
243 | #!/usr/bin/env fish
244 |
245 | function get_icon
246 | if test "$argv" -gt 90
247 | echo " "
248 | else if test "$argv" -gt 60
249 | echo " "
250 | else if test "$argv" -gt 30
251 | echo " "
252 | else if test "$argv" -gt 10
253 | echo " "
254 | else
255 | echo " "
256 | end
257 | end
258 |
259 | function update_bar
260 | set VOL $(wpctl get-volume @DEFAULT_AUDIO_SINK@)
261 | set MUTE $(echo "$VOL" | awk '{print $3}' | sed -e 's/\[MUTED\]/(ミュート)/' | tr --delete '\n')
262 | set VOLUME "音量:$(math "$(echo "$VOL" | choose 1) * 100")%"
263 |
264 | set TIME "$(date '+%x(%a)%R')"
265 |
266 | set capacity "$(cat /sys/class/power_supply/BAT0/capacity)"
267 | set BATTERY "$(get_icon $capacity)$capacity%"
268 |
269 | xsetroot -name " $MUTE$VOLUME・$BATTERY・$TIME "
270 | end
271 |
272 | while pidof dwm
273 | update_bar
274 |
275 | sleep 5s
276 | end
277 | '';
278 | };
279 |
280 | ${areaScript} = {
281 | executable = true;
282 | text = # fish
283 | ''
284 | #!/usr/bin/env fish
285 |
286 | maim -s | xclip -selection clipboard -t image/png
287 | '';
288 | };
289 | };
290 | }
291 |
--------------------------------------------------------------------------------
/home/editorconfig.nix:
--------------------------------------------------------------------------------
1 | {
2 | editorconfig = {
3 | enable = true;
4 |
5 | settings = {
6 | "*" = {
7 | charset = "utf-8";
8 | end_of_line = "lf";
9 | insert_final_newline = true;
10 | indent_size = 2;
11 | indent_style = "space";
12 | trim_trailing_whitespace = true;
13 | };
14 |
15 | "*.md" = {
16 | indent_size = 4;
17 | };
18 |
19 | "*.rs" = {
20 | indent_size = 4;
21 | };
22 | };
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/home/eza.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.eza = {
3 | enable = true;
4 | icons = "auto";
5 |
6 | extraOptions = [
7 | "--group-directories-first"
8 | "--no-quotes"
9 | "--git-ignore"
10 | ];
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/home/fcitx.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 |
3 | let
4 | inherit (config.lib.stylix.colors.withHashtag) base01 base02 base05;
5 |
6 | font = "Noto Sans CJK JP 16";
7 | themeName = "base16";
8 | in
9 | {
10 | xdg.dataFile = {
11 | "fcitx5/themes/${themeName}/theme.conf".text = # ini
12 | ''
13 | [Metadata]
14 | Name=${themeName}
15 | Version=0.1
16 | ScaleWithDPI=True
17 |
18 | [InputPanel]
19 | Font=${font}
20 | NormalColor=${base05}
21 | HighlightCandidateColor=${base05}
22 | HighlightColor=${base05}
23 | HighlightBackgroundColor=${base01}
24 | Spacing=6
25 |
26 | [InputPanel/TextMargin]
27 | Left=5
28 | Right=5
29 | Top=5
30 | Bottom=5
31 |
32 | [InputPanel/ContentMargin]
33 | Left=2
34 | Right=2
35 | Top=2
36 | Bottom=2
37 |
38 | [InputPanel/Background/Margin]
39 | Left=2
40 | Right=2
41 | Top=2
42 | Bottom=2
43 |
44 | [InputPanel/Background]
45 | Color=${base01}
46 |
47 | [InputPanel/Highlight]
48 | Color=${base02}
49 |
50 | [InputPanel/Highlight/Margin]
51 | Left=5
52 | Right=7
53 | Top=5
54 | Bottom=5
55 |
56 | [Menu]
57 | NormalColor=${base01}
58 |
59 | [Menu/Background]
60 | Color=${base01}
61 |
62 | [Menu/Highlight]
63 | Color=${base02}
64 |
65 | [Menu/Separator]
66 | Color=${base02}
67 |
68 | [Menu/Background/Margin]
69 | Left=2
70 | Right=2
71 | Top=2
72 | Bottom=2
73 |
74 | [Menu/ContentMargin]
75 | Left=2
76 | Right=2
77 | Top=2
78 | Bottom=2
79 |
80 | [Menu/Highlight/Margin]
81 | Left=5
82 | Right=5
83 | Top=5
84 | Bottom=5
85 |
86 | [Menu/TextMargin]
87 | Left=5
88 | Right=5
89 | Top=5
90 | Bottom=5
91 | '';
92 | };
93 |
94 | xdg.configFile = {
95 | "mozc/ibus_config.textproto" = {
96 | force = true;
97 | text = # textproto
98 | ''
99 | engines {
100 | name : "mozc-jp"
101 | longname : "Mozc"
102 | layout : "default"
103 | layout_variant : ""
104 | layout_option : ""
105 | rank : 80
106 | }
107 | active_on_launch: True
108 | '';
109 | };
110 |
111 | "fcitx5/config" = {
112 | force = true;
113 | text = # ini
114 | ''
115 | [Hotkey]
116 | EnumerateWithTriggerKeys=True
117 | AltTriggerKeys=
118 | EnumerateForwardKeys=
119 | EnumerateBackwardKeys=
120 | EnumerateSkipFirst=False
121 | EnumerateGroupForwardKeys=
122 | EnumerateGroupBackwardKeys=
123 | ActivateKeys=
124 | DeactivateKeys=
125 |
126 | [Hotkey/TriggerKeys]
127 | 0=Super+space
128 |
129 | [Hotkey/PrevPage]
130 | 0=Up
131 |
132 | [Hotkey/NextPage]
133 | 0=Down
134 |
135 | [Hotkey/PrevCandidate]
136 | 0=Shift+Tab
137 |
138 | [Hotkey/NextCandidate]
139 | 0=Tab
140 |
141 | [Hotkey/TogglePreedit]
142 | 0=Control+Alt+P
143 |
144 | [Behavior]
145 | ActiveByDefault=False
146 | ShareInputState=No
147 | PreeditEnabledByDefault=True
148 | ShowInputMethodInformation=True
149 | showInputMethodInformationWhenFocusIn=False
150 | CompactInputMethodInformation=True
151 | ShowFirstInputMethodInformation=True
152 | DefaultPageSize=5
153 | OverrideXkbOption=False
154 | CustomXkbOption=
155 | EnabledAddons=
156 | DisabledAddons=
157 | PreloadInputMethod=True
158 | '';
159 | };
160 |
161 | "fcitx5/profile" = {
162 | force = true;
163 | text = # ini
164 | ''
165 | [Groups/0]
166 | Name="Group 1"
167 | Default Layout=us
168 | DefaultIM=mozc
169 |
170 | [Groups/0/Items/0]
171 | Name=keyboard-us
172 | Layout=
173 |
174 | [Groups/0/Items/1]
175 | Name=mozc
176 | Layout=
177 |
178 | [GroupOrder]
179 | 0="Group 1"
180 | '';
181 | };
182 |
183 | "fcitx5/conf/classicui.conf" = {
184 | force = true;
185 | text = # ini
186 | ''
187 | Vertical Candidate List=False
188 | PerScreenDPI=True
189 | WheelForPaging=True
190 | Font="${font}"
191 | MenuFont="${font}"
192 | TrayFont="${font}"
193 | TrayOutlineColor=${base02}
194 | TrayTextColor=${base05}
195 | PreferTextIcon=False
196 | ShowLayoutNameInIcon=True
197 | UseInputMethodLanguageToDisplayText=True
198 | Theme=${themeName}
199 | '';
200 | };
201 |
202 | "fcitx5/conf/clipboard.conf" = {
203 | force = true;
204 | text = # ini
205 | ''
206 | TriggerKey=
207 | PastePrimaryKey=
208 | Number of entries=5
209 | '';
210 | };
211 |
212 | "fcitx5/conf/mozc.conf" = {
213 | force = true;
214 | text = # ini
215 | ''
216 | InitialMode=Hiragana
217 | Vertical=True
218 | ExpandMode="On Focus"
219 | PreeditCursorPositionAtBeginning=False
220 | ExpandKey=Control+Alt+H
221 | '';
222 | };
223 |
224 | "fcitx5/conf/notifications.conf" = {
225 | force = true;
226 | text = "HiddenNotifications=";
227 | };
228 |
229 | "fcitx5/conf/unicode.conf" = {
230 | force = true;
231 | text = "TriggerKey=";
232 | };
233 |
234 | "fcitx5/conf/quickphrase.conf" = {
235 | force = true;
236 | text = "TriggerKey=";
237 | };
238 | };
239 | }
240 |
--------------------------------------------------------------------------------
/home/fish.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.fish = {
3 | enable = true;
4 |
5 | loginShellInit = # fish
6 | ''
7 | if test (tty) = /dev/tty2
8 | exec startx
9 | end
10 | '';
11 |
12 | shellInit = # fish
13 | ''
14 | set -U fish_greeting ""
15 |
16 | set -x -U LESS_TERMCAP_md (printf "\e[01;31m")
17 | set -x -U LESS_TERMCAP_me (printf "\e[0m")
18 | set -x -U LESS_TERMCAP_se (printf "\e[0m")
19 | set -x -U LESS_TERMCAP_so (printf "\e[01;44;30m")
20 | set -x -U LESS_TERMCAP_ue (printf "\e[0m")
21 | set -x -U LESS_TERMCAP_us (printf "\e[01;32m")
22 | set -x -U MANROFFOPT "-c"
23 |
24 | fish_default_key_bindings
25 |
26 | if string match -qe -- "/dev/pts/" (tty)
27 | alias ssh="kitty +kitten ssh"
28 | end
29 | '';
30 |
31 | shellAliases = {
32 | tree = "eza --all --long --tree";
33 | mv = "mv -i";
34 | cp = "cp -ia";
35 | };
36 |
37 | shellAbbrs = {
38 | g = "git";
39 | ga = "git add";
40 | gaa = "git add --all";
41 | gap = "git add --patch";
42 | gapp = "git apply";
43 | gb = "git branch --verbose";
44 | gbr = "git branch --verbose --remotes";
45 | gbd = "git branch --delete";
46 | gbD = "git branch --delete --force";
47 | gc = "git commit -m";
48 | gca = "git commit --amend";
49 | gcl = "git clone";
50 | gco = "git checkout";
51 | gcot = "git checkout --theirs";
52 | gcp = "git cherry-pick --strategy-option theirs";
53 | gcpx = "git cherry-pick --strategy-option theirs -x";
54 | gd = "git diff";
55 | gds = "git diff --staged";
56 | gf = "git fetch";
57 | gi = "git init";
58 | gl = "git log --oneline --decorate --graph -n 10";
59 | gm = "git merge";
60 | gp = "git push";
61 | gpu = "git pull";
62 | gr = "git reset HEAD~";
63 | gR = "git restore";
64 | gRs = "git restore --staged";
65 | gra = "git remote add";
66 | gre = "git remote --verbose";
67 | grh = "git reset HEAD";
68 | grr = "git reset --hard HEAD~";
69 | grb = "git rebase --interactive";
70 | grbc = "git rebase --continue";
71 | gs = "git status";
72 | gsma = "git submodule add";
73 | gsmu = "git submodule update --init --remote --recursive";
74 | gst = "git stash";
75 | gstp = "git stash pop";
76 | gsw = "git switch";
77 | gt = "git tag";
78 | gts = "git tag -s";
79 |
80 | tp = "trash put";
81 | tl = "trash list";
82 | tr = "trash restore";
83 | te = "trash empty";
84 |
85 | nf = "nix flake";
86 | nfc = "nix flake check";
87 | nfu = "nix flake update";
88 | npr = "nixpkgs-review pr --run fish --print-result";
89 | nd = "nix develop --command fish";
90 | nb = "nix build";
91 | ns = "nix shell";
92 | nr = "nix run";
93 | ncg = "sudo nix-collect-garbage -d && nix-collect-garbage -d";
94 | nvd = "nvd --color always diff /run/current-system result | rg -v 0.0.0 | less -R";
95 |
96 | ca = "cargo add";
97 | cab = "cargo add --build";
98 | cad = "cargo add --dev";
99 | cb = "cargo build";
100 | cr = "cargo run";
101 | ct = "cargo test";
102 | crm = "cargo remove";
103 | crmb = "cargo remove --build";
104 | crmd = "cargo remove --dev";
105 | cc = "cargo clippy";
106 | cf = "cargo fmt";
107 |
108 | dl = "yt-dlp";
109 | vol = "wpctl set-volume '@DEFAULT_AUDIO_SINK@'";
110 | jis = "recode shift_jis..utf8";
111 | utf16 = "recode utf16..utf8";
112 | jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8";
113 | vm = "nixos-rebuild build-vm --flake . && ./result/bin/run-nixos-vm && trash put result nixos.qcow2";
114 | sw = "sudo nixos-rebuild switch --flake .";
115 | mgs = "mgitstatus";
116 | ncu = "ncu --interactive --format group";
117 |
118 | c = "clear";
119 | e = "exit";
120 | k = "kitty @ set-background-opacity";
121 | l = "ls -l";
122 | n = "nvim";
123 | j = "yazi";
124 | t = "tree";
125 | z = "zathura";
126 | };
127 |
128 | functions = {
129 | wav2flac = # fish
130 | ''
131 | set ORIGINAL_SIZE (du -hs | cut -f1)
132 |
133 | fd -e wav -x ffmpeg -i "file:{}" -loglevel quiet -stats "file:{.}.flac"
134 | fd -e wav -X trash
135 |
136 | set NEW_SIZE (du -hs | cut -f1)
137 |
138 | echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
139 | '';
140 |
141 | opus = # fish
142 | ''
143 | set ORIGINAL_SIZE (du -hs | cut -f1)
144 |
145 | fd -e wav -e flac -x ffmpeg -i "file:{}" -c:a libopus -b:a 128K -loglevel quiet -stats "file:{.}.opus"
146 | fd -e wav -e flac -X rm -I
147 |
148 | set NEW_SIZE (du -hs | cut -f1)
149 |
150 | echo "Done. Reduced file size from $ORIGINAL_SIZE to $NEW_SIZE"
151 | '';
152 |
153 | pr = # fish
154 | ''
155 | if git remote | rg -q upstream
156 | git fetch upstream "pull/$argv/head" && git checkout FETCH_HEAD
157 | else
158 | git fetch origin "pull/$argv/head" && git checkout FETCH_HEAD
159 | end
160 | '';
161 |
162 | ex = # fish
163 | ''
164 | if string match -qe -- ".part1." "$argv";
165 | set BASE (string split -f 1 ".part1." "$argv")
166 |
167 | unar "$argv" && fd -d 1 "$BASE.part" -X trash
168 | else if string match -qe -- ".part01." "$argv";
169 | set BASE (string split -f 1 ".part01." "$argv")
170 |
171 | unar "$argv" && fd -d 1 "$BASE.part" -X trash
172 | else
173 | unar "$argv" && trash "$argv"
174 | end
175 | '';
176 |
177 | mullvad-init = # fish
178 | ''
179 | mullvad auto-connect set on
180 | mullvad lan set allow
181 | mullvad relay set location us
182 | mullvad lockdown-mode set on
183 | mullvad account login "$argv"
184 | '';
185 | };
186 | };
187 | }
188 |
--------------------------------------------------------------------------------
/home/fzf.nix:
--------------------------------------------------------------------------------
1 | { lib, ... }:
2 |
3 | {
4 | programs.fzf = {
5 | enable = true;
6 | colors = lib.mkForce { };
7 |
8 | defaultOptions = [
9 | "--height 40%"
10 | "--reverse"
11 | "--border"
12 | "--color=16"
13 | ];
14 |
15 | defaultCommand = "rg --files --hidden --glob=!.git/";
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/home/git.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | home.packages = with pkgs; [
5 | tig
6 | mgitstatus
7 | ];
8 |
9 | xdg.configFile."tig/config".text = ''
10 | color cursor black green bold
11 | color title-focus black blue bold
12 | color title-blur black blue bold
13 | '';
14 |
15 | programs.git = {
16 | enable = true;
17 |
18 | attributes = [ "*.lockb binary diff=lockb" ];
19 |
20 | extraConfig = {
21 | include.path = "~/.gituser";
22 | commit.gpgsign = true;
23 |
24 | diff.lockb = {
25 | textconv = "bun";
26 | binary = true;
27 | };
28 |
29 | core = {
30 | editor = "nvim";
31 | autocrlf = false;
32 | quotePath = false;
33 | };
34 |
35 | push.default = "simple";
36 | pull.rebase = true;
37 | fetch.prune = true;
38 | branch.autosetuprebase = "always";
39 | init.defaultBranch = "master";
40 | rerere.enabled = true;
41 | color.ui = true;
42 |
43 | blame = {
44 | date = "relative";
45 | };
46 |
47 | "color \"diff-highlight\"" = {
48 | oldNormal = "red bold";
49 | oldHighlight = "red bold";
50 | newNormal = "green bold";
51 | newHighlight = "green bold ul";
52 | };
53 |
54 | "color \"diff\"" = {
55 | meta = "yellow";
56 | frag = "magenta bold";
57 | commit = "yellow bold";
58 | old = "red bold";
59 | new = "green bold";
60 | whitespace = "red reverse";
61 | };
62 | };
63 |
64 | diff-so-fancy.enable = true;
65 | };
66 | }
67 |
--------------------------------------------------------------------------------
/home/gpg.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | programs.gpg = {
5 | enable = true;
6 |
7 | settings = {
8 | personal-digest-preferences = "SHA512";
9 | cert-digest-algo = "SHA512";
10 | cipher-algo = "AES256";
11 | default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
12 | personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES";
13 | throw-keyids = true;
14 | keyid-format = "0xlong";
15 | with-fingerprint = true;
16 | };
17 | };
18 |
19 | services.gpg-agent = {
20 | enable = true;
21 | defaultCacheTtl = 43200;
22 | maxCacheTtl = 43200;
23 |
24 | pinentry.package = pkgs.pinentry-curses;
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/home/gtk.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | gtk = {
5 | enable = true;
6 |
7 | gtk3.extraConfig = {
8 | gtk-decoration-layout = "menu:";
9 | gtk-xft-antialias = 1;
10 | gtk-xft-hinting = 1;
11 | gtk-xft-hintstyle = "hintfull";
12 | gtk-xft-rgba = "rgb";
13 | gtk-recent-files-enabled = false;
14 | };
15 |
16 | iconTheme = {
17 | package = pkgs.fluent-icon-theme;
18 | name = "Fluent-dark";
19 | };
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/home/htop.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | programs.htop = {
5 | enable = true;
6 | package = pkgs.htop-vim;
7 |
8 | settings = {
9 | tree_view = true;
10 | hide_userland_threads = true;
11 | highlight_changes = true;
12 | show_cpu_frequency = true;
13 | show_cpu_temperature = true;
14 | highlight_base_name = true;
15 |
16 | show_program_path = false;
17 | };
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/home/hypridle.nix:
--------------------------------------------------------------------------------
1 | {
2 | services.hypridle = {
3 | enable = true;
4 |
5 | settings = {
6 | general = {
7 | lock_cmd = "pidof hyprlock || hyprlock";
8 | before_sleep_cmd = "loginctl lock-session";
9 | after_sleep_cmd = "hyprctl dispatch dpms on";
10 | };
11 |
12 | listener = [
13 | {
14 | timeout = 150;
15 | on-timeout = "brightnessctl set 0 --save && brightnessctl --device=tpacpi::kbd_backlight set 0 --save";
16 | on-resume = "brightnessctl --restore && brightnessctl --device=tpacpi::kbd_backlight --restore";
17 | }
18 | {
19 | timeout = 300;
20 | on-timeout = "loginctl lock-session";
21 | }
22 | {
23 | timeout = 380;
24 | on-timeout = "hyprctl dispatch dpms off";
25 | on-resume = "hyprctl dispatch dpms on";
26 | }
27 | {
28 | timeout = 1800;
29 | on-timeout = "systemctl suspend";
30 | }
31 | ];
32 | };
33 | };
34 | }
35 |
--------------------------------------------------------------------------------
/home/hyprland.nix:
--------------------------------------------------------------------------------
1 | {
2 | nixosConfig,
3 | pkgs,
4 | lib,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (nixosConfig._module.specialArgs) nix-config;
10 |
11 | inherit (lib) mkForce;
12 |
13 | inherit (nix-config.packages.${pkgs.system})
14 | osu-backgrounds
15 | dunst-scripts
16 | ;
17 |
18 | opacity = "0.95";
19 | super = "SUPER";
20 |
21 | gapsScript = "hypr/gaps.fish";
22 | randomBackgroundScript = "hypr/random-bg.fish";
23 | swapBackgroundScript = "hypr/swap-bg.fish";
24 | setBackgroundScript = "hypr/set-bg.fish";
25 | monitorScript = "hypr/monitor-script.fish";
26 | in
27 | {
28 | home.packages = with pkgs; [
29 | hyprdim
30 | hyprnome
31 | swww
32 | grimblast
33 | brightnessctl
34 | mpvpaper
35 | lnch
36 | wev
37 | wf-recorder
38 | playerctl
39 | ];
40 |
41 | wayland.windowManager.hyprland = {
42 | enable = true;
43 |
44 | settings = {
45 | env = [
46 | "BROWSER,librewolf"
47 | "QT_IM_MODULE,fcitx"
48 | "XMODIFIERS,@im=fcitx"
49 | "SDL_IM_MODULE,fcitx"
50 | "GLFW_IM_MODULE,ibus"
51 | "SWWW_TRANSITION,grow"
52 | "SWWW_TRANSITION_STEP,200"
53 | "SWWW_TRANSITION_DURATION,1.5"
54 | "SWWW_TRANSITION_FPS,240"
55 | "SWWW_TRANSITION_WAVE,80,40"
56 | "QT_QPA_PLATFORMTHEME,qt5ct"
57 | "QT_STYLE_OVERRIDE,kvantum"
58 | ];
59 |
60 | monitor = [
61 | ",preferred,auto,1"
62 | "eDP-1,preferred,auto-left,1"
63 | "HDMI-A-1,highrr,auto-right,1"
64 | ];
65 |
66 | exec-once = [
67 | "sleep 0.1; swww-daemon"
68 | "ironbar"
69 | "fcitx5"
70 | "hyprctl dispatch workspace 5000000"
71 | "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
72 | "hyprdim"
73 | "~/.config/${randomBackgroundScript}"
74 | ];
75 |
76 | input = {
77 | kb_layout = "us";
78 | repeat_rate = 50;
79 | repeat_delay = 300;
80 |
81 | accel_profile = "flat";
82 | follow_mouse = 1;
83 | sensitivity = 0;
84 | mouse_refocus = false;
85 |
86 | touchpad = {
87 | natural_scroll = true;
88 | disable_while_typing = false;
89 | };
90 | };
91 |
92 | general = {
93 | gaps_in = 0;
94 | gaps_out = 0;
95 | border_size = 0;
96 | layout = "master";
97 | };
98 |
99 | decoration = {
100 | rounding = 0;
101 |
102 | shadow = {
103 | range = 30;
104 | render_power = 3;
105 | };
106 |
107 | blur = {
108 | enabled = true;
109 | size = 5;
110 | passes = 2;
111 | };
112 | };
113 |
114 | animations = {
115 | enabled = true;
116 | bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
117 |
118 | animation = [
119 | "windows, 1, 7, myBezier"
120 | "windowsOut, 1, 7, default, popin 80%"
121 | "border, 1, 10, default"
122 | "borderangle, 1, 8, default"
123 | "fade, 1, 7, default"
124 | "workspaces, 1, 6, default, slidevert"
125 | "specialWorkspace, 1, 6, default, fade"
126 | ];
127 | };
128 |
129 | dwindle = {
130 | preserve_split = true;
131 | special_scale_factor = 1;
132 | };
133 |
134 | master = {
135 | new_on_top = true;
136 | new_status = "master";
137 | mfact = 0.55;
138 | special_scale_factor = 1;
139 | };
140 |
141 | gestures = {
142 | workspace_swipe = true;
143 | };
144 |
145 | device = [
146 | {
147 | name = "synps/2-synaptics-touchpad";
148 | sensitivity = 0.75;
149 | accel_profile = "flat";
150 | natural_scroll = true;
151 | disable_while_typing = false;
152 | }
153 | {
154 | name = "tpps/2-elan-trackpoint";
155 | sensitivity = 0.5;
156 | accel_profile = "flat";
157 | }
158 | ];
159 |
160 | binds = {
161 | allow_workspace_cycles = true;
162 | };
163 |
164 | layerrule = [
165 | "blur,ironbar"
166 | "blur,rofi"
167 | "blur,notifications"
168 | ];
169 |
170 | windowrule = [
171 | "nomaxsize,class:^(winecfg\.exe|osu\.exe)$"
172 | "opaque,class:^(kitty)$"
173 | "nodim,title:^(Picture-in-Picture|ピクチャーインピクチャー)$"
174 | "nodim,class:^(mpv)$"
175 | "nodim,class:^(.*.exe)\$"
176 | "tile,class:^(.qemu-system-x86_64-wrapped)$"
177 | "opacity ${opacity} ${opacity},class:^(thunar)$"
178 | "float,class:^(librewolf|Mullvad Browser)$"
179 | "center 1,class:^(librewolf|Mullvad Browser)$"
180 | ];
181 |
182 | ecosystem = {
183 | no_update_news = true;
184 | no_donation_nag = true;
185 | };
186 |
187 | misc = {
188 | disable_hyprland_logo = true;
189 | disable_hyprland_qtutils_check = true;
190 | animate_manual_resizes = true;
191 | animate_mouse_windowdragging = true;
192 | disable_autoreload = true;
193 | new_window_takes_over_fullscreen = 1;
194 | initial_workspace_tracking = 0;
195 | };
196 |
197 | bind = [
198 | "${super}_SHIFT, Return, exec, kitty"
199 | "${super}_SHIFT, Q, killactive"
200 | "${super}, W, exec, ~/.config/${randomBackgroundScript}"
201 | "${super}_SHIFT, W, exec, ~/.config/${swapBackgroundScript}"
202 | "${super}, P, exec, grimblast --notify save screen"
203 | ", Print, exec, grimblast --freeze copy area"
204 | "${super}, bracketleft, exec, killall rofi || rofi -show"
205 | "${super}, bracketright, exec, kitty yazi"
206 | "${super}_ALT, delete, exit"
207 | "${super}, V, togglefloating"
208 | "${super}, U, exec, ~/.config/${gapsScript}"
209 | "${super}, R, exec, record"
210 | "${super}, X, pin"
211 | "${super}, F, fullscreen"
212 | "${super}, Tab, exec, hyprctl dispatch overview:toggle"
213 | "${super}, S, swapactiveworkspaces, 0 1"
214 | "${super}_SHIFT, S, movetoworkspace, special"
215 | "${super}, O, exec, killall .ironbar-wrapper inotifywait pactl || ironbar"
216 | "${super}, M, focusmonitor, +1"
217 | "${super}_SHIFT, M, focusmonitor, -1"
218 |
219 | "${super}, Return, layoutmsg, swapwithmaster master"
220 | "${super}, J, layoutmsg, cyclenext"
221 | "${super}, K, layoutmsg, cycleprev"
222 | "${super}_SHIFT, J, layoutmsg, swapnext"
223 | "${super}_SHIFT, K, layoutmsg, swapprev"
224 | "${super}, C, splitratio, exact 0.80"
225 | "${super}, C, layoutmsg, orientationtop"
226 | "${super}_SHIFT, C, splitratio, exact 0.55"
227 | "${super}_SHIFT, C, layoutmsg, orientationleft"
228 | "${super}, H, layoutmsg, addmaster"
229 | "${super}, L, layoutmsg, removemaster"
230 | "${super}_SHIFT, H, splitratio, -0.05"
231 | "${super}_SHIFT, L, splitratio, +0.05"
232 | "${super}_ALT, L, exec, hyprlock"
233 |
234 | "${super}, 1, exec, hyprnome --previous"
235 | "${super}, 2, exec, hyprnome"
236 | "${super}_SHIFT, 1, exec, hyprnome --previous --move"
237 | "${super}_SHIFT, 2, exec, hyprnome --move"
238 |
239 | "${super}, mouse_down, exec, hyprnome --previous"
240 | "${super}, mouse_up, exec, hyprnome"
241 | ];
242 |
243 | bindm = [
244 | "${super}, mouse:272, movewindow"
245 | "${super}, mouse:273, resizewindow"
246 | ];
247 |
248 | bindl = [
249 | ", XF86AudioMute, exec, ${dunst-scripts}/bin/mv-mute"
250 | ", XF86AudioMicMute, exec, ${dunst-scripts}/bin/mv-mic"
251 | ", XF86MonBrightnessDown, exec, ${dunst-scripts}/bin/mb-down"
252 | ", XF86MonBrightnessUp, exec, ${dunst-scripts}/bin/mb-up"
253 | ", XF86Display, exec, ~/.config/${monitorScript}"
254 | ", XF86AudioPrev, exec, playerctl -p playerctld previous"
255 | ", XF86AudioNext, exec, playerctl -p playerctld next"
256 | ", XF86AudioPlay, exec, playerctl -p playerctld play"
257 | ", XF86AudioPause, exec, playerctl -p playerctld pause"
258 | ", XF86Messenger, togglespecialworkspace"
259 | ];
260 |
261 | binde = [
262 | ", XF86AudioRaiseVolume, exec, ${dunst-scripts}/bin/mv-up"
263 | ", XF86AudioLowerVolume, exec, ${dunst-scripts}/bin/mv-down"
264 | ", XF86AudioForward, exec, playerctl -p playerctld position 10+"
265 | ", XF86AudioRewind, exec, playerctl -p playerctld position 10-"
266 | ];
267 | };
268 |
269 | extraConfig = # hyprlang
270 | ''
271 | bind = ${super}_ALT, BackSpace, submap, passthrough
272 | submap = passthrough
273 | bind = ${super}_ALT, BackSpace, submap, reset
274 | submap = reset
275 | '';
276 | };
277 |
278 | xdg.configFile = {
279 | ${gapsScript} = {
280 | executable = true;
281 | text = # fish
282 | ''
283 | #!/usr/bin/env fish
284 |
285 | hyprctl keyword general:gaps_out $(math 10 - $(hyprctl getoption general:gaps_out -j | jq -r ".custom" | choose 1))
286 | hyprctl keyword general:gaps_in $(math 5 - $(hyprctl getoption general:gaps_in -j | jq -r ".custom" | choose 1))
287 | hyprctl keyword general:border_size $(math 2 - $(hyprctl getoption general:border_size -j | jq -r ".int"))
288 | hyprctl keyword decoration:rounding $(math 8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int"))
289 | '';
290 | };
291 |
292 | ${setBackgroundScript} = {
293 | executable = true;
294 | text = # fish
295 | ''
296 | #!/usr/bin/env fish
297 |
298 | if [ (hyprctl getoption animations:enabled -j | jq -r ".int") = "1" ]
299 | swww img \
300 | --transition-type $(random choice grow wave outer) \
301 | --transition-wave 80,40 \
302 | --transition-angle $(random choice 45 90 135 225 270 315) \
303 | --transition-pos $(random choice center top left right bottom top-left top-right bottom-left bottom-right) \
304 | --transition-step 200 \
305 | --transition-duration 1.5 \
306 | --transition-fps 240 \
307 | --outputs "$argv[1]" \
308 | "$argv[2]"
309 | else
310 | swww img \
311 | --transition-type simple \
312 | --transition-step 255 \
313 | --outputs "$argv[1]" \
314 | "$argv[2]"
315 | end
316 | '';
317 | };
318 |
319 | ${randomBackgroundScript} = {
320 | executable = true;
321 | text = # fish
322 | ''
323 | #!/usr/bin/env fish
324 |
325 | set LATEST $(ls -1 ${osu-backgrounds} | tail -n 1)
326 |
327 | for monitor in (hyprctl monitors -j | jq -r '.[].name')
328 | ~/.config/${setBackgroundScript} "$monitor" "$(random choice $(fd . ${osu-backgrounds}/$LATEST --follow -e jpg -e png))"
329 | end
330 | '';
331 | };
332 |
333 | ${swapBackgroundScript} = {
334 | executable = true;
335 | text = # fish
336 | ''
337 | #!/usr/bin/env fish
338 |
339 | set M "$(swww query | cut -d ':' -f 5)"
340 | set M1 "$(echo "$M" | head -n 1 | awk '{$1=$1};1')"
341 | set M2 "$(echo "$M" | tail -n 1 | awk '{$1=$1};1')"
342 |
343 | ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | tail -n 1)" "$M1"
344 | ~/.config/${setBackgroundScript} "$(swww query | choose 0 | choose -c 0..-1 | head -n 1)" "$M2"
345 | '';
346 | };
347 |
348 | ${monitorScript} = {
349 | executable = true;
350 | text = # fish
351 | ''
352 | #!/usr/bin/env fish
353 |
354 | if test -n "$(hyprctl monitors -j | jq -r '.[] | select(.name | contains("eDP-1"))')"
355 | hyprctl keyword monitor eDP-1,disable
356 | else
357 | hyprctl keyword monitor eDP-1,preferred,auto-left,1
358 | end
359 | '';
360 | };
361 | };
362 |
363 | services = {
364 | hyprpaper.enable = mkForce false;
365 | };
366 | }
367 |
--------------------------------------------------------------------------------
/home/hyprlock.nix:
--------------------------------------------------------------------------------
1 | { lib, ... }:
2 |
3 | let
4 | inherit (lib) mkForce;
5 | in
6 | {
7 | programs.hyprlock = {
8 | enable = true;
9 |
10 | settings = {
11 | general = {
12 | hide_cursor = true;
13 | grace = 2;
14 | };
15 |
16 | background = mkForce {
17 | color = "rgba(25, 20, 20, 1.0)";
18 | path = "screenshot";
19 | blur_passes = 2;
20 | brightness = 0.5;
21 | };
22 |
23 | label = {
24 | text = "パスワードをご入力ください";
25 | color = "rgba(222, 222, 222, 1.0)";
26 | font_size = 50;
27 | font_family = "Noto Sans CJK JP";
28 | position = "0, 70";
29 | halign = "center";
30 | valign = "center";
31 | };
32 |
33 | input-field = {
34 | size = "50, 50";
35 | dots_size = 0.33;
36 | dots_spacing = 0.15;
37 | outer_color = mkForce "rgba(25, 20, 20, 0)";
38 | inner_color = mkForce "rgba(25, 20, 20, 0)";
39 | font_color = mkForce "rgba(222, 222, 222, 1.0)";
40 | placeholder_text = "パスワード";
41 | };
42 | };
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/home/ironbar.nix:
--------------------------------------------------------------------------------
1 | {
2 | nixosConfig,
3 | config,
4 | lib,
5 | pkgs,
6 | ...
7 | }:
8 |
9 | let
10 | inherit (nixosConfig._module.specialArgs) nix-config;
11 |
12 | inherit (lib) singleton;
13 | inherit (builtins) toJSON;
14 | inherit (nix-config.packages.${pkgs.system}) dunst-scripts;
15 |
16 | inherit (config.lib.stylix.colors.withHashtag)
17 | base00
18 | base01
19 | base04
20 | base05
21 | base0D
22 | ;
23 |
24 | mullvadScript = "ironbar/mullvad.fish";
25 | volumeScript = "ironbar/volume.fish";
26 | volumeGet = "ironbar/volume-get.fish";
27 | in
28 | {
29 | home.packages = with pkgs; [ ironbar ];
30 |
31 | xdg.configFile = {
32 | "ironbar/config.json".text = toJSON {
33 | name = "main";
34 | icon_theme = "Fluent-dark";
35 | position = "bottom";
36 | anchor_to_edges = true;
37 |
38 | start = [
39 | {
40 | name = "startMenu";
41 | type = "label";
42 | label = "❄";
43 | on_mouse_enter = "rofi -show";
44 | }
45 | {
46 | type = "script";
47 | on_click_left = "mullvad relay set location any && mullvad relay set location us";
48 | cmd = "~/.config/${mullvadScript}";
49 | mode = "watch";
50 | }
51 | ];
52 |
53 | center = singleton {
54 | type = "launcher";
55 | icon_size = 39;
56 |
57 | favorites = [
58 | "librewolf"
59 | "kitty"
60 | "thunar"
61 | "Chromium-browser"
62 | "anki"
63 | ];
64 | };
65 |
66 | end = [
67 | {
68 | type = "tray";
69 | }
70 | {
71 | type = "script";
72 | cmd = "~/.config/${volumeScript}";
73 | on_click_left = "${dunst-scripts}/bin/mv-up";
74 | on_click_right = "${dunst-scripts}/bin/mv-down";
75 | mode = "watch";
76 | }
77 | {
78 | type = "upower";
79 | show_if = "upower -e | grep BAT";
80 | }
81 | {
82 | type = "clock";
83 | format = "%x(%a)%R";
84 | }
85 | ];
86 | };
87 |
88 | "ironbar/style.css".text = # css
89 | ''
90 | * {
91 | font-family: "Noto Sans CJK JP", "Font Awesome 6 Free Solid";
92 | font-size: 16px;
93 | text-shadow: 2px 2px ${base00};
94 | border: none;
95 | border-radius: 0;
96 | outline: none;
97 | font-weight: 500;
98 | background: none;
99 | color: ${base05};
100 | }
101 |
102 | .background {
103 | background: alpha(${base00}, 0.925);
104 | }
105 |
106 | button:hover {
107 | background: alpha(${base01}, 0.8);
108 | }
109 |
110 | #bar {
111 | border-top: 1px solid alpha(${base01}, 0.925);
112 | }
113 |
114 | .label, .script, .tray {
115 | padding-left: 0.5em;
116 | padding-right: 0.5em;
117 | }
118 |
119 | .tray .item {
120 | padding-left: 0.5em;
121 | }
122 |
123 | .upower {
124 | padding-left: 0.2em;
125 | padding-right: 0.2em;
126 | }
127 |
128 | .upower .label {
129 | padding-left: 0;
130 | padding-right: 0;
131 | }
132 |
133 | .popup {
134 | border: 1px solid ${base01};
135 | padding: 1em;
136 | }
137 |
138 | .popup-clock .calendar-clock {
139 | font-family: "Maple Mono";
140 | font-size: 2.5em;
141 | padding-bottom: 0.1em;
142 | }
143 |
144 | .popup-clock .calendar .header {
145 | padding-top: 1em;
146 | border-top: 1px solid ${base01};
147 | font-size: 1.5em;
148 | }
149 |
150 | .popup-clock .calendar {
151 | padding: 0.2em 0.4em;
152 | }
153 |
154 | .popup-clock .calendar:selected {
155 | color: ${base0D};
156 | }
157 |
158 | .launcher .item {
159 | padding-left: 1em;
160 | padding-right: 1em;
161 | margin-right: 4px;
162 | }
163 |
164 | button:active {
165 | background: alpha(${base04}, 0.8);
166 | }
167 |
168 | .launcher .open {
169 | box-shadow: inset 0 -2px alpha(${base04}, 0.8);
170 | }
171 |
172 | .launcher .focused {
173 | box-shadow: inset 0 -2px alpha(${base0D}, 0.8);
174 | background: alpha(${base01}, 0.8);
175 | }
176 |
177 | .popup-launcher {
178 | padding: 0;
179 | }
180 |
181 | .popup-launcher .popup-item:not(:first-child) {
182 | border-top: 1px solid ${base01};
183 | }
184 |
185 | #startMenu {
186 | padding-left: 1em;
187 | padding-right: 0.5em;
188 | }
189 | '';
190 |
191 | ${mullvadScript} = {
192 | executable = true;
193 | text = # fish
194 | ''
195 | #!/usr/bin/env fish
196 |
197 | sleep 2
198 |
199 | function get_mullvad_status
200 | if test -z "$inside"
201 | set inside true
202 | test -n "$initialized" && sleep 0.2
203 |
204 | set MULLVAD (mullvad status | tail -1)
205 |
206 | set LOCATION (echo "$MULLVAD" | choose 3.. | sed \
207 | -e 's/Ashburn.*/アッシュバーン/g' \
208 | -e 's/Atlanta.*/アトランタ/g' \
209 | -e 's/Boston.*/ボストン/g' \
210 | -e 's/Charlotte.*/シャーロット/g' \
211 | -e 's/Chicago.*/シカゴ/g' \
212 | -e 's/Cleveland.*/クリーブランド/g' \
213 | -e 's/Dallas.*/ダラス/g' \
214 | -e 's/Detroit.*/デトロイト/g' \
215 | -e 's/Denver.*/デンバー/g' \
216 | -e 's/Honolulu.*/ホノルル/g' \
217 | -e 's/Houston.*/ヒューストン/g' \
218 | -e 's/Jackson.*/ジャクソン/g' \
219 | -e 's/Los Angeles.*/ロサンゼルス/g' \
220 | -e 's/Louisville.*/ルイビル/g' \
221 | -e 's/McAllen.*/マッカレン/g' \
222 | -e 's/Miami.*/マイアミ/g' \
223 | -e 's/Milwaukee.*/ミルウォーキー/g' \
224 | -e 's/Minneapolis.*/ミネアポリス/g' \
225 | -e 's/New York.*/ニューヨーク/g' \
226 | -e 's/Oklahoma.*/オクラホマシティ/g' \
227 | -e 's/Philadelphia.*/フィラデルフィア/g' \
228 | -e 's/Phoenix.*/フィニックス/g' \
229 | -e 's/Piscataway.*/ピスカタウェイ/g' \
230 | -e 's/Portland.*/ポートランド/g' \
231 | -e 's/Raleigh.*/ローリー/g' \
232 | -e 's/Richmond.*/リッチモンド/g' \
233 | -e 's/Salt Lake.*/ソルトレイクシティ/g' \
234 | -e 's/San Francisco.*/サンフランシスコ/g' \
235 | -e 's/San Jose.*/サンノゼ/g' \
236 | -e 's/Seattle.*/シアトル/g' \
237 | -e 's/Secaucus.*/セコーカス/g' \
238 | -e 's/Sioux Falls.*/スーフォールズ/g' \
239 | -e 's/St. Louis.*/セントルイス/g' \
240 | -e 's/Stamford.*/スタンフォード/g' \
241 | -e 's/Washington.*/ワシントン/g'
242 | )
243 |
244 | echo "$LOCATION"
245 |
246 | set -e inside
247 | end
248 | end
249 |
250 | get_mullvad_status
251 | set initialized true
252 |
253 | ${pkgs.inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn |
254 | while read directory events filename
255 | get_mullvad_status
256 | end
257 | '';
258 | };
259 |
260 | ${volumeScript} = {
261 | executable = true;
262 | text = # fish
263 | ''
264 | #!/usr/bin/env fish
265 |
266 | sleep 2
267 |
268 | ~/.config/${volumeGet}
269 |
270 | pactl subscribe | grep --line-buffered -e "シンク" | xargs -L 1 ~/.config/${volumeGet}
271 | '';
272 | };
273 |
274 | ${volumeGet} = {
275 | executable = true;
276 | text = # fish
277 | ''
278 | #!/usr/bin/env fish
279 |
280 | set VOL $(wpctl get-volume @DEFAULT_AUDIO_SINK@)
281 | set MUTE $(echo "$VOL" | awk '{print $3}' | sed -e 's/\[MUTED\]/(ミュート)/' | tr --delete '\n')
282 |
283 | echo -n "$MUTE"
284 | echo "音量:$(math "$(echo "$VOL" | choose 1) * 100")%"
285 | '';
286 | };
287 | };
288 | }
289 |
--------------------------------------------------------------------------------
/home/kitty.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 |
3 | let
4 | inherit (config.lib.stylix.colors.withHashtag) base00;
5 | in
6 | {
7 | programs.kitty = {
8 | enable = true;
9 |
10 | settings = {
11 | enable_audio_bell = false;
12 | close_on_child_death = true;
13 | cursor_blink_interval = 0;
14 |
15 | enabled_layouts = "fat, tall, vertical";
16 | wayland_titlebar_color = "background";
17 |
18 | allow_remote_control = true;
19 | listen_on = "unix:/tmp/kitty";
20 | dynamic_background_opacity = true;
21 |
22 | window_padding_width = 5;
23 | tab_bar_margin_width = 5;
24 |
25 | notify_on_cmd_finish = "unfocused";
26 |
27 | scrollback_pager = "less --chop-long-lines --raw-control-chars +INPUT_LINE_NUMBER";
28 | };
29 |
30 | extraConfig = ''
31 | tab_bar_background ${base00}
32 | inactive_tab_background ${base00}
33 | '';
34 | };
35 | }
36 |
--------------------------------------------------------------------------------
/home/librewolf.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | lib,
4 | nixosConfig,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (nixosConfig._module.specialArgs) nix-config;
10 |
11 | inherit (lib) singleton;
12 |
13 | search = {
14 | force = true;
15 | default = "Mullvad";
16 | privateDefault = "Mullvad";
17 |
18 | engines = {
19 | Mullvad = {
20 | urls = singleton {
21 | template = "https://leta.mullvad.net";
22 |
23 | params = singleton {
24 | name = "q";
25 | value = "{searchTerms}";
26 | };
27 | };
28 |
29 | icon = "${pkgs.mullvad-vpn}/share/icons/hicolor/32x32/apps/mullvad-vpn.png";
30 | };
31 |
32 | "excite.co.jp" = {
33 | urls = singleton {
34 | template = "https://websearch.excite.co.jp";
35 |
36 | params = singleton {
37 | name = "q";
38 | value = "{searchTerms}";
39 | };
40 | };
41 |
42 | icon = pkgs.fetchurl {
43 | url = "https://s.eximg.jp/search/images/lep.ico";
44 | hash = "sha256-mUnVTRrpDFAcXtC8YPmHUCICr/cYF0FNYkBBHedZReE=";
45 | };
46 | };
47 |
48 | google.metaData.hidden = true;
49 | bing.metaData.hidden = true;
50 | ddg.metaData.hidden = true;
51 | wikipedia.metaData.hidden = true;
52 | };
53 | };
54 |
55 | settings = {
56 | "extensions.autoDisableScopes" = 0;
57 |
58 | "middlemouse.paste" = false;
59 |
60 | "browser.download.useDownloadDir" = true;
61 | "browser.tabs.insertAfterCurrent" = true;
62 | "browser.tabs.warnOnClose" = true;
63 | "browser.toolbars.bookmarks.visibility" = "never";
64 | "browser.quitShortcut.disabled" = true;
65 | "browser.sessionstore.restore_pinned_tabs_on_demand" = true;
66 |
67 | "browser.urlbar.suggest.bookmark" = false;
68 | "browser.urlbar.suggest.engines" = false;
69 | "browser.urlbar.suggest.history" = false;
70 | "browser.urlbar.suggest.openpage" = false;
71 | "browser.urlbar.suggest.topsites" = false;
72 | "browser.urlbar.trimHttps" = true;
73 |
74 | "sidebar.position_start" = false;
75 | "findbar.highlightAll" = true;
76 |
77 | "xpinstall.signatures.required" = false;
78 |
79 | "apz.overscroll.enabled" = false;
80 | "browser.tabs.hoverPreview.enabled" = true;
81 |
82 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
83 | };
84 | in
85 | {
86 | stylix.targets.librewolf.profileNames = [ "default" ];
87 |
88 | programs.librewolf = {
89 | enable = true;
90 |
91 | package = pkgs.librewolf.override {
92 | cfg.speechSynthesisSupport = false;
93 | };
94 |
95 | profiles = {
96 | default = {
97 | extensions.packages = with nix-config.packages.${pkgs.system}; [
98 | new-tab-identity
99 | ];
100 |
101 | inherit settings search;
102 | };
103 |
104 | work = {
105 | id = 1;
106 |
107 | inherit settings search;
108 | };
109 | };
110 | };
111 | }
112 |
--------------------------------------------------------------------------------
/home/mime-apps.nix:
--------------------------------------------------------------------------------
1 | {
2 | xdg.mimeApps = {
3 | enable = true;
4 |
5 | defaultApplications = {
6 | "text/html" = "librewolf.desktop";
7 | "text/markdown" = "nvim.desktop";
8 | "text/plain" = "nvim.desktop";
9 | "image/png" = "pqiv.desktop";
10 | "image/jpeg" = "pqiv.desktop";
11 | "image/gif" = "pqiv.desktop";
12 | "image/webp" = "pqiv.desktop";
13 | "application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
14 | "application/x-wine-extension-osz" = "osu-stable.desktop";
15 | "x-scheme-handler/http" = "librewolf.desktop";
16 | "x-scheme-handler/https" = "librewolf.desktop";
17 | };
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/home/mpdris2.nix:
--------------------------------------------------------------------------------
1 | {
2 | services.mpdris2 = {
3 | enable = true;
4 | notifications = true;
5 | };
6 | }
7 |
--------------------------------------------------------------------------------
/home/mpv.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | pkgs,
4 | nixosConfig,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (nixosConfig._module.specialArgs) nix-config;
10 |
11 | inherit (lib) getExe;
12 | inherit (nix-config.packages.${pkgs.system}) mpv-websocket;
13 |
14 | input-ipc-server = "/tmp/mpv-socket";
15 | in
16 | {
17 | programs.mpv = {
18 | enable = true;
19 |
20 | package = pkgs.mpv-unwrapped.wrapper {
21 | mpv = pkgs.mpv-unwrapped.override {
22 | ffmpeg = pkgs.ffmpeg-full;
23 |
24 | libplacebo = pkgs.libplacebo.overrideAttrs (oldAttrs: rec {
25 | version = "7.349.0";
26 |
27 | src = pkgs.fetchFromGitLab {
28 | domain = "code.videolan.org";
29 | owner = "videolan";
30 | repo = "libplacebo";
31 | tag = "v${version}";
32 | hash = "sha256-mIjQvc7SRjE1Orb2BkHK+K1TcRQvzj2oUOCUT4DzIuA=";
33 | };
34 | });
35 | };
36 |
37 | scripts = with pkgs.mpvScripts; [
38 | mpris
39 | uosc
40 | thumbfast
41 | mpv-subtitle-lines
42 | ];
43 | };
44 |
45 | config = {
46 | fullscreen = true;
47 |
48 | screenshot-format = "png";
49 |
50 | title = "\${filename} - mpv";
51 | script-opts = "osc-title=\${filename},osc-boxalpha=150,osc-visibility=never,osc-boxvideo=yes";
52 |
53 | osc = "no";
54 | osd-on-seek = "no";
55 | osd-bar = "no";
56 | osd-bar-w = 30;
57 | osd-bar-h = "0.2";
58 | osd-duration = 750;
59 |
60 | autofit = "65%";
61 |
62 | slang = "jp,jpn,japanese";
63 | subs-fallback = false;
64 |
65 | inherit input-ipc-server;
66 | };
67 |
68 | bindings = {
69 | "ctrl+a" = "script-message osc-visibility cycle";
70 | "ctrl+f" = "script-binding subtitle_lines/list_subtitles";
71 | "Del" = "run \"trash\" \"\${path}\"; playlist_next";
72 | };
73 | };
74 |
75 | xdg.configFile = {
76 | "mpv/scripts/run_websocket_server.lua".text = # lua
77 | ''
78 | mp.command_native_async({
79 | name = "subprocess",
80 | playback_only = false,
81 | capture_stdout = true,
82 | capture_stderr = true,
83 |
84 | args = {
85 | "${getExe mpv-websocket}",
86 | "-m",
87 | "${input-ipc-server}",
88 | "-w",
89 | "6677",
90 | },
91 | })
92 | '';
93 |
94 | "mpv/script-opts/uosc.conf".text = lib.concatStrings [
95 | "opacity="
96 | ",timeline=0.1"
97 | ",position=0.2"
98 | ",chapters=0.075"
99 | ",slider=0.1"
100 | ",slider_gauge=0.2"
101 | ",controls=0"
102 | ",speed=0.2"
103 | ",menu=1"
104 | ",submenu=0.4"
105 | ",border=1"
106 | ",title=1"
107 | ",tooltip=1"
108 | ",thumbnail=1"
109 | ",curtain=0.8"
110 | ",idle_indicator=0.8"
111 | ",audio_indicator=0.5"
112 | ",buffering_indicator=0.3"
113 | ",playlist_position=0.8"
114 | ];
115 | };
116 | }
117 |
--------------------------------------------------------------------------------
/home/neovim.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | stylix.targets.neovim.plugin = "base16-nvim";
5 |
6 | programs.neovim = {
7 | enable = true;
8 | defaultEditor = true;
9 |
10 | extraPackages = with pkgs; [
11 | nodePackages.typescript-language-server
12 | nodePackages."@astrojs/language-server"
13 | emmet-language-server
14 | markdown-oxide
15 | tailwindcss-language-server
16 | vscode-langservers-extracted
17 | rust-analyzer
18 | texlab
19 | nixd
20 | universal-ctags
21 | typos-lsp
22 | ];
23 |
24 | extraConfig = # vim
25 | ''
26 | filetype plugin indent on
27 |
28 | set undofile
29 | set spell
30 | set number
31 | set linebreak
32 | set clipboard=unnamedplus
33 | set fileencoding=utf-8
34 | set fileencodings=utf-8,sjis
35 | set spelllang=en_us,cjk
36 | set noshowmode
37 | set mouse=a
38 | set ignorecase
39 | set smartcase
40 | set scrolloff=1
41 | set sidescrolloff=5
42 |
43 | set foldmethod=indent
44 | set foldlevelstart=99
45 |
46 | map
47 | imap
48 | map <2-MiddleMouse>
49 | imap <2-MiddleMouse>
50 | map <3-MiddleMouse>
51 | imap <3-MiddleMouse>
52 | map <4-MiddleMouse>
53 | imap <4-MiddleMouse>
54 |
55 | highlight Search ctermbg=240 ctermfg=255
56 | highlight IncSearch ctermbg=255 ctermfg=240
57 | highlight Folded ctermbg=NONE guibg=NONE
58 |
59 | let mapleader = ' '
60 |
61 | nnoremap e :set nu!
62 | nnoremap o :GitBlameToggle
63 | nnoremap a :NvimTreeFocus
64 | nnoremap d :bp\|bd #
65 | nnoremap f :Files
66 | nnoremap g :set hlsearch!
67 | nnoremap j :Buffers
68 | nnoremap l :Rg
69 | nnoremap ; :NvimTreeToggle
70 | nnoremap b :Vista!!
71 |
72 | autocmd BufWritePre,FileWritePre * silent! call mkdir(expand(':p:h'), 'p')
73 | autocmd VimEnter * silent! :cd `git rev-parse --show-toplevel`
74 |
75 | tnoremap
76 | '';
77 |
78 | plugins = with pkgs.vimPlugins; [
79 | {
80 | plugin = nvim-tree-lua;
81 | type = "lua";
82 | config = # lua
83 | ''
84 | require("nvim-tree").setup {
85 | update_focused_file = {
86 | enable = true
87 | }
88 | }
89 |
90 | vim.api.nvim_create_autocmd({"QuitPre"}, {
91 | callback = function()
92 | vim.cmd("NvimTreeClose")
93 | end
94 | })
95 |
96 | local function open_nvim_tree(data)
97 | local real_file = vim.fn.filereadable(data.file) == 1
98 | local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
99 |
100 | if not real_file and not no_name then
101 | return
102 | end
103 |
104 | require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
105 | end
106 |
107 | vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
108 | '';
109 | }
110 | {
111 | plugin = indent-blankline-nvim;
112 | type = "lua";
113 | config = # lua
114 | ''
115 | require("ibl").setup()
116 | '';
117 | }
118 | {
119 | plugin = gitsigns-nvim;
120 | type = "lua";
121 | config = # lua
122 | ''
123 | require('gitsigns').setup()
124 | '';
125 | }
126 | {
127 | plugin = nvim-web-devicons;
128 | type = "lua";
129 | }
130 | {
131 | plugin = nvim-scrollbar;
132 | type = "lua";
133 | config = # lua
134 | ''
135 | require("scrollbar").setup()
136 | '';
137 | }
138 | {
139 | plugin = nvim-lspconfig;
140 | type = "lua";
141 | config = # lua
142 | ''
143 | local lspconfig = require('lspconfig')
144 | local capabilities = require("cmp_nvim_lsp").default_capabilities()
145 |
146 | lspconfig.eslint.setup {
147 | capabilities = capabilities,
148 | on_attach = function(client, bufnr)
149 | vim.api.nvim_create_autocmd("BufWritePre", {
150 | buffer = bufnr,
151 | command = "EslintFixAll",
152 | })
153 | end
154 | }
155 |
156 | lspconfig.tailwindcss.setup {
157 | capabilities = capabilities,
158 | on_attach = function(client, bufnr)
159 | require("tailwindcss-colors").buf_attach(bufnr)
160 | end
161 | }
162 |
163 | lspconfig.nixd.setup {
164 | capabilities = capabilities,
165 | offset_encoding = 'utf-8'
166 | }
167 |
168 | vim.keymap.set('n', 'e', vim.diagnostic.open_float)
169 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
170 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
171 | vim.keymap.set('n', 'q', vim.diagnostic.setloclist)
172 |
173 | vim.api.nvim_create_autocmd('LspAttach', {
174 | group = vim.api.nvim_create_augroup('UserLspConfig', {}),
175 |
176 | callback = function(ev)
177 | local opts = { buffer = ev.buf }
178 |
179 | vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
180 | vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
181 | vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
182 | vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
183 | vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts)
184 | vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts)
185 | vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts)
186 | vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts)
187 | vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
188 | end,
189 | })
190 |
191 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
192 | vim.lsp.handlers.hover, { border = "single" }
193 | )
194 |
195 | vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
196 | vim.lsp.handlers.signature_help, { border = "single" }
197 | )
198 |
199 | vim.diagnostic.config {
200 | float = { border = "single" }
201 | }
202 | '';
203 | }
204 | {
205 | plugin = nvim-cmp;
206 | type = "lua";
207 | config = # lua
208 | ''
209 | local capabilities = require("cmp_nvim_lsp").default_capabilities()
210 | local lspconfig = require('lspconfig')
211 |
212 | local servers = {
213 | 'rust_analyzer',
214 | 'markdown_oxide',
215 | 'html',
216 | 'texlab',
217 | 'prismals',
218 | 'jsonls',
219 | 'emmet_language_server',
220 | 'astro',
221 | 'cssls',
222 | 'ts_ls',
223 | 'typos_lsp',
224 | }
225 |
226 | for _, lsp in ipairs(servers) do
227 | lspconfig[lsp].setup {
228 | capabilities = capabilities,
229 | }
230 | end
231 |
232 | local luasnip = require('luasnip')
233 | local cmp = require('cmp')
234 |
235 | cmp.setup {
236 | snippet = {
237 | expand = function(args)
238 | luasnip.lsp_expand(args.body)
239 | end,
240 | },
241 | mapping = cmp.mapping.preset.insert({
242 | [''] = cmp.mapping.scroll_docs(-4),
243 | [''] = cmp.mapping.scroll_docs(4),
244 | [''] = cmp.mapping.complete(),
245 |
246 | [''] = cmp.mapping.confirm {
247 | behavior = cmp.ConfirmBehavior.Replace,
248 | select = true,
249 | },
250 |
251 | [''] = cmp.mapping(function(fallback)
252 | if cmp.visible() then
253 | cmp.select_next_item()
254 | elseif luasnip.expand_or_jumpable() then
255 | luasnip.expand_or_jump()
256 | else
257 | fallback()
258 | end
259 | end, { 'i', 's' }),
260 |
261 | [''] = cmp.mapping(function(fallback)
262 | if cmp.visible() then
263 | cmp.select_prev_item()
264 | elseif luasnip.jumpable(-1) then
265 | luasnip.jump(-1)
266 | else
267 | fallback()
268 | end
269 | end, { 'i', 's' }),
270 | }),
271 |
272 | sources = {
273 | { name = 'nvim_lsp' },
274 | { name = 'luasnip' },
275 | },
276 | }
277 | '';
278 | }
279 | cmp-nvim-lsp
280 | cmp_luasnip
281 | {
282 | plugin = luasnip;
283 | type = "lua";
284 | config = # lua
285 | ''
286 | require("luasnip.loaders.from_vscode").lazy_load()
287 | '';
288 | }
289 | friendly-snippets
290 | {
291 | plugin = lualine-nvim;
292 | type = "lua";
293 | config = # lua
294 | ''
295 | local theme = require("lualine.themes.base16")
296 | theme.normal.b.bg = nil
297 | theme.normal.c.bg = nil
298 | theme.replace.b.bg = nil
299 | theme.insert.b.bg = nil
300 | theme.visual.b.bg = nil
301 | theme.inactive.a.bg = nil
302 | theme.inactive.b.bg = nil
303 | theme.inactive.c.bg = nil
304 |
305 | require('lualine').setup {
306 | options = {
307 | theme = theme,
308 | disabled_filetypes = {'NvimTree', 'tagbar'}
309 | },
310 | sections = { lualine_c = {'%f'} }
311 | }
312 | '';
313 | }
314 | {
315 | plugin = git-blame-nvim;
316 | type = "lua";
317 | }
318 | {
319 | plugin = comment-nvim;
320 | type = "lua";
321 | config = # lua
322 | ''
323 | require('Comment').setup {
324 | pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()
325 | }
326 | '';
327 | }
328 | {
329 | plugin = nvim-autopairs;
330 | type = "lua";
331 | config = # lua
332 | ''
333 | require("nvim-autopairs").setup()
334 | '';
335 | }
336 | {
337 | plugin = auto-save-nvim;
338 | type = "lua";
339 | config = # lua
340 | ''
341 | require("auto-save").setup()
342 | '';
343 | }
344 | {
345 | plugin = vimtex;
346 | config = # vim
347 | ''
348 | let g:vimtex_mappings_enabled = 0
349 | let g:vimtex_imaps_enabled = 0
350 | let g:vimtex_view_method = 'zathura'
351 | let g:vimtex_compiler_latexmk = {'out_dir': '/tmp/vimtex'}
352 |
353 | nnoremap f (vimtex-view)
354 | nnoremap g (vimtex-compile)
355 | nnoremap d (vimtex-env-delete)
356 | nnoremap c (vimtex-env-change)
357 | '';
358 | }
359 | {
360 | plugin = nvim-ts-autotag;
361 | type = "lua";
362 | config = # lua
363 | ''
364 | require('nvim-ts-autotag').setup()
365 | '';
366 | }
367 | {
368 | plugin = nvim-surround;
369 | type = "lua";
370 | config = # lua
371 | ''
372 | require('nvim-surround').setup()
373 | '';
374 | }
375 | {
376 | plugin = tailwindcss-colors-nvim;
377 | type = "lua";
378 | config = # lua
379 | ''
380 | require('tailwindcss-colors').setup()
381 | '';
382 | }
383 | {
384 | plugin = nvim-ts-context-commentstring;
385 | type = "lua";
386 | config = # lua
387 | ''
388 | require('ts_context_commentstring').setup {
389 | enable_autocmd = false,
390 | }
391 | '';
392 | }
393 | {
394 | plugin = nvim-treesitter.withAllGrammars;
395 | type = "lua";
396 | config = # lua
397 | ''
398 | require('nvim-treesitter.configs').setup {
399 | highlight = {
400 | enable = true,
401 | disable = function(lang)
402 | return lang ~= "javascript"
403 | and lang ~= "tsx"
404 | and lang ~= "typescript"
405 | and lang ~= "astro"
406 | and lang ~= "css"
407 | and lang ~= "glsl"
408 | and lang ~= "nix"
409 | and lang ~= "prisma"
410 | and lang ~= "markdown"
411 | end,
412 | additional_vim_regex_highlighting = true,
413 | },
414 | }
415 | '';
416 | }
417 | {
418 | plugin = vista-vim;
419 | config = # vim
420 | ''
421 | let g:vista_default_executive = 'nvim_lsp'
422 | let g:vista_executive_for = {
423 | \ 'rust': 'ctags',
424 | \ }
425 |
426 | autocmd QuitPre * silent! :Vista!
427 | '';
428 | }
429 | fzf-vim
430 | vim-graphql
431 | vim-javascript
432 | vim-jsx-pretty
433 | rust-vim
434 | neoformat
435 | vim-nix
436 | tagbar
437 | rainbow-delimiters-nvim
438 | ];
439 | };
440 | }
441 |
--------------------------------------------------------------------------------
/home/picom.nix:
--------------------------------------------------------------------------------
1 | { lib, ... }:
2 |
3 | {
4 | services.picom = rec {
5 | enable = true;
6 | backend = "glx";
7 |
8 | vSync = true;
9 | fade = true;
10 | shadow = true;
11 |
12 | fadeDelta = 5;
13 | shadowOpacity = 0.2;
14 |
15 | fadeExclude = [
16 | "window_type = 'menu'"
17 | "window_type = 'dropdown_menu'"
18 | "window_type = 'popup_menu'"
19 | "window_type = 'tooltip'"
20 | ];
21 |
22 | shadowExclude = fadeExclude ++ [
23 | "class_g = 'slop'"
24 | "class_g = 'coord'"
25 | ];
26 |
27 | opacityRules = [
28 | "95:class_g = 'Thunar'"
29 | ];
30 |
31 | settings = {
32 | blur = {
33 | method = "dual_kawase";
34 | size = 10;
35 | };
36 |
37 | blur-background-exclude = [
38 | "class_g = 'slop'"
39 | "class_g = 'coord'"
40 | ];
41 |
42 | clip-shadow-above = [
43 | "class_g = 'dwm'"
44 | ];
45 | };
46 | };
47 |
48 | systemd.user.services.picom = lib.mkForce { };
49 | }
50 |
--------------------------------------------------------------------------------
/home/pqiv.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.pqiv = {
3 | enable = true;
4 |
5 | settings = {
6 | options = {
7 | lazy-load = true;
8 | hide-info-box = true;
9 | scale-mode-screen-fraction = true;
10 | background-pattern = "black";
11 | disable-backends = "archive,archive_cbx,libav,poppler,spectre";
12 | thumbnail-size = "256x256";
13 | command-1 = "thunar";
14 | command-2 = "trash put";
15 | };
16 | };
17 |
18 | extraConfig = ''
19 | [actions]
20 | set_cursor_auto_hide(1)
21 | '';
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/home/presenterm.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | let
4 | inherit (builtins) toJSON;
5 | in
6 | {
7 | home.packages = with pkgs; [ presenterm ];
8 |
9 | xdg.configFile."presenterm/config.yaml".text = toJSON {
10 | defaults = {
11 | theme = "terminal-dark";
12 | validate_overflows = "always";
13 | };
14 |
15 | options.implicit_slide_ends = true;
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/home/ripgrep.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.ripgrep = {
3 | enable = true;
4 |
5 | arguments = [
6 | "--max-columns=2000"
7 | "--smart-case"
8 | ];
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/home/rmpc.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 |
3 | let
4 | inherit (config.xdg.userDirs) music;
5 |
6 | musicDirectory = music;
7 | in
8 | {
9 | home.packages = with pkgs; [ rmpc ];
10 |
11 | services.mpd = {
12 | enable = true;
13 | inherit musicDirectory;
14 |
15 | extraConfig = ''
16 | audio_output {
17 | type "pipewire"
18 | name "PipeWire Sound Server"
19 | }
20 |
21 | auto_update "yes"
22 | '';
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/home/rofi.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | lib,
4 | pkgs,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (lib) mkForce;
10 | inherit (config.lib.formats.rasi) mkLiteral;
11 | inherit (config.lib.stylix.colors.withHashtag) base00 base05;
12 | in
13 | {
14 | programs.rofi = {
15 | enable = true;
16 | cycle = false;
17 |
18 | package = pkgs.rofi-wayland;
19 |
20 | extraConfig = {
21 | modi = "drun,filebrowser";
22 | font = "Noto Sans CJK JP 12";
23 | show-icons = true;
24 | disable-history = true;
25 | hover-select = true;
26 | bw = 0;
27 | display-drun = "";
28 | display-window = "";
29 | display-combi = "";
30 | icon-theme = "Fluent-dark";
31 | terminal = "kitty";
32 | drun-match-fields = "name";
33 | drun-display-format = "{name}";
34 | me-select-entry = "";
35 | me-accept-entry = "MousePrimary";
36 | kb-cancel = "Escape,MouseMiddle";
37 | };
38 |
39 | # Based on Newman Sánchez's Launchpad theme
40 | theme = mkForce {
41 | "*" = {
42 | font = "Noto Sans CJK JP Bold 12";
43 | background-color = mkLiteral "transparent";
44 | foreground = mkLiteral "${base05}";
45 | text-color = mkLiteral "${base05}";
46 | padding = mkLiteral "0px";
47 | margin = mkLiteral "0px";
48 | };
49 |
50 | window = {
51 | fullscreen = true;
52 | padding = mkLiteral "1em";
53 | background-color = mkLiteral "${base00}dd";
54 | };
55 |
56 | mainbox = {
57 | padding = mkLiteral "8px";
58 | };
59 |
60 | inputbar = {
61 | background-color = mkLiteral "${base05}20";
62 |
63 | margin = mkLiteral "0px calc( 50% - 230px )";
64 | padding = mkLiteral "4px 8px";
65 | spacing = mkLiteral "8px";
66 |
67 | border = mkLiteral "1px";
68 | border-radius = mkLiteral "2px";
69 | border-color = mkLiteral "${base05}40";
70 |
71 | children = map mkLiteral [
72 | "icon-search"
73 | "entry"
74 | ];
75 | };
76 |
77 | prompt = {
78 | enabled = false;
79 | };
80 |
81 | icon-search = {
82 | expand = false;
83 | filename = "search";
84 | vertical-align = mkLiteral "0.5";
85 | };
86 |
87 | entry = {
88 | placeholder = "Search";
89 | placeholder-color = mkLiteral "${base05}20";
90 | };
91 |
92 | listview = {
93 | margin = mkLiteral "48px calc( 50% - 720px )";
94 | margin-bottom = mkLiteral "0px";
95 | spacing = mkLiteral "48px";
96 | columns = 6;
97 | fixed-columns = true;
98 | };
99 |
100 | "element, element-text, element-icon" = {
101 | cursor = mkLiteral "pointer";
102 | };
103 |
104 | element = {
105 | padding = mkLiteral "8px";
106 | spacing = mkLiteral "4px";
107 |
108 | orientation = mkLiteral "vertical";
109 | border-radius = mkLiteral "12px";
110 | };
111 |
112 | "element selected" = {
113 | background-color = mkLiteral "${base05}33";
114 | };
115 |
116 | element-icon = {
117 | size = mkLiteral "5.75em";
118 | horizontal-align = mkLiteral "0.5";
119 | };
120 |
121 | element-text = {
122 | horizontal-align = mkLiteral "0.5";
123 | };
124 | };
125 | };
126 | }
127 |
--------------------------------------------------------------------------------
/home/starship.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.starship = {
3 | enable = true;
4 |
5 | settings = {
6 | add_newline = false;
7 |
8 | directory = {
9 | style = "purple";
10 | read_only = " ro";
11 | };
12 |
13 | git_branch = {
14 | style = "yellow";
15 | symbol = "";
16 | };
17 |
18 | character = {
19 | success_symbol = "[>](red)[>](green)[>](blue)";
20 | error_symbol = "[>](cyan)[>](purple)[>](yellow)";
21 | vicmd_symbol = "[<](bold green)";
22 | };
23 |
24 | line_break.disabled = true;
25 |
26 | nodejs = {
27 | format = "with [$symbol($version )]($style)";
28 | symbol = "node ";
29 | version_format = "\${major}";
30 | disabled = true;
31 | };
32 |
33 | git_commit.tag_symbol = " tag ";
34 |
35 | git_status = {
36 | ahead = ">";
37 | behind = "<";
38 | diverged = "<>";
39 | renamed = "r";
40 | deleted = "x";
41 | };
42 |
43 | aws.symbol = "aws ";
44 | cobol.symbol = "cobol ";
45 | conda.symbol = "conda ";
46 | crystal.symbol = "cr ";
47 | cmake.symbol = "cmake ";
48 | dart.symbol = "dart ";
49 | deno.symbol = "deno ";
50 | dotnet.symbol = ".NET ";
51 | docker_context.symbol = "docker ";
52 | elixir.symbol = "exs ";
53 | elm.symbol = "elm ";
54 | golang.symbol = "go ";
55 | hg_branch.symbol = "hg ";
56 | java.symbol = "java ";
57 | julia.symbol = "jl ";
58 | kotlin.symbol = "kt ";
59 | memory_usage.symbol = "memory ";
60 | nim.symbol = "nim ";
61 |
62 | nix_shell = {
63 | format = "❄️ ";
64 | symbol = "nix ";
65 | };
66 |
67 | ocaml.symbol = "ml ";
68 | package.symbol = "pkg ";
69 | perl.symbol = "pl ";
70 | php.symbol = "php ";
71 | purescript.symbol = "purs ";
72 | python.symbol = "python ";
73 | ruby.symbol = "ruby ";
74 |
75 | rust = {
76 | symbol = "rust ";
77 | disabled = true;
78 | };
79 |
80 | bun = {
81 | symbol = "bun ";
82 | disabled = true;
83 | };
84 |
85 | scala.symbol = "scala ";
86 | swift.symbol = "swift ";
87 | };
88 | };
89 | }
90 |
--------------------------------------------------------------------------------
/home/thunar.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | home.packages = with pkgs; [
5 | icoextract
6 | thud
7 | ];
8 |
9 | xdg.configFile."xfce4/helpers.rc".text = # ini
10 | ''
11 | TerminalEmulator=kitty
12 | TerminalEmulatorDismissed=true
13 | '';
14 | }
15 |
--------------------------------------------------------------------------------
/home/tmux.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.tmux = {
3 | enable = true;
4 | mouse = true;
5 |
6 | keyMode = "vi";
7 |
8 | extraConfig = # fish
9 | ''
10 | set -sg escape-time 0
11 |
12 | set -g renumber-windows on
13 | set -g status-right ""
14 | set -g status-left ""
15 | set -g status-justify centre
16 | set -g status-bg black
17 | set -g status-fg white
18 | set -g default-terminal "tmux-256color"
19 | '';
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/home/udiskie.nix:
--------------------------------------------------------------------------------
1 | {
2 | services.udiskie.enable = true;
3 | }
4 |
--------------------------------------------------------------------------------
/home/xdg-user-dirs.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 |
3 | let
4 | inherit (config.home) homeDirectory;
5 | in
6 | {
7 | xdg = {
8 | userDirs = {
9 | enable = true;
10 | createDirectories = true;
11 |
12 | templates = null;
13 | publicShare = null;
14 |
15 | desktop = homeDirectory;
16 | download = "${homeDirectory}/ダウンロード";
17 | documents = "${homeDirectory}/ドキュメント";
18 | music = "${homeDirectory}/音楽";
19 | pictures = "${homeDirectory}/画像";
20 | videos = "${homeDirectory}/ビデオ";
21 | };
22 |
23 | configFile."user-dirs.locale".text = "ja_JP";
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/home/xresources.nix:
--------------------------------------------------------------------------------
1 | {
2 | xresources.properties = {
3 | "Xft.hinting" = true;
4 | "Xft.antialias" = true;
5 | "Xft.autohint" = false;
6 | "Xft.lcdfilter" = "lcddefault";
7 | "Xft.hintstyle" = "hintfull";
8 | "Xft.rgba" = "rgb";
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/home/yazi.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.yazi = {
3 | enable = true;
4 |
5 | settings = {
6 | mgr = {
7 | sort_dir_first = true;
8 | linemode = "mtime";
9 |
10 | ratio = [
11 | 1
12 | 2
13 | 4
14 | ];
15 | };
16 |
17 | preview = {
18 | tab_size = 4;
19 | image_filter = "lanczos3";
20 | max_width = 1920;
21 | max_height = 1080;
22 | image_quality = 90;
23 | };
24 | };
25 |
26 | keymap = {
27 | mgr.prepend_keymap = [
28 | {
29 | run = "remove --force";
30 | on = [ "d" ];
31 | }
32 | ];
33 | };
34 | };
35 | }
36 |
--------------------------------------------------------------------------------
/home/zathura.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.zathura = {
3 | enable = true;
4 |
5 | options = {
6 | guioptions = "v";
7 | adjust-open = "width";
8 | statusbar-basename = true;
9 | render-loading = false;
10 | scroll-step = 120;
11 | };
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/hosts/laptop/configuration.nix:
--------------------------------------------------------------------------------
1 | { nix-config, pkgs, ... }:
2 |
3 | let
4 | inherit (builtins) attrValues;
5 | in
6 | {
7 | imports = attrValues nix-config.nixosModules;
8 | nixpkgs.overlays = attrValues nix-config.overlays;
9 | home-manager.sharedModules = attrValues nix-config.homeModules;
10 | environment.systemPackages = attrValues nix-config.packages.${pkgs.system};
11 |
12 | modules = {
13 | hardware = {
14 | keyboardBinds = true;
15 | lidIgnore = true;
16 | bluetooth = true;
17 | };
18 |
19 | system = {
20 | mullvad = true;
21 | };
22 |
23 | desktop = {
24 | bloat = true;
25 | };
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/hosts/laptop/hardware-configuration.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | lib,
4 | modulesPath,
5 | ...
6 | }:
7 |
8 | {
9 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
10 |
11 | boot = {
12 | initrd = {
13 | luks.devices."root".device = "/dev/disk/by-label/nixos-luks";
14 |
15 | availableKernelModules = [
16 | "nvme"
17 | "xhci_pci"
18 | "usb_storage"
19 | "sd_mod"
20 | ];
21 |
22 | kernelModules = [ ];
23 | };
24 |
25 | kernelModules = [ "kvm-amd" ];
26 | extraModulePackages = [ ];
27 | };
28 |
29 | fileSystems = {
30 | "/" = {
31 | device = "/dev/disk/by-label/nixos";
32 | fsType = "btrfs";
33 | };
34 |
35 | "/boot" = {
36 | device = "/dev/disk/by-label/boot";
37 | fsType = "vfat";
38 | };
39 | };
40 |
41 | swapDevices = [ ];
42 |
43 | networking.useDHCP = lib.mkDefault true;
44 |
45 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
46 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
47 | }
48 |
--------------------------------------------------------------------------------
/modules/containers.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | nix-config,
4 | lib,
5 | pkgs,
6 | ...
7 | }:
8 |
9 | let
10 | inherit (lib) mkIf;
11 | inherit (config.modules.system) username;
12 | inherit (config.boot) enableContainers;
13 |
14 | template = {
15 | ephemeral = true;
16 | restartIfChanged = false;
17 |
18 | bindMounts = {
19 | "/mnt" = {
20 | hostPath = "/home/${username}/containers/wine";
21 | isReadOnly = false;
22 | };
23 |
24 | media = rec {
25 | hostPath = "/media";
26 | mountPoint = hostPath;
27 | };
28 |
29 | waylandDisplay = rec {
30 | hostPath = "/run/user/1000";
31 | mountPoint = hostPath;
32 | };
33 |
34 | x11Display = rec {
35 | hostPath = "/tmp/.X11-unix";
36 | mountPoint = hostPath;
37 | };
38 |
39 | seq = rec {
40 | hostPath = "/dev/snd/seq";
41 | mountPoint = hostPath;
42 | };
43 |
44 | dri = rec {
45 | hostPath = "/dev/dri";
46 | mountPoint = hostPath;
47 | };
48 | };
49 |
50 | allowedDevices = [
51 | {
52 | modifier = "rw";
53 | node = "/dev/dri/renderD128";
54 | }
55 | {
56 | modifier = "rw";
57 | node = "/dev/snd/seq";
58 | }
59 | ];
60 |
61 | specialArgs = {
62 | inherit nix-config;
63 | };
64 | };
65 | in
66 | {
67 | environment.systemPackages = mkIf (pkgs.system == "x86_64-linux") (
68 | with nix-config.inputs.sakaya.packages.${pkgs.system}; [ sakaya ]
69 | );
70 |
71 | containers = mkIf enableContainers {
72 | wine = template // {
73 | config =
74 | { nix-config, pkgs, ... }:
75 | {
76 | imports =
77 | with nix-config.nixosModules;
78 | [
79 | shell
80 | desktop
81 | system
82 | stylix
83 | fonts
84 | ]
85 | ++ (with nix-config.inputs.sakaya.nixosModules; [ sakaya ]);
86 |
87 | sakaya.enable = true;
88 |
89 | home-manager.sharedModules = with nix-config.homeModules; [
90 | fish
91 | git
92 | gtk
93 | kitty
94 | neovim
95 | xresources
96 | yazi
97 | ];
98 |
99 | nixpkgs.overlays = builtins.attrValues nix-config.overlays;
100 |
101 | environment = {
102 | systemPackages = with pkgs; [
103 | wineWowPackages.stagingFull
104 | winetricks
105 | ];
106 |
107 | variables.TERM = "xterm-kitty";
108 | };
109 |
110 | hardware.graphics.enable = true;
111 | };
112 | };
113 | };
114 | }
115 |
--------------------------------------------------------------------------------
/modules/desktop.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | config,
4 | lib,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (config.modules.system) username;
10 | inherit (config.boot) isContainer;
11 |
12 | inherit (lib)
13 | mkEnableOption
14 | mkIf
15 | mkMerge
16 | ;
17 |
18 | inherit (cfg) bloat;
19 |
20 | cfg = config.modules.desktop;
21 | in
22 | {
23 | options.modules.desktop = {
24 | bloat = mkEnableOption "GUI applications";
25 | };
26 |
27 | config = {
28 | hardware.graphics.enable32Bit = mkIf (pkgs.system == "x86_64-linux") true;
29 |
30 | programs = {
31 | hyprland.enable = mkIf (!isContainer) true;
32 | cdemu.enable = true;
33 |
34 | thunar = {
35 | enable = true;
36 |
37 | plugins = with pkgs.xfce; [
38 | thunar-volman
39 | ];
40 | };
41 | };
42 |
43 | i18n.inputMethod = {
44 | enable = true;
45 | type = "fcitx5";
46 |
47 | fcitx5 = {
48 | waylandFrontend = true;
49 |
50 | addons = with pkgs; [
51 | fcitx5-mozc
52 | ];
53 | };
54 | };
55 |
56 | services = {
57 | udisks2 = {
58 | enable = true;
59 | mountOnMedia = true;
60 | };
61 |
62 | libinput = {
63 | touchpad = {
64 | naturalScrolling = true;
65 | accelProfile = "flat";
66 | accelSpeed = "0.75";
67 | };
68 |
69 | mouse = {
70 | accelProfile = "flat";
71 | };
72 | };
73 |
74 | xserver = mkIf (!isContainer) {
75 | enable = true;
76 | excludePackages = with pkgs; [ xterm ];
77 |
78 | displayManager.startx.enable = true;
79 | };
80 |
81 | pipewire = {
82 | enable = true;
83 |
84 | alsa = {
85 | enable = true;
86 | support32Bit = true;
87 | };
88 |
89 | pulse.enable = true;
90 | };
91 |
92 | greetd = mkIf (!isContainer) {
93 | enable = true;
94 | restart = false;
95 |
96 | settings = {
97 | default_session = {
98 | command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland --time-format '%F %R'";
99 | user = "greeter";
100 | };
101 |
102 | initial_session = {
103 | command = "${pkgs.hyprland}/bin/Hyprland";
104 | user = username;
105 | };
106 | };
107 | };
108 |
109 | tumbler.enable = true;
110 | gvfs.enable = true;
111 | gnome.gnome-keyring.enable = true;
112 | upower.enable = true;
113 | };
114 |
115 | environment.systemPackages = mkMerge [
116 | (mkIf bloat (
117 | with pkgs;
118 | [
119 | wineWowPackages.stagingFull
120 | winetricks
121 | mullvad-browser
122 | spek
123 | audacity
124 | gimp
125 | libreoffice
126 | element-desktop
127 | signal-desktop-bin
128 | qbittorrent
129 | popsicle
130 | satty
131 | srb2
132 | ringracers
133 | texliveFull
134 | sqlitebrowser
135 | qdiskinfo
136 | shotwell
137 | mkvtoolnix
138 | meld
139 | flacon
140 | vlc
141 | picard
142 | czkawka
143 | wvkbd
144 | rehex
145 | ]
146 | ))
147 |
148 | (with pkgs; [
149 | anki
150 | pulseaudio
151 | pavucontrol
152 | grim
153 | wl-clipboard-rs
154 | antimicrox
155 | libnotify
156 | ])
157 | ];
158 | };
159 | }
160 |
--------------------------------------------------------------------------------
/modules/fonts.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | fonts = {
5 | enableDefaultPackages = false;
6 |
7 | packages = with pkgs; [
8 | aleo-fonts
9 | noto-fonts
10 | noto-fonts-cjk-serif
11 | noto-fonts-cjk-sans
12 | noto-fonts-color-emoji
13 | maple-mono.variable
14 | font-awesome
15 | nerd-fonts.noto
16 | kanji-stroke-order-font
17 | liberation_ttf
18 | ];
19 |
20 | fontconfig = {
21 | defaultFonts = {
22 | serif = [
23 | "Noto Serif CJK JP"
24 | "Noto Serif"
25 | ];
26 |
27 | sansSerif = [
28 | "Noto Sans CJK JP"
29 | "Noto Sans"
30 | ];
31 |
32 | monospace = [
33 | "Noto Sans Mono CJK JP"
34 | "Noto Sans Mono"
35 | ];
36 | };
37 |
38 | allowBitmaps = false;
39 | };
40 | };
41 | }
42 |
--------------------------------------------------------------------------------
/modules/hardware.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | config,
4 | lib,
5 | ...
6 | }:
7 |
8 | let
9 | inherit (config.modules.system) username;
10 |
11 | inherit (builtins) toJSON;
12 |
13 | inherit (lib)
14 | mkEnableOption
15 | mkIf
16 | getExe
17 | singleton
18 | ;
19 |
20 | inherit (cfg)
21 | mouseSettings
22 | lidIgnore
23 | keyboardBinds
24 | bluetooth
25 | ;
26 |
27 | dualFunctionKeysConfig = "dual-function-keys.yaml";
28 |
29 | cfg = config.modules.hardware;
30 | in
31 | {
32 | options.modules.hardware = {
33 | keyboardBinds = mkEnableOption "caps lock as ctrl when held and esc when tapped";
34 | mouseSettings = mkEnableOption "piper for gaming mice";
35 | bluetooth = mkEnableOption "bluetooth support";
36 | lidIgnore = mkEnableOption "ignoring the laptop lid on close";
37 | };
38 |
39 | config = {
40 | hardware = {
41 | bluetooth.enable = mkIf bluetooth true;
42 |
43 | openrazer = mkIf mouseSettings {
44 | enable = true;
45 | users = [ username ];
46 | };
47 | };
48 |
49 | services = {
50 | ratbagd.enable = mkIf mouseSettings true;
51 |
52 | logind = {
53 | lidSwitch = mkIf lidIgnore "ignore";
54 | extraConfig = "HandlePowerKey=suspend";
55 | };
56 |
57 | interception-tools = {
58 | enable = mkIf keyboardBinds true;
59 |
60 | plugins = with pkgs.interception-tools-plugins; [
61 | dual-function-keys
62 | ];
63 |
64 | udevmonConfig = toJSON (singleton {
65 | JOB = # bash
66 | ''
67 | ${pkgs.interception-tools}/bin/intercept -g $DEVNODE |
68 | ${getExe pkgs.interception-tools-plugins.dual-function-keys} -c /etc/${dualFunctionKeysConfig} |
69 | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE
70 | '';
71 |
72 | DEVICE = {
73 | EVENTS = {
74 | EV_KEY = [
75 | "KEY_CAPSLOCK"
76 | "KEY_ESC"
77 | ];
78 | };
79 | };
80 | });
81 | };
82 | };
83 |
84 | environment = {
85 | systemPackages = mkIf mouseSettings (
86 | with pkgs;
87 | [
88 | piper
89 | polychromatic
90 | ]
91 | );
92 |
93 | etc.${dualFunctionKeysConfig}.text = toJSON {
94 | TIMING = [
95 | { TAP_MILLISEC = 1000; }
96 | { DOUBLE_TAP_MILLISEC = 0; }
97 | { SYNTHETIC_KEYS_PAUSE_MILLISEC = 0; }
98 | ];
99 |
100 | MAPPINGS = [
101 | {
102 | KEY = "KEY_CAPSLOCK";
103 | TAP = "KEY_ESC";
104 | HOLD = "KEY_LEFTCTRL";
105 | }
106 | ];
107 | };
108 | };
109 | };
110 | }
111 |
--------------------------------------------------------------------------------
/modules/librewolf.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | programs.firefox = {
5 | enable = true;
6 | package = pkgs.librewolf;
7 |
8 | policies = {
9 | ExtensionSettings = {
10 | "showdex@tize.io" = {
11 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/showdex/latest.xpi";
12 | installation_mode = "force_installed";
13 | };
14 |
15 | "{6b733b82-9261-47ee-a595-2dda294a4d08}" = {
16 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/yomitan/latest.xpi";
17 | installation_mode = "force_installed";
18 | };
19 |
20 | "{5003e502-f361-4bf6-b09e-41a844d36d33}" = {
21 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/redlib/latest.xpi";
22 | installation_mode = "force_installed";
23 | };
24 |
25 | "uBlock0@raymondhill.net" = {
26 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
27 | installation_mode = "force_installed";
28 | };
29 | };
30 | };
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/modules/shell.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | users.defaultUserShell = pkgs.fish;
5 |
6 | environment = {
7 | shells = with pkgs; [
8 | fish
9 | ];
10 |
11 | systemPackages = with pkgs; [
12 | jq
13 | fd
14 | xh
15 | file
16 | timg
17 | choose
18 | sd
19 | rustscan
20 | yt-dlp
21 | sox
22 | asak
23 | timer
24 | dig
25 | mtr
26 | mediainfo
27 | fdupes
28 | whois
29 | killall
30 | trashy
31 | hwinfo
32 | duf
33 | stress
34 | hdparm
35 | recode
36 | jpegoptim
37 | pass
38 | tango
39 | npm-check-updates
40 | microfetch
41 | onefetch
42 | scc
43 | genact
44 | sanctity
45 | asciiquarium-transparent
46 | cmatrix
47 | gdu
48 | hexyl
49 | pgcli
50 | litecli
51 | p7zip
52 | unar
53 | rsync
54 | rclone
55 | megacmd
56 | ffmpeg
57 | imagemagick
58 | smartmontools
59 | restic
60 | borgbackup
61 | zbar
62 | phraze
63 | lychee
64 | bluetui
65 | nixpkgs-review
66 | nix-init
67 | nix-update
68 | statix
69 | nvd
70 | nix-search-cli
71 | nix-tree
72 | gcc
73 | rustc
74 | rustfmt
75 | cargo
76 | cargo-tarpaulin
77 | bacon
78 | clippy
79 | nodejs
80 | monolith
81 | haylxon
82 | nix-inspect
83 | remind
84 | oxipng
85 | lazydocker
86 | viddy
87 | jless
88 | rclip
89 | exiftool
90 | xsubfind3r
91 | all-the-package-names
92 | pik
93 | bottom
94 | pdfminer
95 | dos2unix
96 | clock-rs
97 | taskwarrior3
98 | unflac
99 | openai-whisper
100 | zizmor
101 | go-grip
102 | eclint
103 | editorconfig-checker
104 | mountpoint-s3
105 | ];
106 | };
107 |
108 | programs = {
109 | fish.enable = true;
110 | neovim.enable = true;
111 |
112 | direnv = {
113 | enable = true;
114 | silent = true;
115 | };
116 | };
117 | }
118 |
--------------------------------------------------------------------------------
/modules/stylix.nix:
--------------------------------------------------------------------------------
1 | {
2 | nix-config,
3 | config,
4 | pkgs,
5 | ...
6 | }:
7 |
8 | let
9 | stylix-background = nix-config.packages.${pkgs.system}.stylix-background.override {
10 | color = config.lib.stylix.colors.base00;
11 | };
12 |
13 | opacity = 0.95;
14 | fontSize = 11;
15 | in
16 | {
17 | imports = with nix-config.inputs.stylix.nixosModules; [ stylix ];
18 |
19 | stylix = {
20 | enable = true;
21 | image = "${stylix-background}/wallpaper.png";
22 | polarity = "dark";
23 |
24 | base16Scheme = {
25 | system = "base16";
26 | name = "selenized-black";
27 | author = "Jan Warchol (https://github.com/jan-warchol/selenized) / adapted to base16 by ali";
28 | variant = "dark";
29 |
30 | palette = {
31 | base00 = "181818";
32 | base01 = "252525";
33 | base02 = "3b3b3b";
34 | base03 = "777777";
35 | base04 = "777777";
36 | base05 = "b9b9b9";
37 | base06 = "dedede";
38 | base07 = "dedede";
39 | base08 = "ed4a46";
40 | base09 = "e67f43";
41 | base0A = "dbb32d";
42 | base0B = "70b433";
43 | base0C = "3fc5b7";
44 | base0D = "368aeb";
45 | base0E = "a580e2";
46 | base0F = "eb6eb7";
47 | };
48 | };
49 |
50 | opacity = {
51 | terminal = opacity;
52 | popups = opacity;
53 | };
54 |
55 | cursor = {
56 | package = pkgs.phinger-cursors;
57 | name = "phinger-cursors";
58 | size = 24;
59 | };
60 |
61 | fonts = {
62 | serif = {
63 | package = pkgs.aleo-fonts;
64 | name = "Aleo";
65 | };
66 |
67 | sansSerif = {
68 | package = pkgs.noto-fonts-cjk-sans;
69 | name = "Noto Sans CJK JP";
70 | };
71 |
72 | monospace = {
73 | package = pkgs.maple-mono.variable;
74 | name = "Maple Mono";
75 | };
76 |
77 | emoji = {
78 | package = pkgs.noto-fonts-color-emoji;
79 | name = "Noto Color Emoji";
80 | };
81 |
82 | sizes = {
83 | applications = fontSize;
84 | desktop = fontSize;
85 | popups = fontSize;
86 | terminal = fontSize;
87 | };
88 | };
89 | };
90 | }
91 |
--------------------------------------------------------------------------------
/modules/system.nix:
--------------------------------------------------------------------------------
1 | {
2 | nix-config,
3 | pkgs,
4 | lib,
5 | config,
6 | ...
7 | }:
8 |
9 | let
10 | inherit (lib.types) nullOr str listOf;
11 | inherit (config.boot) isContainer;
12 |
13 | inherit (lib)
14 | mkOption
15 | mkEnableOption
16 | mkIf
17 | singleton
18 | optional
19 | ;
20 |
21 | inherit (cfg)
22 | username
23 | iHaveLotsOfRam
24 | hashedPassword
25 | mullvad
26 | allowSRB2Port
27 | allowDevPort
28 | ;
29 |
30 | cfg = config.modules.system;
31 | in
32 | {
33 | imports = with nix-config.inputs.home-manager.nixosModules; [ home-manager ];
34 |
35 | options.modules.system = {
36 | username = mkOption {
37 | type = str;
38 | default = "user";
39 | };
40 |
41 | hashedPassword = mkOption {
42 | type = nullOr str;
43 | default = null;
44 | };
45 |
46 | timeZone = mkOption {
47 | type = str;
48 | default = "America/New_York";
49 | };
50 |
51 | defaultLocale = mkOption {
52 | type = str;
53 | default = "ja_JP.UTF-8";
54 | };
55 |
56 | supportedLocales = mkOption {
57 | type = listOf str;
58 |
59 | default = [
60 | "ja_JP.UTF-8/UTF-8"
61 | "en_US.UTF-8/UTF-8"
62 | "fr_FR.UTF-8/UTF-8"
63 | ];
64 | };
65 |
66 | stateVersion = mkOption {
67 | type = str;
68 | default = "22.11";
69 | };
70 |
71 | hostName = mkOption {
72 | type = str;
73 | default = "nixos";
74 | };
75 |
76 | iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
77 | mullvad = mkEnableOption "mullvad vpn";
78 | allowSRB2Port = mkEnableOption "port for srb2";
79 | allowDevPort = mkEnableOption "port for development server";
80 | };
81 |
82 | config = {
83 | boot = {
84 | tmp = if iHaveLotsOfRam then { useTmpfs = true; } else { cleanOnBoot = true; };
85 |
86 | binfmt.emulatedSystems = mkIf (pkgs.system == "x86_64-linux") [ "aarch64-linux" ];
87 |
88 | loader = {
89 | systemd-boot = mkIf (pkgs.system != "aarch64-linux") {
90 | enable = true;
91 | editor = false;
92 | configurationLimit = 10;
93 | };
94 |
95 | timeout = 0;
96 | efi.canTouchEfiVariables = true;
97 | };
98 |
99 | blacklistedKernelModules = [ "floppy" ];
100 | };
101 |
102 | systemd = {
103 | extraConfig = "DefaultTimeoutStopSec=10s";
104 | services.NetworkManager-wait-online.enable = false;
105 | };
106 |
107 | nix = {
108 | settings = {
109 | auto-optimise-store = true;
110 | warn-dirty = false;
111 | allow-import-from-derivation = false;
112 | keep-going = true;
113 |
114 | experimental-features = [
115 | "nix-command"
116 | "flakes"
117 | ];
118 |
119 | trusted-users = [
120 | "root"
121 | "@wheel"
122 | ];
123 | };
124 | };
125 |
126 | zramSwap = {
127 | enable = true;
128 | memoryPercent = 100;
129 | };
130 |
131 | time = {
132 | inherit (cfg) timeZone;
133 | };
134 |
135 | i18n = {
136 | inherit (cfg) defaultLocale supportedLocales;
137 | };
138 |
139 | system = {
140 | inherit (cfg) stateVersion;
141 | };
142 |
143 | users = {
144 | mutableUsers = false;
145 | allowNoPasswordLogin = mkIf isContainer true;
146 |
147 | users.${username} = {
148 | inherit hashedPassword;
149 |
150 | isNormalUser = true;
151 | uid = 1000;
152 | password = mkIf (hashedPassword == null && !isContainer) username;
153 |
154 | extraGroups =
155 | if isContainer then
156 | [ ]
157 | else
158 | [
159 | "wheel"
160 | "networkmanager"
161 | "dialout"
162 | "feedbackd"
163 | "video"
164 | "input"
165 | "cdrom"
166 | ];
167 | };
168 | };
169 |
170 | home-manager = {
171 | useGlobalPkgs = true;
172 | useUserPackages = true;
173 |
174 | sharedModules = singleton {
175 | home = {
176 | inherit (cfg) stateVersion;
177 | };
178 |
179 | programs.man.generateCaches = true;
180 | };
181 |
182 | users.${username}.home = {
183 | inherit username;
184 |
185 | homeDirectory = "/home/${username}";
186 | };
187 | };
188 |
189 | virtualisation.vmVariant = {
190 | virtualisation = {
191 | memorySize = 4096;
192 | cores = 4;
193 |
194 | sharedDirectories = {
195 | tmp = {
196 | source = "/tmp";
197 | target = "/mnt";
198 | };
199 | };
200 |
201 | qemu.options = [
202 | "-device virtio-vga-gl"
203 | "-display sdl,gl=on,show-cursor=off"
204 | "-audio pa,model=hda"
205 | "-full-screen"
206 | ];
207 | };
208 |
209 | services.interception-tools.enable = lib.mkForce false;
210 | networking.resolvconf.enable = lib.mkForce true;
211 | zramSwap.enable = lib.mkForce false;
212 |
213 | boot.enableContainers = false;
214 | };
215 |
216 | networking = {
217 | inherit (cfg) hostName;
218 |
219 | networkmanager = {
220 | enable = true;
221 | wifi.macAddress = "random";
222 | ethernet.macAddress = "random";
223 |
224 | unmanaged = [ "interface-name:ve-*" ];
225 | };
226 |
227 | useHostResolvConf = true;
228 |
229 | resolvconf.enable = mkIf mullvad false;
230 |
231 | nat = mkIf mullvad {
232 | enable = true;
233 | internalInterfaces = [ "ve-+" ];
234 | externalInterface = "wg0-mullvad";
235 | };
236 |
237 | firewall = {
238 | allowedUDPPorts = [
239 | 67
240 | 68
241 | ] ++ optional allowSRB2Port [ 5029 ];
242 |
243 | allowedTCPPorts = [
244 | 80
245 | 443
246 | ] ++ optional allowDevPort [ 3000 ];
247 | };
248 | };
249 |
250 | services = {
251 | resolved.llmnr = "false";
252 |
253 | mullvad-vpn = mkIf mullvad {
254 | enable = true;
255 | enableExcludeWrapper = false;
256 | };
257 |
258 | openssh = {
259 | enable = true;
260 |
261 | settings = {
262 | PasswordAuthentication = false;
263 | KbdInteractiveAuthentication = false;
264 | };
265 | };
266 |
267 | udev.extraRules = ''
268 | KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
269 | '';
270 | };
271 |
272 | environment = {
273 | systemPackages = with pkgs; [ (pass.withExtensions (ext: with ext; [ pass-otp ])) ];
274 | gnome.excludePackages = with pkgs; [ gnome-tour ];
275 | };
276 |
277 | programs.command-not-found.enable = false;
278 | };
279 | }
280 |
--------------------------------------------------------------------------------
/overlays/phinger-cursors.nix:
--------------------------------------------------------------------------------
1 | final: prev: {
2 | phinger-cursors = prev.phinger-cursors.overrideAttrs (oldAttrs: rec {
3 | version = "1.1";
4 |
5 | src = prev.fetchurl {
6 | url = "https://github.com/phisch/phinger-cursors/releases/download/v${version}/phinger-cursors-variants.tar.bz2";
7 | hash = "sha256-II+1x+rcjGRRVB8GYkVwkKVHNHcNaBKRb6C613901oc=";
8 | };
9 | });
10 | }
11 |
--------------------------------------------------------------------------------
/packages/coord.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | fetchFromSourcehut,
4 | python3Packages,
5 | }:
6 |
7 | python3Packages.buildPythonApplication rec {
8 | pname = "coord";
9 | version = "1.0";
10 |
11 | src = fetchFromSourcehut {
12 | owner = "~geb";
13 | repo = "coord";
14 | rev = version;
15 | hash = "sha256-noEU8VXrFjhXd39R0Ps9m1/K2lt4fOXsjnNuVCDlknM=";
16 | };
17 |
18 | format = "other";
19 |
20 | dependencies = with python3Packages; [
21 | pyqt6
22 | ];
23 |
24 | installPhase = ''
25 | runHook preInstall
26 |
27 | install -Dm755 $src/coord $out/bin/coord
28 |
29 | runHook postInstall
30 | '';
31 |
32 | meta = {
33 | homepage = "https://git.sr.ht/~geb/coord";
34 | description = "Screen coordinate selector";
35 | license = lib.licenses.gpl3Only;
36 | maintainers = with lib.maintainers; [ donovanglover ];
37 | mainProgram = "coord";
38 | platforms = lib.platforms.linux;
39 | };
40 | }
41 |
--------------------------------------------------------------------------------
/packages/dunst-scripts.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | stdenvNoCC,
4 | writeTextFile,
5 | makeWrapper,
6 | fish,
7 | pipewire,
8 | brightnessctl,
9 | libnotify,
10 | }:
11 |
12 | let
13 | volume = writeTextFile {
14 | name = "volume";
15 | text = # fish
16 | ''
17 | #!/usr/bin/env fish
18 |
19 | wpctl set-volume --limit 1 @DEFAULT_AUDIO_SINK@ 5%+
20 |
21 | set VOL "$(wpctl get-volume '@DEFAULT_AUDIO_SINK@')"
22 |
23 | notify-send \
24 | --icon "multimedia-volume-control" \
25 | --hint "string:x-dunst-stack-tag:volume" \
26 | --hint "int:value:$(math "$(echo "$VOL" | awk '{print $2}') * 100")" \
27 | --expire-time 1000 \
28 | "音量" \
29 | "$(echo "$VOL" | awk '{print $3}' | sed -e 's/\[MUTED\]/ミュート/' | tr --delete '\n')"
30 | '';
31 | };
32 |
33 | brightness = writeTextFile {
34 | name = "brightness";
35 | text = # fish
36 | ''
37 | #!/usr/bin/env fish
38 |
39 | notify-send \
40 | --icon "brightness" \
41 | --hint "string:x-dunst-stack-tag:brightness" \
42 | --hint "int:value:$(brightnessctl set 5%+ -m | awk --field-separator , '{print $4}')" \
43 | --expire-time 1000 \
44 | "明るさ"
45 | '';
46 | };
47 | in
48 | stdenvNoCC.mkDerivation {
49 | pname = "dunst-scripts";
50 | version = "0.1.0";
51 |
52 | dontUnpack = true;
53 |
54 | nativeBuildInputs = [ makeWrapper ];
55 |
56 | installPhase = ''
57 | runHook preInstall
58 |
59 | install -Dm755 ${brightness} $out/bin/mb-up
60 | install -Dm755 ${brightness} $out/bin/mb-down
61 | install -Dm755 ${volume} $out/bin/mv-up
62 | install -Dm755 ${volume} $out/bin/mv-down
63 | install -Dm755 ${volume} $out/bin/mv-mute
64 |
65 | substituteInPlace $out/bin/mb-down \
66 | --replace-fail "5%+" "5%-"
67 |
68 | substituteInPlace $out/bin/mv-down \
69 | --replace-fail "5%+" "5%-"
70 |
71 | substituteInPlace $out/bin/mv-mute \
72 | --replace-fail "set-volume --limit 1" "set-mute" \
73 | --replace-fail "5%+" "toggle"
74 |
75 | install -Dm755 $out/bin/mv-mute $out/bin/mv-mic
76 |
77 | substituteInPlace $out/bin/mv-mic \
78 | --replace-fail "DEFAULT_AUDIO_SINK" "DEFAULT_AUDIO_SOURCE" \
79 | --replace-fail "multimedia-volume-control" "audio-input-microphone" \
80 | --replace-fail "x-dunst-stack-tag:volume" "x-dunst-stack-tag:microphone" \
81 | --replace-fail "音量" "マイク"
82 |
83 | runHook postInstall
84 | '';
85 |
86 | postInstall = ''
87 | for bin in $out/bin/*; do
88 | wrapProgram "$bin" \
89 | --prefix PATH ":" "${
90 | lib.makeBinPath [
91 | fish
92 | pipewire
93 | brightnessctl
94 | libnotify
95 | ]
96 | }"
97 | done
98 | '';
99 |
100 | meta = {
101 | homepage = "https://github.com/donovanglover/nix-config";
102 | description = "Dunst scripts for brightness and volume";
103 | license = lib.licenses.mit;
104 | maintainers = with lib.maintainers; [ donovanglover ];
105 | platforms = lib.platforms.linux;
106 | };
107 | }
108 |
--------------------------------------------------------------------------------
/packages/mpv-websocket.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | rustPlatform,
4 | fetchFromGitHub,
5 | }:
6 |
7 | rustPlatform.buildRustPackage (finalAttrs: {
8 | pname = "mpv-websocket";
9 | version = "0.4.1";
10 |
11 | src = fetchFromGitHub {
12 | owner = "kuroahna";
13 | repo = "mpv_websocket";
14 | tag = finalAttrs.version;
15 | hash = "sha256-a2/TMTl9QIU7oKqm9yv/SFLwpKArMdGjJZjaTyUwXfM=";
16 | };
17 |
18 | cargoHash = "sha256-avBHcFJW5SvAZDISKUcEwL6Wxa4hiKQPljEx5eHswDE=";
19 |
20 | meta = {
21 | description = "WebSocket plugin for mpv";
22 | homepage = "https://github.com/kuroahna/mpv_websocket";
23 | license = lib.licenses.mit;
24 | maintainers = with lib.maintainers; [ donovanglover ];
25 | mainProgram = "mpv_websocket";
26 | };
27 | })
28 |
--------------------------------------------------------------------------------
/packages/nadesiko3.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | buildNpmPackage,
4 | fetchurl,
5 | }:
6 |
7 | buildNpmPackage (finalAttrs: {
8 | pname = "nadesiko3";
9 | version = "3.6.44";
10 |
11 | src = fetchurl {
12 | url = "https://registry.npmjs.org/nadesiko3/-/nadesiko3-${finalAttrs.version}.tgz";
13 | hash = "sha256-LSS/ieeyOUc3Q1bEfVqdNei4rIeG9Wz67TmCsGtrojU=";
14 | };
15 |
16 | npmDepsHash = "sha256-PBwdfNYnIjoaqXCZ7J28usC3HNbiQDz/NoREMhGL5TE=";
17 |
18 | postPatch = ''
19 | ln -s ${../assets/nadesiko3-package-lock.json} package-lock.json
20 | '';
21 |
22 | dontNpmBuild = true;
23 |
24 | passthru.updateScript = # fish
25 | ''
26 | set VERSION $(npm view nadesiko3 version)
27 | and set TARBALL "nadesiko3-$VERSION.tgz"
28 | and set URL "https://registry.npmjs.org/nadesiko3/-/$TARBALL"
29 | and set HASH $(nix hash convert --to sri sha256:$(nix-prefetch-url "$URL"))
30 |
31 | and xh -d "$URL"
32 | and tar xf "$TARBALL" --strip-components=1 package/package.json
33 | and npm install --package-lock-only --ignore-scripts
34 | and set NPM_HASH $(nix run nixpkgs#prefetch-npm-deps package-lock.json)
35 |
36 | and sd -n 1 'version = "[^"]*"' "version = \"$VERSION\"" ./packages/nadesiko3.nix
37 | and sd -n 1 'hash = "[^"]*"' "hash = \"$HASH\"" ./packages/nadesiko3.nix
38 | and sd -n 1 'npmDepsHash = "[^"]*"' "npmDepsHash = \"$NPM_HASH\"" ./packages/nadesiko3.nix
39 |
40 | and mv package-lock.json ./assets/nadesiko3-package-lock.json
41 |
42 | and rm package.json
43 | and rm nadesiko3-*.tgz
44 | '';
45 |
46 | meta = {
47 | description = "Japanese Programming Language Nadesiko v3 (JavaScript/TypeScript)";
48 | homepage = "https://nadesi.com";
49 | license = lib.licenses.mit;
50 | mainProgram = "cnako3";
51 | maintainers = with lib.maintainers; [ donovanglover ];
52 | };
53 | })
54 |
--------------------------------------------------------------------------------
/packages/new-tab-identity.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | buildNpmPackage,
4 | fetchFromGitHub,
5 | }:
6 |
7 | buildNpmPackage {
8 | pname = "new-tab-identity";
9 | version = "0-unstable-2024-08-19";
10 |
11 | src = fetchFromGitHub {
12 | owner = "donovanglover";
13 | repo = "new-tab-identity";
14 | rev = "bf61dbda21d37b063062039ca246611ee83299ff";
15 | hash = "sha256-/1id7MHWxkPpuiSWqLYGYQBk5kNxBOUbkexkvTZDkfw=";
16 | };
17 |
18 | npmDepsHash = "sha256-M0WPgg91FupGz4383gHf13kSsmAkjygmKZ5IxsM3VE0=";
19 |
20 | installPhase = ''
21 | runHook preInstall
22 |
23 | install -Dm644 dist/new_tab_identity-1.0.zip "$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/some-name@example.org.xpi"
24 |
25 | runHook postInstall
26 | '';
27 |
28 | meta = {
29 | homepage = "https://github.com/donovanglover/new-tab-identity";
30 | description = "Browse the web from multiple VPN locations simultaneously";
31 | maintainers = with lib.maintainers; [ donovanglover ];
32 | platforms = lib.platforms.all;
33 | };
34 | }
35 |
--------------------------------------------------------------------------------
/packages/nixf-tidy.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | stdenvNoCC,
4 | writeTextFile,
5 | makeWrapper,
6 | fish,
7 | git,
8 | fd,
9 | jq,
10 | nixf,
11 | }:
12 |
13 | let
14 | script = writeTextFile {
15 | name = "nixf-tidy";
16 | text = # fish
17 | ''
18 | #!/usr/bin/env fish
19 |
20 | if test "$(git rev-parse --is-inside-work-tree)" != "true"
21 | echo "Not inside a git directory. Aborting."
22 | exit 1
23 | end
24 |
25 | echo "⚪ Checking for issues with nixf-tidy..."
26 |
27 | set DID_ERROR 0
28 |
29 | for FILE in **/*.nix
30 | set RESULT $(cat "$FILE" | nixf-tidy --variable-lookup)
31 |
32 | if test "$RESULT" != "[]"
33 | echo "===================================="
34 | echo "❌ nixd found issues in $FILE:"
35 | echo "===================================="
36 | echo "$RESULT" | jq ".[] | .message, .args, .range.lCur.line"
37 |
38 | set DID_ERROR 1
39 | else
40 | echo "✅ $FILE"
41 | end
42 | end
43 |
44 | exit $DID_ERROR
45 | '';
46 | };
47 | in
48 | stdenvNoCC.mkDerivation {
49 | pname = "nixf-tidy";
50 | version = "0.1.0";
51 |
52 | dontUnpack = true;
53 |
54 | nativeBuildInputs = [ makeWrapper ];
55 |
56 | installPhase = ''
57 | runHook preInstall
58 |
59 | install -Dm755 ${script} $out/bin/nixf-tidy
60 |
61 | runHook postInstall
62 | '';
63 |
64 | postInstall = ''
65 | wrapProgram $out/bin/nixf-tidy \
66 | --prefix PATH ":" "${
67 | lib.makeBinPath [
68 | fish
69 | git
70 | fd
71 | jq
72 | nixf
73 | ]
74 | }"
75 | '';
76 |
77 | meta = {
78 | homepage = "https://github.com/nix-community/nixd/blob/main/libnixf/README.md#nixf-tidy";
79 | description = "Dedicated tool tailored for linting Nix projects";
80 | license = lib.licenses.lgpl3Plus;
81 | maintainers = with lib.maintainers; [ donovanglover ];
82 | mainProgram = "nixf-tidy";
83 | platforms = lib.platforms.linux;
84 | };
85 | }
86 |
--------------------------------------------------------------------------------
/packages/numen.nix:
--------------------------------------------------------------------------------
1 | {
2 | fetchzip,
3 | stdenv,
4 | stdenvNoCC,
5 | buildGoModule,
6 | makeWrapper,
7 | scdoc,
8 | fetchFromSourcehut,
9 | dotool,
10 | lib,
11 | alsa-utils,
12 | libxkbcommon,
13 | gnused,
14 | gawk,
15 | coreutils,
16 | libnotify,
17 | dmenu,
18 | procps,
19 | installShellFiles,
20 | }:
21 |
22 | let
23 | vosk-bin = stdenvNoCC.mkDerivation (finalAttrs: {
24 | pname = "vosk-bin";
25 | version = "0.3.45";
26 |
27 | src = fetchzip {
28 | url = "https://github.com/alphacep/vosk-api/releases/download/v${finalAttrs.version}/vosk-linux-x86_64-${finalAttrs.version}.zip";
29 | hash = "sha256-ToMDbD5ooFMHU0nNlfpLynF29kkfMknBluKO5PipLFY=";
30 | };
31 |
32 | installPhase = ''
33 | runHook preInstall
34 |
35 | install -Dm644 libvosk.so -t $out/lib
36 | install -Dm644 vosk_api.h -t $out/include
37 |
38 | runHook postInstall
39 | '';
40 | });
41 |
42 | vosk-model-small-en-us = stdenvNoCC.mkDerivation (finalAttrs: {
43 | pname = "vosk-model-small-en-us";
44 | version = "0.15";
45 |
46 | src = fetchzip {
47 | url = "https://alphacephei.com/vosk/models/vosk-model-small-en-us-${finalAttrs.version}.zip";
48 | hash = "sha256-CIoPZ/krX+UW2w7c84W3oc1n4zc9BBS/fc8rVYUthuY=";
49 | };
50 |
51 | patchPhase = ''
52 | runHook prePatch
53 |
54 | echo "--endpoint.rule2.min-trailing-silence=0.5" >> ./conf/model.conf
55 | echo "--endpoint.rule3.min-trailing-silence=0.5" >> ./conf/model.conf
56 | echo "--endpoint.rule4.min-trailing-silence=0.6" >> ./conf/model.conf
57 |
58 | runHook postPatch
59 | '';
60 |
61 | installPhase = ''
62 | runHook preInstall
63 |
64 | mkdir -p $out/usr/share/vosk-models
65 | cp -r . $out/usr/share/vosk-models/small-en-us
66 |
67 | runHook postInstall
68 | '';
69 | });
70 | in
71 | buildGoModule rec {
72 | pname = "numen";
73 | version = "0.7";
74 |
75 | src = fetchFromSourcehut {
76 | owner = "~geb";
77 | repo = "numen";
78 | rev = version;
79 | hash = "sha256-ia01lOP59RdoiO23b5Dv5/fX5CEI43tPHjmaKwxP+OM=";
80 | };
81 |
82 | vendorHash = "sha256-Y3CbAnIK+gEcUfll9IlEGZE/s3wxdhAmTJkj9zlAtoQ=";
83 |
84 | nativeBuildInputs = [
85 | makeWrapper
86 | scdoc
87 | installShellFiles
88 | ];
89 |
90 | ldflags = [
91 | "-X main.Version=${version}"
92 | "-X main.DefaultModelPackage=vosk-model-small-en-us"
93 | "-X main.DefaultModelPaths=${vosk-model-small-en-us}/usr/share/vosk-models/small-en-us"
94 | "-X main.DefaultPhrasesDir=${placeholder "out"}/etc/numen/phrases"
95 | ];
96 |
97 | env = {
98 | CGO_CFLAGS = "-I${vosk-bin}/include";
99 | CGO_LDFLAGS = "-L${vosk-bin}/lib";
100 | NUMEN_SKIP_BINARY = "yes";
101 | NUMEN_SKIP_CHECKS = "yes";
102 | NUMEN_DEFAULT_PHRASES_DIR = "/etc/numen/phrases";
103 | NUMEN_SCRIPTS_DIR = "/etc/numen/scripts";
104 | };
105 |
106 | patchPhase = ''
107 | runHook prePatch
108 |
109 | substituteInPlace scripts/* \
110 | --replace-warn /etc/numen/scripts/ "numen-" \
111 | --replace-warn sed ${lib.getExe gnused} \
112 | --replace-warn awk ${lib.getExe gawk} \
113 | --replace-warn cat ${coreutils}/bin/cat \
114 | --replace-warn notify-send ${lib.getExe libnotify}
115 |
116 | substituteInPlace scripts/menu \
117 | --replace-warn "-dmenu" "-${lib.getExe dmenu}"
118 |
119 | substituteInPlace scripts/displaying \
120 | --replace-warn "(pgrep" "(${procps}/bin/pgrep" \
121 | --replace-warn "(ps" "(${procps}/bin/ps"
122 |
123 | substituteInPlace phrases/* \
124 | --replace-warn /etc/numen/scripts/ "numen-"
125 |
126 | substituteInPlace numenc \
127 | --replace-warn /bin/echo "${coreutils}/bin/echo" \
128 | --replace-warn cat "${coreutils}/bin/cat"
129 |
130 | runHook postPatch
131 | '';
132 |
133 | installPhase = ''
134 | runHook preInstall
135 |
136 | install -Dm755 $GOPATH/bin/numen -t $out/bin
137 |
138 | for file in ./scripts/*; do
139 | cp "$file" "$out/bin/numen-$(basename $file)"
140 | done
141 |
142 | ./install-numen.sh $out /bin
143 |
144 | runHook postInstall
145 | '';
146 |
147 | postInstall = ''
148 | scdoc < doc/numen.1.scd > numen.1
149 | installManPage numen.1
150 | '';
151 |
152 | postFixup = ''
153 | wrapProgram $out/bin/numen \
154 | --prefix PATH : ${
155 | lib.makeBinPath [
156 | dotool
157 | alsa-utils
158 | ]
159 | } \
160 | --prefix LD_LIBRARY_PATH : ${
161 | lib.makeLibraryPath [
162 | libxkbcommon
163 | stdenv.cc.cc.lib
164 | ]
165 | }
166 | '';
167 |
168 | meta = {
169 | homepage = "https://git.sr.ht/~geb/numen";
170 | description = "Voice control for handsfree computing";
171 | license = lib.licenses.agpl3Only;
172 | maintainers = with lib.maintainers; [ donovanglover ];
173 | mainProgram = "numen";
174 | platforms = lib.platforms.linux;
175 | };
176 | }
177 |
--------------------------------------------------------------------------------
/packages/osu-backgrounds.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | stdenvNoCC,
4 | fetchzip,
5 | }:
6 |
7 | stdenvNoCC.mkDerivation {
8 | pname = "osu-backgrounds";
9 | version = "2025-04-01";
10 |
11 | srcs = [
12 | (fetchzip {
13 | name = "2017-04-27 Spring 2017 Fanart Contest Winners";
14 | url = "https://files.catbox.moe/nzn2d3.zip";
15 | hash = "sha256-ZiX1L5umRt9NSVT1r1XojDBpdwAcHcizWyi5Yjph2Ho=";
16 | stripRoot = false;
17 | })
18 |
19 | (fetchzip {
20 | name = "2017-07-11 Mocha in Summer Fanart Contest All Entries";
21 | url = "https://assets.ppy.sh/contests/48/MochaFanartEntries.zip";
22 | hash = "sha256-T6JIXcl30AnWOu5Z/ZMmaXh9b9XnTLSXu+H5AbI2g2M=";
23 | stripRoot = false;
24 | })
25 |
26 | (fetchzip {
27 | name = "2018-05-02 Spring 2018 Fanart Contest Winners";
28 | url = "https://assets.ppy.sh/contests/64/winners/osu%21%20Spring%20Fanart%202018%20Winners.zip";
29 | hash = "sha256-JWpQMV5E4QfrRODsRH0GXy2C0eS/PpZvG2pCKQSwwug=";
30 | stripRoot = false;
31 | })
32 |
33 | (fetchzip {
34 | name = "2018-08-09 Summer 2018 Fanart Contest Winners";
35 | url = "https://files.catbox.moe/sy7yuq.zip";
36 | hash = "sha256-9UDH45ILPKEA9kWrHrI3eabG6STJ8QZBdJeul/aCLpA=";
37 | stripRoot = false;
38 | })
39 |
40 | (fetchzip {
41 | name = "2018-10-23 Halloween 2018 Fanart Contest Winners";
42 | url = "https://files.catbox.moe/0ibq8k.zip";
43 | hash = "sha256-lIXHZZaUyaWF3Ebna40P2UmNMym+MB8Pxp1O2OCexs4=";
44 | stripRoot = false;
45 | })
46 |
47 | (fetchzip {
48 | name = "2018-12-12 Winter 2018 Fanart Contest Winners";
49 | url = "https://files.catbox.moe/0iv4ib.zip";
50 | hash = "sha256-kfaXNOM+o+1/CAPLdiRX+E8HncIUA4U1rUbTdEJ18lE=";
51 | stripRoot = false;
52 | })
53 |
54 | (fetchzip {
55 | name = "2019-06-03 Spring 2019 Fanart Contest Winners";
56 | url = "https://assets.ppy.sh/contests/78/winners/Spring2019-Winners.zip";
57 | hash = "sha256-Bz4G+p3kXTpooFEu9/6+2MehkYsNeYCXyLAvKEXgIAQ=";
58 | stripRoot = false;
59 | })
60 |
61 | (fetchzip {
62 | name = "2019-08-08 Summer 2019 Fanart Contest Winners";
63 | url = "https://assets.ppy.sh/contests/79/SummerFanart2019Winners.zip";
64 | hash = "sha256-QYJCATVqirzVJQV8B7WO/0rWsKQwvqCgUbP6cIqc4SU=";
65 | stripRoot = false;
66 | })
67 |
68 | (fetchzip {
69 | name = "2019-10-30 Halloween 2019 Fanart Contest Winners";
70 | url = "https://assets.ppy.sh/contests/81/winners/Halloween2019FanartWinners.zip";
71 | hash = "sha256-O5LVrDuY47viLkdxmg0GVMVDp6nHs8EHjx1qsNayRKI=";
72 | stripRoot = false;
73 | })
74 |
75 | (fetchzip {
76 | name = "2019-12-10 Winter 2019 Fanart Contest Finalists";
77 | url = "https://assets.ppy.sh/contests/82/osu!Winter2019HQ.zip";
78 | hash = "sha256-0WlRiZk81bnvYhkcPJTNBljLkkI3tMNDHF6nZ6nXuXE=";
79 | stripRoot = false;
80 | })
81 |
82 | (fetchzip {
83 | name = "2020-04-24 Spring Indoors 2020 Fanart Contest Winners";
84 | url = "https://assets.ppy.sh/contests/92/winners/winners.zip";
85 | hash = "sha256-uJjkb+M8GFDGyPqA/hhDKnjixKAaa/njW+6rGgq6Tg0=";
86 | stripRoot = false;
87 | })
88 |
89 | (fetchzip {
90 | name = "2020-07-23 Summer Theme Park 2020 Fanart Contest Winners";
91 | url = "https://assets.ppy.sh/contests/107/winners/winners.zip";
92 | hash = "sha256-cY31joP8rTRNxx8lfx4qVmIuoy71TwMSNXystmkPGpA=";
93 | stripRoot = false;
94 | })
95 |
96 | (fetchzip {
97 | name = "2020-10-11 Halloween 2020 Fanart Contest Finalists";
98 | url = "https://assets.ppy.sh/contests/112/Halloween2020Finalists.zip";
99 | hash = "sha256-oUYdw+lzTosSDeyW0jenfaURvf0AlA0SxQyq3uXgZh4=";
100 | stripRoot = false;
101 | })
102 |
103 | (fetchzip {
104 | name = "2020-12-02 Winter Sports 2020 Fanart Contest Winners";
105 | url = "https://assets.ppy.sh/contests/114/winners/WinterSports2020Winners.zip";
106 | hash = "sha256-vIe3Bj4GVpPBNSxJeoRPXtgKxC7Eh7Rl0m4SGCp95zk=";
107 | stripRoot = false;
108 | })
109 |
110 | (fetchzip {
111 | name = "2021-05-20 Spring 2021 Fanart Contest Winners";
112 | url = "https://assets.ppy.sh/contests/125/winners/SpringFanart2021-Winners.zip";
113 | hash = "sha256-EGpHIID4ZnKoH2SnwAXNKiHE4JT9KrG6hwKGTuos+X8=";
114 | stripRoot = false;
115 | })
116 |
117 | (fetchzip {
118 | name = "2021-08-23 Summer 2021 Track and Field Fanart Contest Winners";
119 | url = "https://assets.ppy.sh/contests/133/winners/Summer2021TFWinners.zip";
120 | hash = "sha256-P/N2Kycb3CJNbm4KzXXkRdNnExaKPAFSG+UG/cG9sSQ=";
121 | stripRoot = false;
122 | })
123 |
124 | (fetchzip {
125 | name = "2021-10-27 Halloween 2021 Fanart Contest Finalists";
126 | url = "https://assets.ppy.sh/contests/135/winners/Halloween2021FanartFinalists.zip";
127 | hash = "sha256-HwxT5dpG7ljtfJcAxKm+VfYLwjxhfbqHvq9MC57SVds=";
128 | stripRoot = false;
129 | })
130 |
131 | (fetchzip {
132 | name = "2021-12-17 Winter 2021 Fanart Contest Finalists";
133 | url = "https://assets.ppy.sh/contests/136/winners/Winter2021FanartContestFinalists.zip";
134 | hash = "sha256-BnOIgNXVaDQsn/B7v+1HJwYKQGNiVjxue8g9C8zFGYM=";
135 | stripRoot = false;
136 | })
137 |
138 | (fetchzip {
139 | name = "2022-05-08 A Place To Belong Fanart Contest Finalists";
140 | url = "https://assets.ppy.sh/contests/142/APTB2022-Finalists.zip";
141 | hash = "sha256-o0mPxETcjHzY60hTX+M+hIssTh+xF0rXy2iYpZoF/HE=";
142 | stripRoot = false;
143 | })
144 |
145 | (fetchzip {
146 | name = "2022-09-15 15th Anniversary Art Contest Finalists";
147 | url = "https://assets.ppy.sh/contests/153/winners/osu15anniversaryfinalists.zip";
148 | hash = "sha256-ffO8LFSSLL6mf+dqau0M14/Ikv/ZEgpYvk8zmUauVKU=";
149 | stripRoot = false;
150 | })
151 |
152 | (fetchzip {
153 | name = "2022-10-29 Halloween 2022 Fanart Contest Finalists";
154 | url = "https://assets.ppy.sh/contests/154/winners/Halloween2022FanartFinalists.zip";
155 | hash = "sha256-XYIGoobZoVOcWW4l3acH7ZzLojLzM13WUi0iH+/1enM=";
156 | stripRoot = false;
157 | })
158 |
159 | (fetchzip {
160 | name = "2022-12-31 New Beginnings Art Contest Finalists";
161 | url = "https://assets.ppy.sh/contests/160/NewBeginningsFinalists.zip";
162 | hash = "sha256-U3iGUFDuS1B27Mgf6rqqh9hl/qwJw2yVxjxh5PrTGdA=";
163 | stripRoot = false;
164 | })
165 |
166 | (fetchzip {
167 | name = "2023-05-01 Journey into a Beatmap World Art Contest Winners";
168 | url = "https://assets.ppy.sh/contests/175/JIBW2023-Winners.zip";
169 | hash = "sha256-zOolYDj5IPm0Qrv3EbCd36ScJPOG9nTvHkxrQDTZlsw=";
170 | stripRoot = false;
171 | })
172 |
173 | (fetchzip {
174 | name = "2023-07-27 Beach Episode Art Contest Winners";
175 | url = "https://assets.ppy.sh/contests/179/winners/BeachEpisode2023Winners.zip";
176 | hash = "sha256-2o+hGjr4h3Upg7NBj1pQ4GI3D771tj1Xgk+o2Lv29as=";
177 | stripRoot = false;
178 | })
179 |
180 | (fetchzip {
181 | name = "2023-10-22 Halloween 2023 Fanart Contest Finalists";
182 | url = "https://assets.ppy.sh/contests/186/Halloween2023Finalists.zip";
183 | hash = "sha256-hRBhRKZ5hMzviNVnH9BhVU1LDazt5W0ljpvszWwungE=";
184 | stripRoot = false;
185 | })
186 |
187 | (fetchzip {
188 | name = "2023-12-07 Winter 2023 Fanart Contest Finalists";
189 | url = "https://assets.ppy.sh/contests/189/WinterFanart2023Finalists.zip";
190 | hash = "sha256-tcK51nqncNWHiIng1WEJWCQS/F/SQQB12uj5HGd9kmE=";
191 | stripRoot = false;
192 | })
193 |
194 | (fetchzip {
195 | name = "2024-03-30 Spring 2024 Fanart Contest All Entries";
196 | url = "https://assets.ppy.sh/contests/205/Spring2024FanartSubmissions.zip";
197 | hash = "sha256-xGAj45J6F4V8E0BdI0w6xdfxmbQVH9nGwyvCusTWkUg=";
198 | stripRoot = false;
199 | })
200 |
201 | (fetchzip {
202 | name = "2024-07-15 Aerial Antics Art Contest All Entries";
203 | url = "https://assets.ppy.sh/contests/215/Summer2024FanartSubmissions.zip";
204 | hash = "sha256-K2GYmjmBarJe7FDw+Hc+NIjBRAJDuobZfbFTN7KbHnM=";
205 | stripRoot = false;
206 | })
207 |
208 | (fetchzip {
209 | name = "2024-10-09 Autumn 2024 Fanart Contest All Entries";
210 | url = "https://assets.ppy.sh/contests/221/Autumn2024FanartSubmissions.zip";
211 | hash = "sha256-mHT9+nslxUDJp96gU/UjzEifG1BIOu+T4LhgN/wJDts=";
212 | stripRoot = false;
213 | })
214 |
215 | (fetchzip {
216 | name = "2025-01-01 Midnight Moment Art Contest All Entries";
217 | url = "https://assets.ppy.sh/contests/226/MidnightMomentFanartSubmissions.zip";
218 | hash = "sha256-Tx550sw690WK3SVAsl+cjLb7Qrbrn8laaqjZMLU3efc=";
219 | stripRoot = false;
220 | })
221 |
222 | (fetchzip {
223 | name = "2025-04-01 Springtime Showdown Art Contest All Entries";
224 | url = "https://assets.ppy.sh/contests/242/SpringtimeShowdownFanartSubmissions.zip";
225 | hash = "sha256-Jrkwi68iZd1R9NoIHjUz+rArICG+icr/cJZerl/t3Ck=";
226 | stripRoot = false;
227 | })
228 | ];
229 |
230 | sourceRoot = ".";
231 |
232 | installPhase = ''
233 | runHook preInstall
234 |
235 | BASE="2024-03-30-Spring-2024-Fanart-Contest-All-Entries"
236 | DIR="Spring2024FanartSubmissions"
237 |
238 | mv $BASE/$DIR . && rm -r $BASE && mv $DIR $BASE
239 |
240 | BASE="2024-10-09-Autumn-2024-Fanart-Contest-All-Entries"
241 | DIR="all-ordered"
242 |
243 | mv $BASE/$DIR . && rm -r $BASE && mv $DIR $BASE
244 |
245 | mkdir -p $out
246 | cp -r */ $out
247 |
248 | runHook postInstall
249 | '';
250 |
251 | meta = {
252 | description = "Collection of osu! fanart entries";
253 | homepage = "https://osu.ppy.sh/home/news";
254 | maintainers = with lib.maintainers; [ donovanglover ];
255 | platforms = lib.platforms.all;
256 | };
257 | }
258 |
--------------------------------------------------------------------------------
/packages/record.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | stdenvNoCC,
4 | writeTextFile,
5 | makeWrapper,
6 | fish,
7 | pipewire,
8 | ffmpeg,
9 | libnotify,
10 | wl-clipboard-rs,
11 | xclip,
12 | }:
13 |
14 | let
15 | record = writeTextFile {
16 | name = "record";
17 | text = # fish
18 | ''
19 | #!/usr/bin/env fish
20 |
21 | if pgrep pw-record
22 | pkill pw-record
23 |
24 | exit 0
25 | end
26 |
27 | notify-send \
28 | --hint "string:x-dunst-stack-tag:record" \
29 | "録音" \
30 | "中"
31 |
32 | set DIRECTORY "/tmp/"
33 | set FILENAME "録音_$(date --iso-8601)-$(uuidgen)"
34 |
35 | pw-record -P "{ stream.capture.sink=true }" "$DIRECTORY$FILENAME.flac"
36 | ffmpeg -i "$DIRECTORY$FILENAME.flac" -c:a libopus -b:a 128K "$DIRECTORY$FILENAME.opus"
37 |
38 | if test "$XDG_SESSION_TYPE" = "x11"
39 | echo "file://$DIRECTORY$FILENAME.opus" | xclip -selection clipboard
40 | else
41 | echo "file://$DIRECTORY$FILENAME.opus" | wl-copy -t text/uri-list
42 | end
43 |
44 | notify-send \
45 | --hint "string:x-dunst-stack-tag:record" \
46 | "録音" \
47 | "成功"
48 | '';
49 | };
50 | in
51 | stdenvNoCC.mkDerivation {
52 | pname = "record";
53 | version = "0.1.0";
54 |
55 | dontUnpack = true;
56 |
57 | nativeBuildInputs = [ makeWrapper ];
58 |
59 | installPhase = ''
60 | runHook preInstall
61 |
62 | install -Dm755 ${record} $out/bin/record
63 |
64 | runHook postInstall
65 | '';
66 |
67 | postInstall = ''
68 | wrapProgram "$out/bin/record" \
69 | --prefix PATH ":" "${
70 | lib.makeBinPath [
71 | fish
72 | pipewire
73 | ffmpeg
74 | libnotify
75 | wl-clipboard-rs
76 | xclip
77 | ]
78 | }"
79 | '';
80 |
81 | meta = {
82 | homepage = "https://github.com/donovanglover/nix-config";
83 | description = "Script to record desktop audio and copy the result to the clipboard";
84 | license = lib.licenses.mit;
85 | maintainers = with lib.maintainers; [ donovanglover ];
86 | platforms = lib.platforms.linux;
87 | mainProgram = "record";
88 | };
89 | }
90 |
--------------------------------------------------------------------------------
/packages/stylix-background.nix:
--------------------------------------------------------------------------------
1 | {
2 | lib,
3 | stdenvNoCC,
4 | imagemagick,
5 | color ? "181818",
6 | }:
7 |
8 | stdenvNoCC.mkDerivation {
9 | pname = "stylix-background";
10 | version = "1.0.0-${color}";
11 |
12 | dontUnpack = true;
13 |
14 | nativeBuildInputs = [ imagemagick ];
15 |
16 | postInstall = ''
17 | mkdir -p $out
18 | magick -size 1x1 xc:#${color} $out/wallpaper.png
19 | '';
20 |
21 | meta = {
22 | description = "Solid background color for stylix to use";
23 | license = lib.licenses.publicDomain;
24 | homepage = "https://stackoverflow.com/questions/7771975/imagemagick-create-a-png-file-which-is-just-a-solid-rectangle";
25 | maintainers = with lib.maintainers; [ donovanglover ];
26 | platforms = lib.platforms.all;
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/tests/neovim.nix:
--------------------------------------------------------------------------------
1 | { self, pkgs }:
2 |
3 | self.inputs.nixpkgs.lib.nixos.runTest {
4 | name = "neovim";
5 | hostPkgs = pkgs;
6 | node.specialArgs.nix-config = self;
7 |
8 | nodes.machine =
9 | { nix-config, config, ... }:
10 | {
11 | imports = with nix-config.nixosModules; [
12 | shell
13 | system
14 | stylix
15 | ];
16 |
17 | home-manager.sharedModules = with nix-config.homeModules; [
18 | neovim
19 | ];
20 |
21 | services.getty.autologinUser = config.modules.system.username;
22 | };
23 |
24 | testScript = # python
25 | ''
26 | machine.wait_for_unit("default.target")
27 |
28 | machine.send_chars("nvim hello.txt\n")
29 | machine.sleep(30)
30 |
31 | machine.send_chars("i")
32 | machine.sleep(2)
33 | machine.send_chars("Hello world")
34 | machine.sleep(2)
35 | machine.send_key("esc")
36 | machine.sleep(2)
37 | machine.send_chars(":wq\n")
38 | machine.sleep(2)
39 |
40 | text = machine.succeed("cat /home/user/hello.txt")
41 |
42 | assert "Hello world" in text
43 | '';
44 | }
45 |
--------------------------------------------------------------------------------