repo: implement niri, a wayland window manager

This commit implements Niri, a window manager, alongside a whole suite
of programs needed for a comfortable desktop experience.

commit e5171c221e
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:43:48 2024 +0200

    home/programs: add cinny, a matrix client

commit 4277ad8417
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:43:37 2024 +0200

    home/programs/gtk: set gtk-application-prefer-dark-theme based on global variant

commit 44560d184d
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:43:00 2024 +0200

    home/programs/niri: add compose key on ralt

commit abb1350b9b
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:36:41 2024 +0200

    home/programs/xdg: add zathura as default pdf reader

commit 962a5beda6
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:35:29 2024 +0200

    home/programs/media: add zathura

commit 5a9b20ae35
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:31:44 2024 +0200

    home/terminal/emulators/foot: add fish back as default shell

commit b3466f2db3
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Mon Oct 7 18:31:21 2024 +0200

    home/terminal/shell: add nushell config, add back fish

commit ef8d1cba3f
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 23:20:24 2024 +0200

    home/terminal/emulators/foot: set nushell as default shell

commit 0d866a35b0
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 23:20:11 2024 +0200

    home/shell: add nushell

commit 172b3592da
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:43:01 2024 +0200

    home/programs/media: add celluloid (mpv front-end)

commit 15abf4174d
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:21:04 2024 +0200

    home/programs: import media, xdg and add yazi

commit 284d27ecf6
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:20:39 2024 +0200

    home/programs/browsers: set custom search engines for firefox

commit 7f8ae63483
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:20:21 2024 +0200

    home/programs/xdg: set default mime apps

commit fd0fbad80d
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:19:58 2024 +0200

    home/programs/media: add programs

commit 936f58de75
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:19:15 2024 +0200

    home/terminal: add $EDITOR

commit 4bb7f32c2b
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 22:19:01 2024 +0200

    system/programs/home-manager: add backup file extension

commit e24ab1eb95
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 17:48:46 2024 +0200

    repo: move everything gtk into modules

    This is mostly so that applications like ReGreet, which are managed by
    NixOS instead of HM, can also use the same GTK settings. It reduces
    repeating code by a lot and allows changing themes way more easily now.

commit 6e0076c7ef
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 15:57:49 2024 +0200

    system/services/logind: suspend on lid close

commit ec0ef6c248
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 15:57:33 2024 +0200

    home/programs: add fractal, a matrix GUI

commit afaf919a8c
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 15:57:20 2024 +0200

    home/programs/gtk: disable gtk decoration buttons

commit c5fdfffaf6
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 15:57:08 2024 +0200

    home/programs/swayidle: add configuration, setup with loginctl

commit 7f98200cd8
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:15:21 2024 +0200

    home/programs/niri: separate binds from config

commit ceeb9d14ab
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:14:52 2024 +0200

    profiles/vamos: import swaylock

commit f8a7ac40e6
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:14:35 2024 +0200

    lib: simplify rgba function

commit 7e9a7d8e1e
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:13:55 2024 +0200

    home/programs/swaylock: add full configuration (with base16 theming)

commit bb91e2a20e
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:13:41 2024 +0200

    home/gtk: make cursor bigger

commit c0c6a9b352
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:12:26 2024 +0200

    home/programs/fuzzel: theme with base16

commit 05e4923703
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:11:51 2024 +0200

    core/security: disable sudo password for wheel

commit be151ba76b
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:11:23 2024 +0200

    services/regreet: enable gnome keyring, disable fprint auth

commit 7b22fd5ca7
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Sun Oct 6 12:11:01 2024 +0200

    programs/niri: add PAM strategy for swaylock with fprintd

commit c7c8108bc4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 13:55:23 2024 +0200

    home/programs/niri: bind brightness keys

commit fcbad25a2a
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 13:54:52 2024 +0200

    services/brightness: add brillo for backlight

commit fcd23e73c3
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 11:18:45 2024 +0200

    home/programs/ags: add example bar

commit 3516d7bcff
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 11:18:26 2024 +0200

    home/programs/niri: remove pointer (in gtk.nix now)

commit d42e9005e5
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 11:18:00 2024 +0200

    system/hardware/power: move to services, add upower

commit 837182ae0c
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Thu Oct 3 11:17:23 2024 +0200

    gtk: add theming

commit f72599896e
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Wed Oct 2 19:59:58 2024 +0200

    niri: add ags, mako and swaybg

commit 73edc8f90e
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Wed Oct 2 17:28:07 2024 +0200

    home/programs/niri: add binds

commit 9acd24afd4
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Wed Oct 2 16:45:43 2024 +0200

    repo: add niri hm config, theme nixos instead of hm, add regreet/greetd config

commit f7c4be7334
Author: Anthony Rodriguez <anthony@nezia.dev>
Date:   Wed Oct 2 11:54:15 2024 +0200

    niri: add functioning base
This commit is contained in:
Anthony Rodriguez 2024-10-07 18:51:10 +02:00
parent 7b7149c554
commit 282792e913
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
47 changed files with 1322 additions and 99 deletions

View file

@ -1,10 +1,29 @@
{
"nodes": {
"ags": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1727303518,
"narHash": "sha256-lO5JMynTxNZxg/+E4/Y9reeLGIz/M8cEue+Re4cP6qo=",
"owner": "Aylur",
"repo": "ags",
"rev": "cd543afec4d9ed708990e5ba52184716809bf248",
"type": "github"
},
"original": {
"owner": "Aylur",
"repo": "ags",
"type": "github"
}
},
"basix": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1727493962,
@ -78,6 +97,24 @@
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_3"
},
"locked": {
"lastModified": 1715865404,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
@ -114,7 +151,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
@ -132,7 +169,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
"systems": "systems_5"
},
"locked": {
"lastModified": 1710146030,
@ -282,6 +319,63 @@
"type": "github"
}
},
"niri": {
"inputs": {
"flake-parts": "flake-parts_3",
"niri-stable": "niri-stable",
"niri-unstable": "niri-unstable",
"nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable",
"xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1727780469,
"narHash": "sha256-ujDpvGKpYLLFP5qPA4eSV0AAYllWT/J7zqJRFGmZuSo=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "72216d18036d31a22791af605b827a2dff64deb4",
"type": "github"
},
"original": {
"owner": "sodiboo",
"repo": "niri-flake",
"type": "github"
}
},
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1726304152,
"narHash": "sha256-4YDrKMwXGVOBkeaISbxqf24rLuHvO98TnqxWYfgiSeg=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "6a48728ffb1e638839b07f9ab2f06b2adb41dc61",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v0.1.9",
"repo": "niri",
"type": "github"
}
},
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1727778508,
"narHash": "sha256-9oMBzXZZzEVZAqHA79aJSQmNJ75hQuCpq0POB0Lxt7Q=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "0cca7a21163f0d4c1e99c12844da027a23e76003",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"repo": "niri",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1727665282,
@ -299,11 +393,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1715266358,
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
"type": "github"
},
"original": {
@ -326,6 +420,18 @@
}
},
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}
},
"nixpkgs-lib_3": {
"locked": {
"lastModified": 1714640452,
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
@ -337,7 +443,39 @@
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1727672256,
"narHash": "sha256-9/79hjQc9+xyH+QxeMcRsA6hDyw6Z9Eo1/oxjvwirLk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1719f27dd95fd4206afb9cec9f415b539978827e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1715266358,
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1727634051,
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=",
@ -353,7 +491,23 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1727634051,
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
@ -369,7 +523,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_6": {
"locked": {
"lastModified": 1656753965,
"narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=",
@ -385,7 +539,7 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_7": {
"locked": {
"lastModified": 1726871744,
"narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=",
@ -419,11 +573,11 @@
},
"nvf": {
"inputs": {
"flake-parts": "flake-parts_3",
"flake-parts": "flake-parts_4",
"flake-utils": "flake-utils_2",
"mnw": "mnw",
"nil": "nil",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_5",
"nmd": "nmd",
"plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
@ -527,7 +681,7 @@
"plugin-vim-vsnip": "plugin-vim-vsnip",
"plugin-which-key": "plugin-which-key",
"rnix-lsp": "rnix-lsp",
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1727647833,
@ -2186,7 +2340,7 @@
"rnix-lsp": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_6",
"utils": "utils"
},
"locked": {
@ -2205,15 +2359,17 @@
},
"root": {
"inputs": {
"ags": "ags",
"basix": "basix",
"flake-parts": "flake-parts_2",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"niri": "niri",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_4",
"nvf": "nvf",
"plasma-manager": "plasma-manager",
"systems": "systems_3",
"systems": "systems_4",
"treefmt-nix": "treefmt-nix",
"wezterm": "wezterm"
}
@ -2268,16 +2424,16 @@
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
@ -2297,6 +2453,21 @@
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -2311,7 +2482,7 @@
"type": "github"
}
},
"systems_4": {
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -2328,7 +2499,7 @@
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1727431250,
@ -2388,6 +2559,39 @@
"type": "github"
}
},
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1718165778,
"narHash": "sha256-dwF9nI54a6Fo9XU5s4qmvMXSgCid3YQVGxch00qEMvI=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "b6d281967cb0b7bf1dfdb8d0f597b517dc4aa5c5",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.4",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1726378112,
"narHash": "sha256-OANPb73V/RQDqtpIcbzeJ93KuOHKFQv+1xXC44Ut7tY=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "b962a0f33b503aa39c9cf6919f488b664e5b79b4",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"type": "github"
}
},
"zlib": {
"flake": false,
"locked": {

View file

@ -59,6 +59,12 @@
inputs.home-manager.follows = "home-manager";
};
ags.url = "github:Aylur/ags";
niri = {
url = "github:sodiboo/niri-flake";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-hardware.url = "github:NixOS/nixos-hardware";

View file

@ -5,7 +5,6 @@
}: {
imports = [
./terminal
self.nixosModules.theme
];
home = {
username = "nezia";
@ -14,7 +13,4 @@
};
programs.home-manager.enable = true;
theme.wallpaper = lib.mkDefault ../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg;
theme.scheme = lib.mkDefault "catppuccin-frappe";
}

View file

@ -1,18 +1,18 @@
{
self,
inputs,
...
}: {
{self, ...}: {
imports = [
"${self}/home/services/udiskie.nix"
"${self}/home/programs"
"${self}/home/programs/plasma"
"${self}/home/terminal/emulators/konsole.nix"
"${self}/home/programs/niri"
"${self}/home/programs/ags"
"${self}/home/programs/fuzzel.nix"
"${self}/home/programs/swaybg.nix"
"${self}/home/programs/swaylock.nix"
"${self}/home/programs/swayidle.nix"
"${self}/home/terminal/emulators/foot.nix"
"${self}/home/programs/editors/neovim.nix"
inputs.plasma-manager.homeManagerModules.plasma-manager
];
}

View file

@ -0,0 +1,21 @@
{
inputs,
pkgs,
...
}: {
imports = [inputs.ags.homeManagerModules.default];
programs.ags = {
enable = true;
# null or path, leave as null if you don't want hm to manage the config
configDir = ./src;
# additional packages to add to gjs's runtime
extraPackages = with pkgs; [
gtksourceview
webkitgtk
accountsservice
];
};
}

View file

@ -0,0 +1,15 @@
# Starter Config
if suggestions don't work, first make sure
you have TypeScript LSP working in your editor
if you do not want typechecking only suggestions
```json
// tsconfig.json
"checkJs": false
```
types are symlinked to:
/home/nezia/.local/share/com.github.Aylur.ags/types

View file

@ -0,0 +1,214 @@
// const hyprland = await Service.import("hyprland");
const notifications = await Service.import("notifications");
const mpris = await Service.import("mpris");
const audio = await Service.import("audio");
const battery = await Service.import("battery");
const systemtray = await Service.import("systemtray");
const date = Variable("", {
poll: [1000, 'date "+%H:%M %b %e."'],
});
// widgets can be only assigned as a child in one container
// so to make a reuseable widget, make it a function
// then you can simply instantiate one by calling it
//function Workspaces() {
// const activeId = hyprland.active.workspace.bind("id");
// const workspaces = hyprland.bind("workspaces").as((ws) =>
// ws.map(({ id }) =>
// Widget.Button({
// on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`),
// child: Widget.Label(`${id}`),
// class_name: activeId.as((i) => `${i === id ? "focused" : ""}`),
// }),
// ),
// );
//
// return Widget.Box({
// class_name: "workspaces",
// children: workspaces,
// });
//}
function ClientTitle() {
return Widget.Label({
class_name: "client-title",
label: "Label!", // hyprland.active.client.bind("title"),
});
}
function Clock() {
return Widget.Label({
class_name: "clock",
label: date.bind(),
});
}
// we don't need dunst or any other notification daemon
// because the Notifications module is a notification daemon itself
function Notification() {
const popups = notifications.bind("popups");
return Widget.Box({
class_name: "notification",
visible: popups.as((p) => p.length > 0),
children: [
Widget.Icon({
icon: "preferences-system-notifications-symbolic",
}),
Widget.Label({
label: popups.as((p) => p[0]?.summary || ""),
}),
],
});
}
function Media() {
const label = Utils.watch("", mpris, "player-changed", () => {
if (mpris.players[0]) {
const { track_artists, track_title } = mpris.players[0];
return `${track_artists.join(", ")} - ${track_title}`;
} else {
return "Nothing is playing";
}
});
return Widget.Button({
class_name: "media",
on_primary_click: () => mpris.getPlayer("")?.playPause(),
on_scroll_up: () => mpris.getPlayer("")?.next(),
on_scroll_down: () => mpris.getPlayer("")?.previous(),
child: Widget.Label({ label }),
});
}
function Volume() {
const icons = {
101: "overamplified",
67: "high",
34: "medium",
1: "low",
0: "muted",
};
function getIcon() {
const icon = audio.speaker.is_muted
? 0
: [101, 67, 34, 1, 0].find(
(threshold) => threshold <= audio.speaker.volume * 100,
);
return `audio-volume-${icons[icon]}-symbolic`;
}
const icon = Widget.Icon({
icon: Utils.watch(getIcon(), audio.speaker, getIcon),
});
const slider = Widget.Slider({
hexpand: true,
draw_value: false,
on_change: ({ value }) => (audio.speaker.volume = value),
setup: (self) =>
self.hook(audio.speaker, () => {
self.value = audio.speaker.volume || 0;
}),
});
return Widget.Box({
class_name: "volume",
css: "min-width: 180px",
children: [icon, slider],
});
}
function BatteryLabel() {
const value = battery.bind("percent").as((p) => (p > 0 ? p / 100 : 0));
const icon = battery
.bind("percent")
.as((p) => `battery-level-${Math.floor(p / 10) * 10}-symbolic`);
return Widget.Box({
class_name: "battery",
visible: battery.bind("available"),
children: [
Widget.Icon({ icon }),
Widget.LevelBar({
widthRequest: 140,
vpack: "center",
value,
}),
],
});
}
function SysTray() {
const items = systemtray.bind("items").as((items) =>
items.map((item) =>
Widget.Button({
child: Widget.Icon({ icon: item.bind("icon") }),
on_primary_click: (_, event) => item.activate(event),
on_secondary_click: (_, event) => item.openMenu(event),
tooltip_markup: item.bind("tooltip_markup"),
}),
),
);
return Widget.Box({
children: items,
});
}
// layout of the bar
function Left() {
return Widget.Box({
spacing: 8,
children: [
// Workspaces(),
ClientTitle(),
],
});
}
function Center() {
return Widget.Box({
spacing: 8,
children: [Media(), Notification()],
});
}
function Right() {
return Widget.Box({
hpack: "end",
spacing: 8,
children: [Volume(), BatteryLabel(), Clock(), SysTray()],
});
}
function Bar(monitor = 0) {
return Widget.Window({
name: `bar-${monitor}`, // name has to be unique
class_name: "bar",
monitor,
anchor: ["top", "left", "right"],
exclusivity: "exclusive",
child: Widget.CenterBox({
start_widget: Left(),
center_widget: Center(),
end_widget: Right(),
}),
});
}
App.config({
style: "./style.css",
windows: [
Bar(),
// you can call it, for each monitor
// Bar(0),
// Bar(1)
],
});
export {};

View file

@ -0,0 +1,40 @@
window.bar {
background-color: @theme_bg_color;
color: @theme_fg_color;
}
button {
min-width: 0;
padding-top: 0;
padding-bottom: 0;
background-color: transparent;
}
button:active {
background-color: @theme_selected_bg_color;
}
button:hover {
border-bottom: 3px solid @theme_fg_color;
}
label {
font-weight: bold;
}
.workspaces button.focused {
border-bottom: 3px solid @theme_selected_bg_color;
}
.client-title {
color: @theme_selected_bg_color;
}
.notification {
color: yellow;
}
levelbar block,
highlight {
min-height: 10px;
}

View file

@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"lib": [
"ES2022"
],
"allowJs": true,
"checkJs": true,
"strict": true,
"noImplicitAny": false,
"baseUrl": ".",
"typeRoots": [
"./types"
],
"skipLibCheck": true
}
}

1
home/programs/ags/src/types Symbolic link
View file

@ -0,0 +1 @@
/home/nezia/.local/share/com.github.Aylur.ags/types

View file

@ -1,4 +1,51 @@
{pkgs, ...}: {
programs.chromium.enable = true;
home.packages = [pkgs.floorp];
programs.firefox = {
enable = true;
profiles = {
nezia = {
search = {
engines = {
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"];
};
"NixOS Wiki" = {
urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}];
iconUpdateURL = "https://wiki.nixos.org/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = ["@nw"];
};
"Home Manager Option Search" = {
urls = [{template = "https://home-manager-options.extranix.com/?release=master&query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@hm"];
};
"Arch Wiki" = {
urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aw"];
};
"Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias
};
};
isDefault = true;
};
};
};
}

View file

@ -1,17 +1,22 @@
{pkgs, ...}: {
imports = [
./browsers.nix
./gtk.nix
./media
./xdg.nix
];
programs.fzf.enable = true;
programs.fastfetch.enable = true;
programs = {
fzf.enable = true;
fastfetch.enable = true;
yazi.enable = true;
};
home.packages = with pkgs; [
imhex
obsidian
proton-pass
spotify
vesktop
wl-clipboard
stremio
cinny-desktop
];
}

View file

@ -98,6 +98,7 @@
nix.enable = true;
clang.enable = true;
python.enable = true;
ts.enable = true;
};
treesitter = {

31
home/programs/fuzzel.nix Normal file
View file

@ -0,0 +1,31 @@
{
inputs,
nixosConfig,
lib,
pkgs,
...
}: {
programs.fuzzel = {
enable = true;
settings = {
main = {
terminal = lib.getExe pkgs.foot;
use-bold = true;
dpi-aware = "auto";
font = "monospace:size=14";
};
colors = let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette;
in {
background = "${palette.base00}ff";
text = "${palette.base05}ff";
input = "${palette.base05}ff";
selection = "${palette.base02}ff";
selection-text = "${palette.base07}ff";
selection-match = "${palette.base0D}ff";
border = "${palette.base0E}ff";
};
border.width = 5;
};
};
}

42
home/programs/gtk.nix Normal file
View file

@ -0,0 +1,42 @@
{
inputs,
pkgs,
config,
nixosConfig,
...
}: {
home.pointerCursor = {
inherit (nixosConfig.style.cursorTheme) name package size;
gtk.enable = true;
x11.enable = true;
};
gtk = let
isDark = inputs.basix.schemeData.base16.${nixosConfig.style.scheme}.variant == "dark";
commonGtkConfig = {
gtk-decoration-layout = ":menu";
gtk-application-prefer-dark-theme = isDark;
};
in {
enable = true;
font = {
name = "Inter";
package = pkgs.inter;
size = 11;
};
gtk3.extraConfig = commonGtkConfig;
gtk4.extraConfig = commonGtkConfig;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
iconTheme = {
inherit (nixosConfig.style.gtk.iconTheme) name package;
};
theme = {
inherit (nixosConfig.style.gtk.theme) name package;
};
};
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
imports = [./zathura.nix];
programs.mpv.enable = true;
home.packages = [
pkgs.gnome-calculator
pkgs.loupe
pkgs.spotify
pkgs.stremio
pkgs.celluloid
];
}

View file

@ -0,0 +1,25 @@
{pkgs, ...}: {
programs.zathura = {
enable = true;
options = {
font = "Inter 12";
selection-notification = true;
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
zoom-min = "10";
};
extraConfig = "include catppuccin-frappe";
};
xdg.configFile = {
"zathura/catppuccin-frappe".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-frappe";
hash = "sha256-xdWI/Ai3iE0zRF/9DCxILKmVaNWbfqHm7Xeh6eKM3MY=";
};
};
}

View file

@ -0,0 +1,152 @@
{
config,
pkgs,
lib,
...
}: let
appLauncher = "fuzzel";
terminal = "foot";
in {
programs.niri.settings.binds = {
"Mod+D".action.spawn = appLauncher;
"Mod+Return".action.spawn = terminal;
"Mod+Shift+E".action.quit.skip-confirmation = true;
"Mod+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay;
"Mod+Q".action = config.lib.niri.actions.close-window;
"Mod+F".action = config.lib.niri.actions.maximize-column;
"Mod+Shift+F".action = config.lib.niri.actions.fullscreen-window;
"Mod+C".action = config.lib.niri.actions.center-column;
# Focus
"Mod+Left".action = config.lib.niri.actions.focus-column-left;
"Mod+Down".action = config.lib.niri.actions.focus-window-down;
"Mod+Up".action = config.lib.niri.actions.focus-window-up;
"Mod+Right".action = config.lib.niri.actions.focus-column-right;
"Mod+H".action = config.lib.niri.actions.focus-column-left;
"Mod+J".action = config.lib.niri.actions.focus-window-down;
"Mod+K".action = config.lib.niri.actions.focus-window-up;
"Mod+L".action = config.lib.niri.actions.focus-column-right;
"Mod+Home".action = config.lib.niri.actions.focus-column-first;
"Mod+End".action = config.lib.niri.actions.focus-column-last;
# Move
"Mod+Ctrl+Left".action = config.lib.niri.actions.move-column-left;
"Mod+Ctrl+Down".action = config.lib.niri.actions.move-window-down;
"Mod+Ctrl+Up".action = config.lib.niri.actions.move-window-up;
"Mod+Ctrl+Right".action = config.lib.niri.actions.move-column-right;
"Mod+Ctrl+H".action = config.lib.niri.actions.move-column-left;
"Mod+Ctrl+J".action = config.lib.niri.actions.move-window-down;
"Mod+Ctrl+K".action = config.lib.niri.actions.move-window-up;
"Mod+Ctrl+L".action = config.lib.niri.actions.move-column-right;
"Mod+Ctrl+Home".action = config.lib.niri.actions.move-column-to-first;
"Mod+Ctrl+End".action = config.lib.niri.actions.move-column-to-last;
# Monitor focus
"Mod+Shift+Left".action = config.lib.niri.actions.focus-monitor-left;
"Mod+Shift+Down".action = config.lib.niri.actions.focus-monitor-down;
"Mod+Shift+Up".action = config.lib.niri.actions.focus-monitor-up;
"Mod+Shift+Right".action = config.lib.niri.actions.focus-monitor-right;
"Mod+Shift+H".action = config.lib.niri.actions.focus-monitor-left;
"Mod+Shift+J".action = config.lib.niri.actions.focus-monitor-down;
"Mod+Shift+K".action = config.lib.niri.actions.focus-monitor-up;
"Mod+Shift+L".action = config.lib.niri.actions.focus-monitor-right;
# Move to monitor
"Mod+Shift+Ctrl+Left".action = config.lib.niri.actions.move-column-to-monitor-left;
"Mod+Shift+Ctrl+Down".action = config.lib.niri.actions.move-column-to-monitor-down;
"Mod+Shift+Ctrl+Up".action = config.lib.niri.actions.move-column-to-monitor-up;
"Mod+Shift+Ctrl+Right".action = config.lib.niri.actions.move-column-to-monitor-right;
"Mod+Shift+Ctrl+H".action = config.lib.niri.actions.move-column-to-monitor-left;
"Mod+Shift+Ctrl+J".action = config.lib.niri.actions.move-column-to-monitor-down;
"Mod+Shift+Ctrl+K".action = config.lib.niri.actions.move-column-to-monitor-up;
"Mod+Shift+Ctrl+L".action = config.lib.niri.actions.move-column-to-monitor-right;
# Workspace navigation
"Mod+Page_Down".action = config.lib.niri.actions.focus-workspace-down;
"Mod+Page_Up".action = config.lib.niri.actions.focus-workspace-up;
"Mod+U".action = config.lib.niri.actions.focus-workspace-down;
"Mod+I".action = config.lib.niri.actions.focus-workspace-up;
"Mod+Ctrl+Page_Down".action = config.lib.niri.actions.move-column-to-workspace-down;
"Mod+Ctrl+Page_Up".action = config.lib.niri.actions.move-column-to-workspace-up;
"Mod+Ctrl+U".action = config.lib.niri.actions.move-column-to-workspace-down;
"Mod+Ctrl+I".action = config.lib.niri.actions.move-column-to-workspace-up;
"Mod+Shift+Page_Down".action = config.lib.niri.actions.move-workspace-down;
"Mod+Shift+Page_Up".action = config.lib.niri.actions.move-workspace-up;
"Mod+Shift+U".action = config.lib.niri.actions.move-workspace-down;
# Workspace focus
"Mod+1".action.focus-workspace = 1;
"Mod+2".action.focus-workspace = 2;
"Mod+3".action.focus-workspace = 3;
"Mod+4".action.focus-workspace = 4;
"Mod+5".action.focus-workspace = 5;
"Mod+6".action.focus-workspace = 6;
"Mod+7".action.focus-workspace = 7;
"Mod+8".action.focus-workspace = 8;
"Mod+9".action.focus-workspace = 9;
# Move to workspace
"Mod+Ctrl+1".action.move-column-to-workspace = 1;
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
"Mod+Ctrl+4".action.move-column-to-workspace = 4;
"Mod+Ctrl+5".action.move-column-to-workspace = 5;
"Mod+Ctrl+6".action.move-column-to-workspace = 6;
"Mod+Ctrl+7".action.move-column-to-workspace = 7;
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
"Mod+Ctrl+9".action.move-column-to-workspace = 9;
"Mod+Shift+I".action = config.lib.niri.actions.move-workspace-up;
# Window management
"Mod+Comma".action = config.lib.niri.actions.consume-window-into-column;
"Mod+Period".action = config.lib.niri.actions.expel-window-from-column;
"Mod+BracketLeft".action = config.lib.niri.actions.consume-or-expel-window-left;
"Mod+BracketRight".action = config.lib.niri.actions.consume-or-expel-window-right;
# Column management
"Mod+R".action = config.lib.niri.actions.switch-preset-column-width;
"Mod+Shift+R".action = config.lib.niri.actions.switch-preset-window-height;
"Mod+Ctrl+R".action = config.lib.niri.actions.reset-window-height;
"Mod+Minus".action = config.lib.niri.actions.set-column-width "-10%";
"Mod+Equal".action = config.lib.niri.actions.set-column-width "+10%";
"Mod+Shift+Minus".action = config.lib.niri.actions.set-window-height "-10%";
"Mod+Shift+Equal".action = config.lib.niri.actions.set-window-height "+10%";
# Screenshots
"Print".action = config.lib.niri.actions.screenshot;
"Ctrl+Print".action = config.lib.niri.actions.screenshot-screen;
"Alt+Print".action = config.lib.niri.actions.screenshot-window;
# System
"Mod+Alt+L".action.spawn = [
"${lib.getExe' pkgs.systemd "loginctl"}"
"lock-session"
];
# Media keys
"XF86AudioRaiseVolume" = {
action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"];
allow-when-locked = true;
};
"XF86AudioLowerVolume" = {
action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"];
allow-when-locked = true;
};
"XF86AudioMute" = {
action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
allow-when-locked = true;
};
"XF86AudioMicMute" = {
action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
allow-when-locked = true;
};
"XF86MonBrightnessUp" = {
action.spawn = ["brillo" "-q" "-u 300000" "-A 5"];
allow-when-locked = true;
};
"XF86MonBrightnessDown" = {
action.spawn = ["brillo" "-q" "-u 300000" "-U 5"];
allow-when-locked = true;
};
};
}

View file

@ -0,0 +1,33 @@
{
inputs,
config,
pkgs,
...
}: let
schemeData = inputs.basix.schemeData.base16.${config.theme.scheme};
in {
imports = [./binds.nix];
programs.niri = {
settings = {
environment."NIXOS_OZONE_WL" = "1";
prefer-no-csd = true;
window-rules = [
{
matches = [
{app-id = "foot";}
];
default-column-width = {proportion = 0.5;};
}
];
layout = {
border.active = pkgs.lib.rgba schemeData.palette.base0E;
};
input.keyboard.xkb = {
layout = "us";
options = "compose:ralt";
};
};
};
}

View file

@ -1,9 +1,13 @@
{
inputs,
config,
pkgs,
...
}: {
programs.plasma = {
imports = [
inputs.plasma-manager.homeManagerModules.plasma-manager
];
rograms.plasma = {
enable = true;
workspace = {
lookAndFeel = "org.kde.breezedark.desktop";

19
home/programs/swaybg.nix Normal file
View file

@ -0,0 +1,19 @@
# stolen from https://raw.githubusercontent.com/carlsvelz/dotfiles/a7a109b2e19f73062b4961e7be75836e6d13408c/home/wayland/swaybg.nix
{
pkgs,
lib,
nixosConfig,
...
}: {
systemd.user.services.swaybg = {
Unit = {
Description = "Wayland wallpaper daemon";
PartOf = ["graphical-session.target"];
};
Service = {
ExecStart = "${lib.getExe pkgs.swaybg} -i ${nixosConfig.style.wallpaper} -m fill";
Restart = "on-failure";
};
Install.WantedBy = ["graphical-session.target"];
};
}

View file

@ -0,0 +1,20 @@
{
lib,
config,
...
}: {
services.swayidle = {
enable = true;
events = [
{
event = "lock";
command = "${lib.getExe config.programs.swaylock.package}";
}
{
event = "before-sleep";
command = "${lib.getExe config.programs.swaylock.package}";
}
];
};
systemd.user.services.swayidle.Unit.After = lib.mkForce ["graphical-session.target"];
}

View file

@ -0,0 +1,53 @@
{
inputs,
pkgs,
nixosConfig,
...
}: let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette;
in {
# requires `security.pam.services.swaylock = { };` at the system level or else
# unlock will not work.
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
indicator-radius = 111;
indicator-thickness = 9;
screenshots = true;
effect-blur = "7x5";
effect-vignette = "0.75:0.75";
effect-pixelate = 5;
ignore-empty-password = false; # needed for PAM to work with fprintd / password
inside-color = palette.base01;
inside-clear-color = palette.base0C;
inside-caps-lock-color = palette.base09;
inside-ver-color = palette.base0D;
inside-wrong-color = palette.base08;
key-hl-color = palette.base0B;
layout-bg-color = palette.base00;
layout-border-color = palette.base05;
layout-text-color = palette.base07;
line-color = palette.base00;
line-clear-color = palette.base0C;
line-caps-lock-color = palette.base09;
line-ver-color = palette.base0D;
line-wrong-color = palette.base08;
ring-color = palette.base02;
ring-clear-color = palette.base0C;
ring-caps-lock-color = palette.base09;
ring-ver-color = palette.base0D;
ring-wrong-color = palette.base08;
separator-color = palette.base02;
text-color = palette.base07;
text-clear-color = palette.base04;
text-caps-lock-color = palette.base04;
text-ver-color = palette.base04;
text-wrong-color = palette.base04;
};
};
}

35
home/programs/xdg.nix Normal file
View file

@ -0,0 +1,35 @@
{config, ...}: {
xdg = {
enable = true;
cacheHome = config.home.homeDirectory + "/.local/cache";
mimeApps = {
enable = true;
defaultApplications = {
"default-web-browser" = ["firefox.desktop"];
"text/html" = ["firefox.desktop"];
"x-scheme-handler/http" = ["firefox.desktop"];
"x-scheme-handler/https" = ["firefox.desktop"];
"x-scheme-handler/about" = ["firefox.desktop"];
"x-scheme-handler/unknown" = ["firefox.desktop"];
"x-scheme-handler/chrome" = ["chromium-browser.desktop"];
"inode/directory" = ["yazi.desktop"];
"application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"];
"image/png" = ["org.gnome.Loupe.desktop"];
"image/svg" = [" org.gnome.Loupe.desktop"];
"image/jpeg" = ["org.gnome.Loupe.desktop"];
"image/gif" = [" org.gnome.Loupe.desktop"];
"video/mp4" = ["io.github.celluloid_player.Celluloid.desktop"];
"video/avi" = ["io.github.celluloid_player.Celluloid.desktop"];
"video/mkv" = ["io.github.celluloid_player.Celluloid.desktop"];
};
};
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
};
};
}

View file

@ -3,4 +3,8 @@
./programs
./shell
];
home.sessionVariables = {
EDITOR = "nvim";
};
}

View file

@ -1,6 +1,8 @@
{
inputs,
nixosConfig,
config,
lib,
...
}: {
programs.foot = {
@ -9,10 +11,10 @@
main = {
term = "xterm-256color";
font = "monospace:size=14";
shell = "${lib.getExe config.programs.fish.package}";
};
colors = let
inherit (config.theme) scheme;
schemeData = inputs.basix.schemeData.base16.${scheme};
schemeData = inputs.basix.schemeData.base16.${nixosConfig.style.scheme};
in {
background = schemeData.palette.base00;
foreground = schemeData.palette.base05;

View file

@ -1,7 +1,8 @@
{
imports = [
./fish.nix
./starship.nix
./zoxide.nix
./nushell.nix
./fish.nix
];
}

View file

@ -0,0 +1,30 @@
{
programs.nushell = {
enable = true;
extraConfig = ''
let carapace_completer = {|spans|
carapace $spans.0 nushell ...$spans | from json
}
$env.config = {
show_banner: false,
completions: {
case_sensitive: false # case-sensitive completions
quick: true # set to false to prevent auto-selecting completions
partial: true # set to false to prevent partial filling of the prompt
algorithm: "fuzzy" # prefix or fuzzy
external: {
# set to false to prevent nushell looking into $env.PATH to find more suggestions
enable: true
# set to lower can improve completion performance at the cost of omitting some options
max_results: 100
completer: $carapace_completer # check 'carapace_completer'
}
}
}
'';
};
programs.carapace = {
enable = true;
};
}

View file

@ -1,6 +1,7 @@
{
self,
inputs,
lib,
...
}: {
flake.nixosConfigurations = let
@ -19,8 +20,18 @@
++ [
./vamos
"${mod}/programs/kde.nix"
../system/services/regreet.nix
"${mod}/programs/niri"
self.nixosModules.style
{
style = {
gtk.enable = true;
wallpaper = lib.mkDefault ../wallpapers/lucy-edgerunners-wallpaper.jpg;
scheme = lib.mkDefault "catppuccin-frappe";
};
}
{
home-manager = {
users.nezia.imports = homeImports.vamos;
@ -42,6 +53,7 @@
"${mod}/programs/kde.nix"
"${mod}/hardware/nvidia.nix"
self.nixosModules.theme
{
home-manager = {
users.nezia.imports = homeImports.solaire;

View file

@ -1,4 +1,4 @@
{...}: {
{lib, ...}: {
imports = [
./hardware-configuration.nix
];

View file

@ -3,6 +3,13 @@
lib,
...
}: let
# convert rrggbb hex to rgba(r, g, b, a) CSS format
rgba = c: let
r = toString (hexToDec (builtins.substring 0 2 c));
g = toString (hexToDec (builtins.substring 2 2 c));
b = toString (hexToDec (builtins.substring 4 2 c));
in "rgba(${r}, ${g}, ${b}, .5)";
# Helper function to convert hex color to decimal RGB values
hexToDec = v: let
hexToInt = {
@ -30,21 +37,12 @@
"F" = 15;
};
chars = lib.strings.stringToCharacters v;
charsLen = builtins.length chars;
in
lib.lists.foldl (a: v: a + v) 0
(lib.lists.imap0 (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) chars);
lib.foldl' (a: v: a + v) 0
(lib.imap (k: v: hexToInt."${v}" * (pow 16 (builtins.length chars - k - 1))) chars);
# Power function for exponentiation
pow = let
pow' = base: exponent: value:
if exponent == 0
then 1
else if exponent <= 1
then value
else pow' base (exponent - 1) (value * base);
in
base: exponent: pow' base exponent base;
pow = base: exponent: lib.foldl' (acc: _: acc * base) 1 (lib.range 1 exponent);
# Converts hex color to KDE color format
colorToKde = name: hexColor: let
@ -74,25 +72,22 @@
base0E = ["Color5" "Color5Intense"];
};
# Generate KDE color sections using the mapped colors
colorSections = lib.concatStringsSep "\n" (lib.attrsets.mapAttrsToList
(
name: value:
lib.concatMapStrings (slot: colorToKde slot value) (colorMap.${name} or [])
)
(name: value:
lib.concatMapStrings (slot: colorToKde slot value) (colorMap.${name} or []))
palette);
in
lib.strings.concatStringsSep "\n" (
[
lib.concatStringsSep "\n" [
"[General]"
"\nDescription=${scheme.name}"
"\nOpacity=1"
"\nWallpaper="
]
++ [colorSections]
);
"Description=${scheme.name}"
"Opacity=1"
"Wallpaper="
colorSections
];
# Main function to create the KDE colorscheme file
# Create a KDE konsole color scheme from base16 colors
mkKonsoleColorScheme = scheme:
pkgs.writeText "${scheme.name}.colorscheme" (schemeToKonsole scheme);
in {inherit mkKonsoleColorScheme;}
in {
inherit mkKonsoleColorScheme rgba;
}

View file

@ -1,5 +1,5 @@
{
flake.nixosModules = {
theme = import ./theme;
style = import ./style;
};
}

48
modules/style/default.nix Normal file
View file

@ -0,0 +1,48 @@
{
lib,
pkgs,
...
}: let
inherit (lib) mkOption;
inherit (lib.types) string path package;
in {
imports = [./gtk.nix];
options.style = {
scheme = mkOption {
description = ''
Name of the tinted-scheming color scheme to use.
'';
type = string;
example = lib.literalExpression "catppuccin-frappe";
};
wallpaper = mkOption {
description = ''
Location of the wallpaper that will be used throughout the system.
'';
type = path;
example = lib.literalExpression "./wallpaper.png";
};
cursorTheme = {
name = mkOption {
description = ''
Name of the cursor theme.
'';
default = "Bibata-Modern-Classic";
};
package = mkOption {
type = package;
description = ''
Package providing the cursor theme.
'';
default = pkgs.bibata-cursors;
};
size = mkOption {
description = ''
Size of the cursor.
'';
default = 24;
};
};
};
}

66
modules/style/gtk.nix Normal file
View file

@ -0,0 +1,66 @@
{
config,
lib,
pkgs,
...
}: let
inherit (builtins) pathExists;
inherit (lib) mkOption mkEnableOption;
inherit (lib.types) package str;
cfg = config.style.gtk;
in {
options.style.gtk = {
enable = mkEnableOption "enable GTK theming options";
theme = {
name = mkOption {
type = str;
description = "Name for the GTK theme";
default = "catppuccin-frappe-lavender-standard";
};
package = mkOption {
type = package;
description = "Package providing the GTK theme";
default = pkgs.catppuccin-gtk.override {
# https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/data/themes/catppuccin-gtk/default.nix
variant = "frappe";
accents = ["lavender"];
size = "standard";
};
};
};
iconTheme = {
name = mkOption {
type = str;
description = "The name for the icon theme that will be used for GTK programs";
default = "Papirus-Dark";
};
package = mkOption {
type = package;
description = "The GTK icon theme to be used";
default = pkgs.catppuccin-papirus-folders.override {
accent = "lavender";
flavor = "frappe";
};
};
};
};
config = {
assertions = [
(let
themePath = cfg.theme.package + /share/themes + "/${cfg.theme.name}";
in {
assertion = cfg.enable -> pathExists themePath;
message = ''
${toString themePath} set by the GTK module does not exist!
To suppress this message, make sure that
`config.modules.style.gtk.theme.package` contains
the path `${cfg.theme.name}`
'';
})
];
};
}

View file

@ -1,18 +0,0 @@
{lib, ...}: {
options.theme = {
scheme = lib.mkOption {
description = ''
Name of the tinted-scheming color scheme to use.
'';
type = lib.types.string;
example = lib.literalExpression "catppuccin-frappe";
};
wallpaper = lib.mkOption {
description = ''
Location of the wallpaper that will be used throughout the system.
'';
type = lib.types.path;
example = lib.literalExpression "./wallpaper.png";
};
};
}

View file

@ -2,6 +2,7 @@
imports = [
./boot.nix
./users.nix
./security.nix
../nix
];
i18n = {

3
system/core/security.nix Normal file
View file

@ -0,0 +1,3 @@
{
security.sudo.wheelNeedsPassword = false;
}

View file

@ -1,9 +1,10 @@
{...}: {
{
users.users.nezia = {
isNormalUser = true;
description = "Anthony Rodriguez";
extraGroups = [
"networkmanager"
"video"
"wheel"
];
};

View file

@ -19,9 +19,11 @@ let
laptop =
common
++ [
./hardware/power.nix
./hardware/fprintd.nix
./services/power.nix
./services/brightness.nix
./services/keyd.nix
./services/logind.nix
];
in {
inherit desktop laptop;

View file

@ -1,3 +0,0 @@
{
services.power-profiles-daemon.enable = true;
}

View file

@ -1,4 +1,4 @@
_: {
{pkgs, ...}: {
nixpkgs = {
config.allowUnfree = true;
overlays = [
@ -10,5 +10,6 @@ _: {
};
})
];
config.permittedInsecurePackages = ["cinny-4.2.1" "cinny-unwrapped-4.2.1"];
};
}

View file

@ -4,6 +4,7 @@
];
home-manager = {
backupFileExtension = "backup";
useGlobalPkgs = true;
useUserPackages = true;
};

View file

@ -0,0 +1,30 @@
{
inputs,
lib,
pkgs,
config,
...
}: {
imports = [
inputs.niri.nixosModules.niri
];
programs.niri = {
enable = true;
};
# copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29
security.pam.services.swaylock.text = lib.mkIf config.services.fprintd.enable ''
account required pam_unix.so
# check passwork before fprintd
auth sufficient pam_unix.so try_first_pass likeauth
auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so
auth required pam_deny.so
password sufficient pam_unix.so nullok yescrypt
session required pam_env.so conffile=/etc/pam/environment readenv=0
session required pam_unix.so
'';
}

View file

@ -0,0 +1,3 @@
{
hardware.brillo.enable = true;
}

View file

@ -0,0 +1,5 @@
{
services.logind = {
lidSwitch = "suspend";
};
}

12
system/services/power.nix Normal file
View file

@ -0,0 +1,12 @@
{
services = {
logind.extraConfig = ''
HandlePowerKey=suspend
'';
power-profiles-daemon.enable = true;
# battery info
upower.enable = true;
};
}

View file

@ -0,0 +1,34 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) mkForce;
in {
environment.systemPackages = [
config.style.gtk.theme.package
config.style.gtk.iconTheme.package
config.style.cursorTheme.package
];
programs.regreet = {
enable = true;
package = pkgs.greetd.regreet;
cageArgs = [
"-s"
"-d"
];
settings = {
GTK = {
cursor_theme_name = mkForce config.style.cursorTheme.name;
icon_theme_name = mkForce config.style.gtk.iconTheme.name;
theme_name = mkForce config.style.gtk.theme.name;
};
};
};
security.pam.services.greetd = {
enableGnomeKeyring = true;
fprintAuth = false;
};
}