Compare commits

..

16 commits

Author SHA1 Message Date
03f2102630
feat(desktop): make portals installation configurable 2025-08-27 21:59:49 +02:00
f12c757732
chore(waybar): apply icons name upstream change for audio module 2025-08-26 22:43:22 +02:00
13b1b72ab3
fix(desktop): make screen sharing work 2025-08-26 22:42:18 +02:00
9e4fbf1216
chore(work): add gnupg as SSH agent 2025-08-26 22:41:01 +02:00
58b256850c
fix(sway): use wayland backend for chromium based crap 2025-08-26 00:01:17 +02:00
7590541576
feat(work): install slack and chromium 2025-08-25 23:59:46 +02:00
fbd0aa4f76
fix(sway): swaylock unlable to unlock when installed on non-NixOS 2025-08-25 23:58:13 +02:00
ea62c7207e
chore(work): add kanshi configuration 2025-08-25 19:11:56 +02:00
7d4f0b3eb6
chore(work): add keyboard configuration 2025-08-25 19:10:23 +02:00
65fd07bbec
feat(work): install sway 2025-08-24 22:50:30 +02:00
bfd8d8193d
fix(sway): add possibility to not install swaylock package
Useful when using home-manager on third-party distribution. Swaylock
from nixpkgs become unable to unlock session because PAM
incompatibilities.
2025-08-24 22:45:13 +02:00
8552070665 chore(qutebrowser): use regular nixgl wrapper 2025-08-24 16:36:58 +02:00
28ea3fd3e8 chore(firefox): use regular nixgl wrapper
And remove `enableNixGL` configuration in related home configurations
2025-08-24 16:28:18 +02:00
cb47a9aeda chore(sway): xdg portal is now configured with home-manager 2025-08-24 16:14:14 +02:00
a26f773f01 chore(sway): acctivate nixgl 2025-08-24 16:14:14 +02:00
c6f08ef074 feat(home-manager): install nixgl 2025-08-24 16:14:14 +02:00
88 changed files with 1218 additions and 1941 deletions

76
flake.lock generated
View file

@ -22,15 +22,12 @@
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
@ -46,11 +43,11 @@
]
},
"locked": {
"lastModified": 1758810399,
"narHash": "sha256-bpWoE1tiFX5T1tr5EudkpW9Kk02XR+6olkoSkf3nHZU=",
"lastModified": 1748955489,
"narHash": "sha256-OmZXyW2g5qIuo5Te74McwR0TwauCO2sF3/SjGDVuxyg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "39d26c16866260eee6d0487fe9c102ba1c1bf7b2",
"rev": "bb846c031be68a96466b683be32704ef6e07b159",
"type": "github"
},
"original": {
@ -64,10 +61,10 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1759789371,
"narHash": "sha256-diiyS8Bj/M9UdmiIEos0QBHIIpj/AdO9+dsb2Oc9qws=",
"lastModified": 1755552883,
"narHash": "sha256-wdVtGyN8JkpByIiNwSevZMBy02vWwCPNaD/caCQJ6aM=",
"ref": "main",
"rev": "e6e9d0c0a7cc152ec48ce07cccf56f57a2580d3a",
"rev": "1ccd39ac6de09a7a73a9a36ec1c34f70cb5edfe2",
"shallow": true,
"type": "git",
"url": "ssh://git@git.epha.se:24422/ephase/nix-private.git"
@ -87,11 +84,11 @@
]
},
"locked": {
"lastModified": 1752054764,
"narHash": "sha256-Ob/HuUhANoDs+nvYqyTKrkcPXf4ZgXoqMTQoCK0RFgQ=",
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "a8e1ce7d49a149ed70df676785b07f63288f53c5",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
@ -116,11 +113,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1758690382,
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
"lastModified": 1748693115,
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
"type": "github"
},
"original": {
@ -131,11 +128,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1758690382,
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
"lastModified": 1748693115,
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
"type": "github"
},
"original": {
@ -148,14 +145,15 @@
"nur": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_3",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1758828503,
"narHash": "sha256-IgOibVOqWSZqWsHKK6TuALfuItRymW2YpsdZBjU2yrk=",
"lastModified": 1748973087,
"narHash": "sha256-ZN0XKKdCBC9eLeog7qYhfGPbajkPtQPdlxp/dhwONw4=",
"owner": "nix-community",
"repo": "NUR",
"rev": "544f12f6987ceb94fe2052696da65623c238da4c",
"rev": "90add46380908ba4395f5f1dfec84224a3b0d4b9",
"type": "github"
},
"original": {
@ -181,11 +179,11 @@
]
},
"locked": {
"lastModified": 1758425756,
"narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=",
"lastModified": 1747603214,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
"type": "github"
},
"original": {
@ -194,18 +192,24 @@
"type": "github"
}
},
"systems": {
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}

View file

@ -19,15 +19,8 @@
url = "git+ssh://git@git.epha.se:24422/ephase/nix-private.git?shallow=1&ref=main";
};
};
outputs = {
self,
nixpkgs,
home-manager,
nur,
nixgl,
sops-nix,
...
} @ inputs: let
outputs = { self, nixpkgs, home-manager, nur, nixgl, sops-nix, ... }@inputs:
let
stateVersion = "23.11";
allSystems = [
@ -39,12 +32,7 @@
nixpkgs.lib.genAttrs allSystems
(system: fn { pkgs = import nixpkgs { inherit system; }; });
createNixosSystem = {
system,
hostname,
username ? "ephase",
}:
nixpkgs.lib.nixosSystem {
createNixosSystem = { system, hostname, username ? "ephase" }: nixpkgs.lib.nixosSystem {
system = system;
specialArgs = {
inherit stateVersion inputs;
@ -56,11 +44,7 @@
];
};
createHomeConfiguration = {
system ? "x86_64-linux",
hostname,
username ? "ephase",
}:
createHomeConfiguration = { system ? "x86_64-linux", hostname, username ? "ephase" }:
home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = system;
@ -94,36 +78,15 @@
};
});
nixosConfigurations = {
morty = createNixosSystem {
system = "x86_64-linux";
hostname = "morty";
};
mrmeeseeks = createNixosSystem {
system = "x86_64-linux";
hostname = "mrmeeseeks";
};
luci = createNixosSystem {
system = "x86_64-linux";
hostname = "luci";
};
morty = createNixosSystem { system = "x86_64-linux"; hostname = "morty"; };
mrmeeseeks = createNixosSystem { system = "x86_64-linux"; hostname = "mrmeeseeks";};
luci = createNixosSystem { system = "x86_64-linux"; hostname = "luci"; };
};
homeConfigurations = {
"rick" = createHomeConfiguration {
system = "aarch64-linux";
hostname = "rick";
};
"luci" = createHomeConfiguration {
system = "x86_64-linux";
hostname = "luci";
};
"morty" = createHomeConfiguration {
system = "x86_64-linux";
hostname = "morty";
};
"mrmeeseeks" = createHomeConfiguration {
system = "x86_64-linux";
hostname = "mrmeeseeks";
};
"rick" = createHomeConfiguration { system = "aarch64-linux"; hostname = "rick";};
"luci" = createHomeConfiguration { system = "x86_64-linux"; hostname = "luci";};
"morty" = createHomeConfiguration { system = "x86_64-linux"; hostname = "morty";};
"mrmeeseeks" = createHomeConfiguration { system = "x86_64-linux"; hostname = "mrmeeseeks";};
"work" = createHomeConfiguration {
system = "x86_64-linux";
hostname = "work";

View file

@ -1,23 +1,13 @@
{ inputs, lib, stateVersion, username, hostname, nixgl, ... }:
{
inputs,
lib,
stateVersion,
username,
hostname,
nixgl,
...
}: {
imports =
[
imports = [
inputs.sops-nix.homeManagerModules.sops
../hosts/${hostname}/home-config.nix
../nixos/includes/system/overlay.nix
../modules/home-manager/default.nix
]
++ lib.optional (
] ++ lib.optional (
builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix
)
../hosts/${hostname}/includes/home-manager.nix;
) ../hosts/${hostname}/includes/home-manager.nix;
nixpkgs.config.allowUnfree = true;
programs.home-manager.enable = true;

View file

@ -1,15 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "i915" ];
@ -20,26 +16,26 @@
boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ee06e049-e738-4f1f-84ab-e8066e0f1640";
fileSystems."/" = {
device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B77A-53B1";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B77A-53B1";
fsType = "vfat";
};

View file

@ -29,7 +29,7 @@
accounts.dav.enable = true;
desktop.sway = {
enable = true;
kanshi.enable = true;
kanshi = true;
wallpapers.lockscreen = "${./files/lockscreen.png}";
wallpapers.desktop = "${./files/wallpaper.png} center #000000";
waybar = {

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
## Specific host home manager configuration
wayland.windowManager.sway.config = {
input = {

View file

@ -1,15 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "i915" ];
@ -18,28 +14,28 @@
boot.extraModulePackages = [ ];
boot.kernelParams = ["fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" "intel_pstate=disable" ];
boot.loader.systemd-boot.consoleMode = "max";
fileSystems."/" = {
device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd"];
};
boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ad4fa799-214c-4e5e-996a-8776e010fb2f";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/E83D-CDFE";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E83D-CDFE";
fsType = "vfat";
};

View file

@ -3,11 +3,11 @@
email = {
enable = true;
accountConfigs = {
"1" = inputs.nix-private.mail.xiemeart;
"2" = inputs.nix-private.mail.ephase;
"3" = inputs.nix-private.mail.ubordeaux;
a = inputs.nix-private.mail.xiemeart;
b = inputs.nix-private.mail.ephase;
c = inputs.nix-private.mail.ubordeaux;
};
primary = "1";
primary = "a";
};
dav.enable = true;
application = {
@ -46,20 +46,7 @@
desktop.sway = {
enable = true;
wallpapers.lockscreen = "${./files/lockscreen.png}";
kanshi = {
enable = true;
standalone = {
profile.name = "standalone";
profile.outputs = [
{
criteria = "eDP-1";
scale = 1.325;
transform = "270";
status = "enable";
}
];
};
};
kanshi = true;
waybar = {
laptop = true;
gpuThermal.enable = false;

View file

@ -1,5 +1,7 @@
{...}: {
home.file.".config/xkb/symbols/gpdwinmax".text = ''
{ ... }:
{
home.file.".config/xkb/symbols/gpdwinmax".text =
''
default partial alphanumeric_keys
xkb_symbols "us-intl-winmax" {
name[group1] = "GPD Win Max us-inlt";
@ -22,5 +24,11 @@
"pointer_accel" = "0.3";
};
};
wayland.windowManager.sway.config.output = {
"eDP-1" = {
transform = "90";
scale = "1.3";
};
};
sops.age.keyFile = "/home/ephase/.config/sops/age/keys.txt";
}

View file

@ -1,15 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
@ -37,25 +33,25 @@
boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ea7fa60d-35e5-48b8-95d7-142f37b262cd";
boot.initrd.luks.devices."nixos".preLVM = true;
fileSystems."/" = {
device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d";
fsType = "btrfs";
options = [ "subvol=@root" "compress=zstd"];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F027-F53F";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/F027-F53F";
fsType = "vfat";
};
fileSystems."/mnt/gamelib" = {
device = "/dev/mapper/tank-gamelib";
fileSystems."/mnt/gamelib" =
{ device = "/dev/mapper/tank-gamelib";
fsType = "ext4";
};

View file

@ -1,10 +1,7 @@
{inputs, ...}: {
{ ... }: {
config.modules = {
application = {
gnupg = {
enable = true;
enableSshSupport = true;
};
gnupg.enable = true;
zathura.enable = true;
foot.enable = true;
};
@ -14,10 +11,7 @@
git.enable = true;
neovim.enable = true;
starship.enable = true;
tmux = {
enable = true;
extraConfig = inputs.nix-private.tmux.personal;
};
tmux.enable = true;
utils.enable = true;
vifm.enable = true;
zsh.enable = true;

View file

@ -1,14 +1,10 @@
{
pkgs,
inputs,
...
}: {
{ pkgs, ... }: {
config.modules = {
application = {
gnupg.enable = true;
gnupg.enable = false;
zathura.enable = true;
foot.enable = true;
imv.enable = true;
foot.enable = false;
imv.enable = false;
};
audio = {
cmus.enable = true;
@ -16,11 +12,7 @@
cli = {
direnv.enable = true;
ghq.enable = true;
git = {
enable = true;
userEmail = inputs.nix-private.git.personal.userEmail;
signingKey = inputs.nix-private.git.personal.signingKey;
};
git.enable = true;
neovim.enable = true;
starship.enable = true;
tmux.enable = true;
@ -37,9 +29,8 @@
web.webcord.enable = false;
gaming.lutris.enable = false;
desktop.sway = {
enable = true;
kanshi.enable = false;
swaylock.useNullPackage = true;
enable = false;
kanshi = false;
wallpapers.lockscreen = "${./files/lockscreen.png}";
wallpapers.desktop = "${./files/background.png} fill #000000";
waybar = {
@ -48,7 +39,7 @@
enable = false;
};
cpuThermal = {
thermalZone = 2;
thermalZone = "2";
# hwmonPathAbs = "";
# inputFilename = "";
};

View file

@ -1,23 +1,21 @@
_: {
wayland.windowManager.sway.config.output = {
"eDP-1" = {
scale = "1.4";
};
"HDMI-A-1" = {
disable = "";
};
};
wayland.windowManager.sway.config.input = {
"4617:27904:MNT_Research_MNT_Reform_Keyboard_2.0_US/LT" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
};
};
_:
{
programs.zsh.loginExtra = ''
# notmuch
#notmutch
export NOTMUCH_CONFIG="$HOME/.config/notmuch/config"
# export PATH=~/.local/bin:$PATH
export PATH=~/.local/bin:$PATH
# export XDG_DATA_HOME=$HOME/.local/share
unset DEBUGINFOD_URLS
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
export QT_QPA_PLATFORM="wayland-egl"
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORMTHEME=qt5ct
export NO_AT_BRIDGE=1
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=sway
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
exec ~/.local/bin/sway.sh
fi
'';
}

View file

@ -1,8 +1,4 @@
{
pkgs,
inputs,
...
}: {
{ pkgs, inputs, ... }: {
config.modules = {
application = {
zathura.enable = true;
@ -36,34 +32,14 @@
};
desktop.sway = {
enable = true;
kanshi = {
enable = true;
profiles = [
{
profile.name = "work";
profile.outputs = [
{
criteria = "Iiyama North America PL2792QN 1179214201663";
mode = "2560x1440";
position = "1450,0";
scale = 1.15;
}
{
criteria = "BOE 0x0A95 Unknown";
mode = "1920x1080";
position = "0,0";
scale = 1.325;
}
];
}
];
kanshi = true;
swaylock.useNullPackage = true;
waybar = {
laptop = true;
gpuThermal.enable = false;
cpuThermal = {
thermalZone = 9;
hwmonPathAbs = "/sys/devices/platform/coretemp.0/hwmon/";
inputFilename = "temp1_input";
};
};
xdg.useDistributionPortals = true;

View file

@ -1,8 +1,5 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
home.packages = with pkgs; [
dejavu_fonts
font-awesome

View file

@ -1,22 +1,19 @@
{
lib,
config,
inputs,
pkgs,
...
}:
with lib; let
{ lib, config, inputs, pkgs, ... }:
with lib;
let
cfg = config.modules.dav;
secretsDirectory = "${(builtins.toString inputs.nix-private)}/secrets";
vdirsyncerConf = {
enable = true;
auth = "basic";
};
in {
in
{
options.modules.dav = {
enable = mkEnableOption "enable personal Caldav / CardDav";
};
config = mkIf cfg.enable {
sops = {
secrets = {
"${inputs.nix-private.dav.personal.secret.key}" = {
@ -37,9 +34,7 @@ in {
"${config.sops.secrets."${inputs.nix-private.dav.personal.secret.key}".path}"
];
};
vdirsyncer =
vdirsyncerConf
// {
vdirsyncer = vdirsyncerConf // {
metadata = [
"color"
"displayname"
@ -75,9 +70,7 @@ in {
type = "filesystem";
fileExt = ".vcf";
};
vdirsyncer =
vdirsyncerConf
// {
vdirsyncer = vdirsyncerConf // {
metadata = [
"displayname"
];

View file

@ -1,14 +1,10 @@
{
lib,
config,
pkgs,
inputs,
...
}:
with lib; let
{ lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.email;
secretsDirectory = "${(builtins.toString inputs.nix-private)}/secrets";
in {
in
{
options.modules.email = {
enable = mkEnableOption "Enable email accounts configuration";
@ -27,14 +23,11 @@ in {
config = mkIf cfg.enable {
sops = let
secretList =
lib.mapAttrs' (
name: value:
nameValuePair (value.secret.key) {
secretList = lib.mapAttrs' ( name: value:
nameValuePair ( value.secret.key ) ({
sopsFile = "${secretsDirectory}/${value.secret.file}";
}
)
cfg.accountConfigs;
})
) cfg.accountConfigs;
in {
secrets = secretList;
};
@ -72,21 +65,17 @@ in {
mailMoverRules = lib.mergeAttrsList (
lib.attrsets.mapAttrsToList (
n: v:
if lib.hasAttrByPath ["afew" "mailMover"] v
then v.afew.mailMover
if lib.hasAttrByPath ["afew" "mailMover"] v then
v.afew.mailMover
else {}
)
cfg.accountConfigs
);
) cfg.accountConfigs);
mailFilterRules = lib.flatten (
lib.attrsets.mapAttrsToList (
n: v:
if lib.hasAttrByPath ["afew" "filters"] v
then v.afew.filters
if lib.hasAttrByPath ["afew" "filters"] v then
v.afew.filters
else []
)
cfg.accountConfigs
);
) cfg.accountConfigs);
in {
enable = true;
extraConfig = ''
@ -107,20 +96,16 @@ in {
'';
};
programs.neomutt = let
accountMacros =
lib.imap1 (
i: elem:
elem
// {
accountMacros = lib.imap1 (
i:
elem: elem // {
map = ["index" "pager"];
key = "<F${(toString (i + 1))}>";
}
) (
}) (
lib.attrsets.mapAttrsToList (
n: c: {"action" = "<sync-mailbox><refresh><enter-command>source ~/.config/neomutt/${n}<enter><change-vfolder>Unread:${c.config.address}<enter>";}
)
cfg.accountConfigs
);
n: c:
{ "action" = "<sync-mailbox><refresh><enter-command>source ~/.config/neomutt/${n}<enter><change-vfolder>Unread:${c.config.address}<enter>";}
) cfg.accountConfigs);
in {
enable = true;
unmailboxes = true;
@ -182,193 +167,63 @@ in {
"unread" "GU" \
"replied" "GR"
${lib.concatStrings (lib.attrsets.mapAttrsToList (_: v:
if lib.hasAttrByPath ["neomuttHooks"] v
then v.neomuttHooks
else "")
cfg.accountConfigs)}
${lib.concatStrings (lib.attrsets.mapAttrsToList ( _: v: if lib.hasAttrByPath [ "neomuttHooks" ] v then v.neomuttHooks else "" ) cfg.accountConfigs)}
# manually source first account instead of use home-manager parameter because
# of $my_pager expansion does not work as this variable is not already set
source ${config.xdg.configHome}/neomutt/${cfg.primary}
'';
binds = [
{
map = ["attach" "browser" "index" "pager"];
key = "g";
action = "noop";
}
{
map = ["attach" "browser" "index" "pager"];
key = "G";
action = "noop";
}
{
map = ["index"];
key = "q";
action = "noop";
}
{
map = ["pager"];
key = "Q";
action = "noop";
}
{
map = ["attach" "browser" "index"];
key = "gg";
action = "first-entry";
}
{
map = ["attach" "browser" "index"];
key = "G";
action = "last-entry";
}
{
map = ["pager"];
key = "gg";
action = "top";
}
{
map = ["pager"];
key = "G";
action = "bottom";
}
{
map = ["pager"];
key = "k";
action = "previous-line";
}
{
map = ["pager"];
key = "j";
action = "next-line";
}
{ map = [ "attach" "browser" "index" "pager" ]; key = "g"; action = "noop"; }
{ map = [ "attach" "browser" "index" "pager" ]; key = "G"; action = "noop"; }
{ map = [ "index" ]; key = "q"; action = "noop";}
{ map = [ "pager" ]; key = "Q"; action = "noop";}
{ map = [ "attach" "browser" "index" ]; key = "gg"; action = "first-entry";}
{ map = [ "attach" "browser" "index" ]; key = "G"; action = "last-entry";}
{ map = [ "pager" ]; key = "gg"; action = "top"; }
{ map = [ "pager" ]; key = "G"; action = "bottom"; }
{ map = [ "pager" ]; key = "k"; action = "previous-line"; }
{ map = [ "pager" ]; key = "j"; action = "next-line"; }
# Scrolling
{
map = ["attach" "browser" "pager" "index"];
key = "\\CF";
action = "next-page";
}
{
map = ["attach" "browser" "pager" "index"];
key = "\\CB";
action = "previous-page";
}
{
map = ["attach" "browser" "pager" "index"];
key = "\\Cu";
action = "half-up";
}
{
map = ["attach" "browser" "pager" "index"];
key = "\\Cd";
action = "half-down";
}
{
map = ["browser" "pager"];
key = "\\Ce";
action = "next-line";
}
{
map = ["browser" "pager"];
key = "\\Cy";
action = "previous-line";
}
{
map = ["index"];
key = "\\Ce";
action = "next-line";
}
{
map = ["index"];
key = "\\Cy";
action = "previous-line";
}
{ map = [ "attach" "browser" "pager" "index" ]; key = "\\CF"; action = "next-page";}
{ map = [ "attach" "browser" "pager" "index" ]; key = "\\CB"; action = "previous-page";}
{ map = [ "attach" "browser" "pager" "index" ]; key = "\\Cu"; action = "half-up";}
{ map = [ "attach" "browser" "pager" "index" ]; key = "\\Cd"; action = "half-down";}
{ map = [ "browser" "pager" ]; key = "\\Ce"; action = "next-line";}
{ map = [ "browser" "pager" ]; key = "\\Cy"; action = "previous-line";}
{ map = [ "index" ]; key = "\\Ce"; action = "next-line";}
{ map = [ "index" ]; key = "\\Cy"; action = "previous-line";}
# Reply
{
map = ["pager" "index"];
key = "R";
action = "group-reply";
}
{ map =[ "pager" "index" ]; key = "R"; action = "group-reply";}
# sidebar
{
map = ["index" "pager"];
key = "<f12>";
action = "sidebar-toggle-visible";
}
{
map = ["index" "pager"];
key = "{";
action = "sidebar-prev";
}
{
map = ["index" "pager"];
key = "}";
action = "sidebar-next";
}
{
map = ["index" "pager"];
key = "|";
action = "sidebar-open";
}
{ map = [ "index" "pager" ]; key = "<f12>"; action = "sidebar-toggle-visible";}
{ map = [ "index" "pager" ]; key = "{"; action = "sidebar-prev";}
{ map = [ "index" "pager" ]; key = "}"; action = "sidebar-next";}
{ map = [ "index" "pager" ]; key = "|"; action = "sidebar-open";}
# open virtual folder
{
map = ["index" "pager"];
key = "X";
action = "noop";
}
{
map = ["index" "pager"];
key = "X";
action = "change-vfolder";
}
{ map = [ "index" "pager" ]; key = "X"; action = "noop";}
{ map = [ "index" "pager" ]; key = "X"; action = "change-vfolder";}
# read entire thread of the current message
{
map = ["index" "pager"];
key = "+";
action = "entire-thread";
}
{ map = [ "index" "pager" ]; key = "+"; action = "entire-thread";}
# generate virtual folder from query
{
map = ["index" "pager"];
key = "\\eX";
action = "vfolder-from-query";
}
{ map = [ "index" "pager" ]; key = "\\eX"; action = "vfolder-from-query";}
# generate virtual folder from query with time window
{
map = ["index" "pager"];
key = "\\CD";
action = "modify-tags";
}
{ map = [ "index" "pager" ]; key = "\\CD"; action = "modify-tags";}
# Editor
{
map = ["editor"];
key = "<Tab>";
action = "complete-query";
}
{
map = ["editor"];
key = "^T";
action = "complete";
}
{ map = [ "editor" ]; key = "<Tab>"; action = "complete-query";}
{ map = [ "editor" ]; key = "^T"; action = "complete";}
];
macros =
[
{
map = ["pager"];
key = "\\CB";
action = "<pipe-message>${pkgs.urlscan}/bin/urlscan -d -c --color true<Enter>";
}
]
++ accountMacros;
macros = [
{ map = [ "pager" ]; key = "\\CB"; action = "<pipe-message>${pkgs.urlscan}/bin/urlscan -d -c --color true<Enter>"; }
] ++ accountMacros;
};
programs.mbsync = {
enable = true;

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.application.foot;
in {
in
{
options.modules.application.foot = {
enable = mkEnableOption "enable Foot terminal emulator";

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.application.gnupg;
in {
in
{
options.modules.application.gnupg = {
enable = mkEnableOption "enable GnuPG and related utils";
@ -23,6 +20,7 @@ in {
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
# pinentry-gnome
gcr
@ -48,10 +46,13 @@ in {
noAllowExternalCache = true;
};
services.ssh-agent.enable =
if cfg.enableSshSupport
then false
else true;
home.sessionVariablesExtra = lib.mkIf cfg.enableSshSupport ''
if [[ -z "''${SSH_AUTH_SOCK}" ]]; then
export SSH_AUTH_SOCK="$(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)"
fi
'';
services.ssh-agent.enable = if cfg.enableSshSupport then false else true;
programs.password-store = {
enable = cfg.pass;
};

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.application.imv;
in {
in
{
options.modules.application.imv = {
enable = mkEnableOption "enable IMV image viewer";
@ -15,6 +12,7 @@ in {
default = true;
description = "install Package, if false relies on distribution packages";
};
};
config = mkIf cfg.enable {
programs.imv = {

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.application.zathura;
in {
in
{
options.modules.application.zathura = {
enable = mkEnableOption "enable Zathura PDF viewer";
};

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.audio.cmus;
in {
in
{
options.modules.audio.cmus= {
enable = mkEnableOption "enable cmus audio player";
};

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.cli.direnv;
in {
in
{
options.modules.cli.direnv = {
enable = mkEnableOption "enable direnv";
};

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.ghq;
in {
in
{
options.modules.cli.ghq = {
enable = mkEnableOption "enable ghq";
};

View file

@ -1,13 +1,9 @@
{
lib,
config,
pkgs,
inputs,
...
}:
with lib; let
{ lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.cli.git;
in {
in
{
options.modules.cli.git = {
enable = mkEnableOption "enable git";
@ -44,6 +40,7 @@ in {
dark = true;
line-numbers = true;
syntax-theme = "base16-256";
};
};
package = pkgs.gitFull;

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.k8s;
in {
in
{
options.modules.cli.k8s = {
enable = mkEnableOption "Install k8s utils";
@ -18,12 +15,10 @@ in {
};
config = mkIf cfg.enable {
home.packages = with pkgs;
[
home.packages = with pkgs; [
kubectl
kubecm
]
++ cfg.kubectlPlugins;
] ++ cfg.kubectlPlugins;
programs.k9s = {
enable = true;
};

View file

@ -1,10 +1,6 @@
{
lib,
pkgs,
config,
...
}:
with lib; let
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.cli.neovim;
nvim-spell-fr-utf8-dictionary = builtins.fetchurl {
url = "https://ftp.nluug.nl/vim/runtime/spell/fr.utf-8.spl";
@ -18,15 +14,15 @@ with lib; let
## Dynamically create LSP servers configurations list regarding
## files in `./files/lsp`
lspConfigFiles = lib.mapAttrs' (
k: _:
lib.nameValuePair
"${config.xdg.configHome}/nvim/lsp/${k}"
{source = ./files/lsp/${k};}
k: _: lib.nameValuePair
("${config.xdg.configHome}/nvim/lsp/${k}")
({ source = ./files/lsp/${k};})
) (builtins.readDir ./files/lsp);
## This variable contains neovim LSP activations
lspLuaConfig = lib.attrsets.mapAttrsToList (
k: v: "vim.lsp.enable('${lib.removeSuffix ".lua" k}')"
k: v:
"vim.lsp.enable('${lib.removeSuffix ".lua" k}')"
) (builtins.readDir ./files/lsp);
## Tony plugins to have a proper helm linting.
@ -35,18 +31,17 @@ with lib; let
version = "main";
src = builtins.fetchGit {
url = "https://github.com/tonychg/nvim-k8s-lsp.git";
rev = "1dffda65f4fe117f67514ed5d93b18f62be1ef24";
rev = "930aa20bcd54f2d6f16040e98ff4068b292c6c7f";
ref = "main";
};
};
in {
in
{
options.modules.cli.neovim = {
enable = mkEnableOption "enable Neovim text editor";
};
config = mkIf cfg.enable {
home.file =
lspConfigFiles
// {
home.file = lspConfigFiles // {
"${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary;
"${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions;
};
@ -70,13 +65,13 @@ in {
python3Packages.python-lsp-server
shellcheck
tofu-ls
terraform-lsp
tflint
vscode-langservers-extracted
yaml-language-server
# Formatters
alejandra
nixfmt-rfc-style
shfmt
yamlfmt
];
@ -85,7 +80,8 @@ in {
+ (builtins.readFile ./files/keybindings.lua)
+ ''
${ lib.concatStringsSep "\n" lspLuaConfig}
'';
''
;
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-autopairs;
@ -97,34 +93,34 @@ in {
{
plugin = catppuccin-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/theme.lua;
config = (builtins.readFile ./files/plugins/theme.lua);
}
{
plugin = blink-cmp;
type = "lua";
config = builtins.readFile ./files/plugins/blink-cmp.lua;
config = (builtins.readFile ./files/plugins/blink-cmp.lua);
}
blink-emoji-nvim
blink-cmp-dictionary
{
plugin = conform-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/conform.lua;
config = (builtins.readFile ./files/plugins/conform.lua);
}
{
plugin = dropbar-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/dropbar.lua;
config = (builtins.readFile ./files/plugins/dropbar.lua);
}
{
plugin = fzf-lua;
type = "lua";
config = builtins.readFile ./files/plugins/fzf-lua.lua;
config = (builtins.readFile ./files/plugins/fzf-lua.lua);
}
{
plugin = gitsigns-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/gitsign.lua;
config = (builtins.readFile ./files/plugins/luasnip.lua);
}
{
plugin = indent-blankline-nvim;
@ -138,12 +134,12 @@ in {
{
plugin = lualine-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/lualine.lua;
config = (builtins.readFile ./files/plugins/lualine.lua);
}
{
plugin = neo-tree-nvim;
type = "lua";
config = builtins.readFile ./files/plugins/neotree.lua;
config = (builtins.readFile ./files/plugins/neotree.lua);
}
nui-nvim
{
@ -161,18 +157,16 @@ in {
{
plugin = nvim-sops;
type = "lua";
config = builtins.readFile ./files/plugins/nvim-sops.lua;
config = (builtins.readFile ./files/plugins/nvim-sops.lua);
}
plenary-nvim
{
plugin = (
nvim-treesitter.withPlugins (p: [
plugin = (nvim-treesitter.withPlugins (p: [
p.bash
p.c
p.cpp
p.cmake
p.dockerfile
p.go
p.hcl
p.helm
p.javascript
@ -198,6 +192,7 @@ in {
plugin = nvim-treesitter-context;
type = "lua";
config = ( builtins.readFile ./files/plugins/treesitter_context.lua);
}
{
plugin = which-key-nvim;
@ -209,10 +204,7 @@ in {
type = "lua";
config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua );
}
{
plugin = helm-ls-nvim;
type = "lua";
}
vim-helm
];
};
};

View file

@ -1,15 +1,6 @@
local opts = { noremap = true, silent = true}
vim.api.nvim_set_keymap('n', '<leader>/', ':nohlsearch<CR>', opts)
vim.api.nvim_set_keymap('n', '<leader>l', ':set list!<CR>', {silent = true})
-- clear search
vim.keymap.set('n', '<leader>l', ':nohlsearch<CR>', { desc = 'Clear search', remap = true, silent = true })
-- Move tabs with \[ and \]
vim.api.nvim_set_keymap('n', '<Leader>]', ':tabnext<CR>', opts)
vim.api.nvim_set_keymap('n', '<Leader>[', ':tabprev<CR>', opts)
-- Switch between windows.
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to the left window', remap = true })
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to the bottom window', remap = true })
@ -28,3 +19,31 @@ vim.keymap.set('n', '<Leader>tn', ':tabnew<CR>', { desc = "Tab [n]ew", remap = t
-- Show all caracters
vim.keymap.set('n', '<leader>l', ':set list!<CR>', { desc = "Show a[l]l caraters", remap = true, silent = true})
-- neotree
-- -------
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})
-- fzf-lua
-- ------
vim.keymap.set('n', '<leader>fb', function() require('fzf-lua').buffers() end, {desc='open [b]uffers'})
vim.keymap.set('n', '<leader>ff', function() require('fzf-lua').files() end, {desc='[r]esume last command'})
vim.keymap.set('n', '<leader>fr', function() require('fzf-lua').files() end, {desc='[f]iles'})
-- git related keymaps
vim.keymap.set('n', '<leader>fgb', function() require('fzf-lua').git_branches() end, {desc='Git [b]ranches'})
vim.keymap.set('n', '<leader>fgc', function() require('fzf-lua').git_commits() end, {desc='Git [c]ommits'})
vim.keymap.set('n', '<leader>fgC', function() require('fzf-lua').git_bcommits() end, {desc='Git current buffer [C]ommits'})
vim.keymap.set('n', '<leader>fgf', function() require('fzf-lua').git_files() end, {desc='Git [f]iles'})
vim.keymap.set('n', '<leader>fgs', function() require('fzf-lua').git_stash() end, {desc='Git [s]tash'})
vim.keymap.set('n', '<leader>fgS', function() require('fzf-lua').git_status() end, {desc='Git [S]tash'})
-- grep related keymaps
vim.keymap.set('n', '<leader>fGb', function() require('fzf-lua').grep_curbuf() end, {desc='grep in current [b]uffer'})
vim.keymap.set('n', '<leader>fGc', function() require('fzf-lua').grep_cword() end, {desc='grep word under the [c]ursor'})
vim.keymap.set('n', '<leader>fGg', function() require('fzf-lua').grep() end, {desc='[g]rep'})
vim.keymap.set('n', '<leader>fGl', function() require('fzf-lua').live_grep() end, {desc='[l]ive grep'})
vim.keymap.set('n', '<leader>fGr', function() require('fzf-lua').grep_last() end, {desc='[r]erun last grep'})

View file

@ -1,8 +1,7 @@
return {
cmd = { 'helm_ls', 'serve' },
filetypes = { 'helm', 'yaml.helm-values' },
single_file_support = true,
root_markers = { 'values.yaml', 'Chart.yaml' },
filetypes = { 'helm' },
root_markers = { 'Chart.yaml' },
capabilities = {
workspace = {
didChangeWatchedFiles = {
@ -19,7 +18,9 @@ return {
showdiagnosticsdirectly = false,
path = "yaml-language-server",
config = {
schemas = {},
schemas = {
kubernetes = "template/**",
},
completion = true,
hover = true,
}

View file

@ -1,5 +1,5 @@
return {
cmd = { 'tofu-ls', 'serve' },
cmd = { 'terraform-ls', 'serve' },
filetypes = { 'terraform', 'terraform-vars' },
root_markers = { '.terraform', '.git' },
}

View file

@ -52,7 +52,7 @@ vim.opt.wildmode = 'lastused:full,list' -- enhance menu
vim.opt.pumheight = 10
vim.opt.pumwidth = 50
vim.opt.pumblend = 10
vim.o.winborder = 'none'
-- manage line break smartly
vim.opt.wrap = true
vim.opt.breakindent = true
@ -103,13 +103,24 @@ vim.opt.wildignore = {
'*.sw?'
}
-- Key biding
-- " ----------
local opts = { noremap = true, silent = true}
vim.api.nvim_set_keymap('n', '<leader>/', ':nohlsearch<CR>', opts)
-- Move tabs with \[ and \]
vim.api.nvim_set_keymap('n', '<Leader>]', ':tabnext<CR>', opts)
vim.api.nvim_set_keymap('n', '<Leader>[', ':tabprev<CR>', opts)
vim.api.nvim_set_keymap('n', '<leader>l', ':set list!<CR>', {silent = true})
-- disable lsplog
-- This is not usefull on a daily basis and should positively impact performance
vim.lsp.set_log_level("off")
-- define a timeout for match parens
vim.g.matchparen_timeout = 10
vim.g.matchparen_insert_timeout = 10
vim.g.matchparen_timeout = 2
vim.g.matchparen_insert_timeout = 2
-- activate virtual lines for diagnistics
-- no more plugins needed
@ -123,73 +134,3 @@ vim.diagnostic.config({
-- },
signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } },
})
-- LSP
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
local opts = { buffer = ev.buf }
local client = vim.lsp.get_client_by_id(ev.data.client_id)
local bufnr = ev.buf
local function desc(description)
return { noremap = true, silent = true, buffer = bufnr, desc = description }
end
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { buffer = ev.buf, desc = "Go to [D]eclaration" })
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Go to [d]efinition" })
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { buffer = ev.buf, desc = "Go to [i]mplementation" })
vim.keymap.set("n", "gr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Go to [r]eferences" })
vim.keymap.set(
"n",
"K",
function()
vim.lsp.buf.hover
{ border = "rounded", max_width = 250 }
end,
opts)
vim.keymap.set(
"n",
"<C-k>",
function()
vim.lsp.buf.signature_help
{ border = "rounded", max_width = 250 }
end,
{buffer = ev.buf, desc = "Signature help"}
)
vim.keymap.set("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set(
"n",
"<leader>wl",
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end,
opts
)
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, { buffer = ev.buf, desc = "Type [D]efinition" })
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "LSP [r]e[n]ame" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Show [c]ode [a]ction"})
vim.keymap.set(
"n",
"<leader>F",
function()
require("conform").format({ bufnr = bufnr })
end,
{ buffer = ev.buf, desc = "[F]ormat file" }
)
if client.server_capabilities.inlayHintProvider then
vim.keymap.set("n", "<space>h", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, desc("LSP toggle inlay [h]ints"))
end
end,
})

View file

@ -4,20 +4,10 @@ require("conform").setup({
timeout_ms = 500,
lsp_format = "never",
},
formatters = {
terraform = {
inherit = false,
command = "tofu",
args = { "fmt", "-" },
stdin = true,
},
},
formatters_by_ft = {
go = { "gofmt" },
nix = { "alejandra" },
sh = { "shfmt" },
terraform = { "terraform" },
yaml = {"yamlfmt"},
sh = { "shfmt" },
go = { "gofmt" },
["_"] = { "trim_whitespace" },
}
})

View file

@ -18,8 +18,3 @@ neotree.setup({
},
}
})
vim.keymap.set('n', '<leader>nc', ':Neotree close<cr>', {desc='Neotree [c]lose'})
vim.keymap.set('n', '<leader>nf', ':Neotree focus filesystem<cr>', {desc='Neotree [f]ocus'})
vim.keymap.set('n', '<leader>nb', ':Neotree focus buffers<cr>', {desc='Neotree Nvim [b]uffers'})
vim.keymap.set('n', '<leader>ng', ':Neotree focus git_status<cr>', {desc='Neotree [g]it status'})

View file

@ -1,6 +1,6 @@
require("nvim-k8s-lsp").setup({
kubernetes_version = "v1.32.8",
kubernetes_version = "v1.32.2",
integrations = {
lualine = true,
lualine = false,
}
})

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.cli.starship;
in {
in
{
options.modules.cli.starship = {
enable = mkEnableOption "enable starship prompt";
};

View file

@ -1,13 +1,10 @@
{
lib,
config,
pkgs,
inputs,
...
}:
with lib; let
{ lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.cli.tmux;
in {
in
{
options.modules.cli.tmux = {
enable = mkEnableOption "enable Tmux";
extraConfig = mkOption {
@ -32,8 +29,7 @@ in {
mouse = true;
prefix = "C-a";
terminal = "tmux-256color";
extraConfig =
''
extraConfig = ''
set -g detach-on-destroy off
set -g display-time 1500

View file

@ -162,7 +162,7 @@ tmux_vsplit() {
tmux_hsplit() {
local size="${1:-20}"
debug "execute hsplit with size '${size}'"
tmux split-window -t "${SESSION_NAME}" -c "$CURRENT_PATH" -h -p "$size"
tmux split-window "${SESSION_NAME}" -c "$CURRENT_PATH" -h -p "$size"
}
tmux_neww() {

View file

@ -1,16 +1,14 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.utils;
in {
in
{
options.modules.cli.utils = {
enable = mkEnableOption "Install cli utils";
};
config = mkIf cfg.enable {
programs.bat = {
enable = true;
config = {
@ -23,6 +21,7 @@ in {
};
programs.fd = {
enable = true;
};
programs.fzf = {
enable = true;

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.vifm;
in {
in
{
options.modules.cli.vifm = {
enable = mkEnableOption "enable Vifm file browser";
};

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.cli.zellij;
in {
in
{
options.modules.cli.zellij = {
enable = mkEnableOption "enable Zellij";
};

View file

@ -1,26 +1,23 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.zsh;
in {
in
{
options.modules.cli.zsh = {
enable = mkEnableOption "enable Zsh configuration";
};
config = mkIf cfg.enable {
programs.zsh = {
enable = true;
dotDir = "${config.xdg.configHome}/zsh";
dotDir = ".config/zsh";
defaultKeymap = "viins";
enableCompletion = true;
history = {
ignoreAllDups = true;
save = 10000;
share = true;
path = "${config.xdg.dataHome}/zsh/history";
path = "$HOME/.local/share/zsh/history";
};
historySubstringSearch = {
enable = true;
@ -109,10 +106,9 @@ in {
rev = "588691ba71b47e75793ed9edfcfaa058326a6f41";
hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E=";
};
}
];
}];
localVariables = {
BASE16_THEME = "${config.xdg.configHome}/zsh/plugins/base16";
BASE16_THEME = "$HOME/.config/zsh/plugins/base16";
# Make ESC key more reactive to go to normal mode
KEYTIMEOUT = 1;
};

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./application/foot
./application/gnupg

View file

@ -1,75 +1,18 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
options.modules.desktop.sway = {
enable = mkEnableOption "enable Sway Windows Manager";
kanshi.enable = mkOption {
kanshi = mkOption {
type = types.bool;
default = false;
description = "configure laptop mode";
};
kanshi.standalone = mkOption {
type = types.attrs;
default = {
profile.name = "standalone";
profile.outputs = [
{
criteria = "eDP-1";
scale = 1.325;
status = "enable";
}
];
};
description = ''
Default configuration for laptop internal screen when no others screen
are connected.
'';
};
kanshi.home = mkOption {
type = types.attrs;
default = {
profile.name = "home";
profile.outputs = [
{
criteria = "Iiyama North America PL2792UH 1166310803122";
mode = "3840x2160";
position = "1235,0";
scale = 1.75;
}
{
criteria = "Iiyama North America PL2792UH 1176923201598";
mode = "3840x2160";
position = "0,0";
transform = "90";
scale = 1.75;
}
{
criteria = "eDP-1";
status = "disable";
}
];
};
description = ''
Default home configuration use on most of my laptops
'';
};
kanshi.others = mkOption {
type = types.listOf types.attrs;
default = [];
description = ''
Kanshi profile to use specifically for host
'';
};
swaylock.useNullPackage = mkOption {
type = types.bool;
default = false;
@ -103,24 +46,6 @@ in {
};
};
iconTheme = mkOption {
type = types.package;
default = pkgs.papirus-icon-theme;
description = ''Icon theme package to use'';
};
iconThemeName = mkOption {
type = types.str;
default = "Papirus Dark";
description = ''Icon theme variant to use'';
};
iconThemePathname = mkOption {
type = types.str;
default = "Papirus-Dark";
description = ''Icon theme variant to use'';
};
waybar = {
laptop = mkOption {
type = types.bool;
@ -129,9 +54,10 @@ in {
};
cpuThermal = {
thermalZone = mkOption {
type = types.nullOr types.int;
default = null;
type = types.str;
default = "";
description = "CPU thermal hwmon thermal Zone";
};
@ -173,6 +99,7 @@ in {
./includes/waybar.nix
];
config = mkIf cfg.enable {
programs.fuzzel.enable = true;
home.packages = with pkgs; [
@ -180,8 +107,6 @@ in {
# emojione
font-awesome
grim
hicolor-icon-theme
jq
lato
liberation_ttf
libertine
@ -192,7 +117,6 @@ in {
noto-fonts-cjk-sans
slurp
wl-clipboard
wl-screenrec
xdg-utils
];
@ -209,8 +133,8 @@ in {
package = pkgs.arc-theme;
};
iconTheme = {
name = cfg.iconThemeName;
package = cfg.iconTheme;
name = "Papirus Dark";
package = pkgs.papirus-icon-theme;
};
font = {
name = "Deja Vu Sans";
@ -262,7 +186,7 @@ in {
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
xdgOpenUsePortal = false;
xdgOpenUsePortal = true;
config = {
sway = {
default = [
@ -277,13 +201,11 @@ in {
# When using `useDistributionPackage`, create wlr configuration to let user
# choose the right screen. This is a workarount to not have to configure
# it manually.
home.file = mkIf cfg.xdg.useDistributionPortals {
"${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = ''
home.file."${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = mkIf cfg.xdg.useDistributionPortals ''
[screencast]
max_fps=30
chooser_type=simple
chooser_cmd=${pkgs.slurp}/bin/slurp -f %o -or
'';
};
};
}

View file

@ -1,161 +0,0 @@
#!/usr/bin/env bash
set -eu -o pipefail
APP_NAME="ScreenCapt"
declare -A COMMAND
COMMAND=(
[screenshot]="grim"
[video]="wl-screenrec"
)
declare -A ICONS
ICONS=(
["screenshot"]="accessories-screenshot"
["video"]="record-desktop"
)
declare -A OUTPUT_DIR
OUTPUT_DIR=(
["screenshot"]="${XDG_PICTURES_DIR:-"~/pictures"}/screenshots"
["video"]="${XDG_VIDEOS_DIR:="~/videos"}/screenrecords"
)
declare -A OUTPUT_FILE_EXT
OUTPUT_FILE_EXT=(
["screenshot"]="png"
["video"]="mp4"
)
TO_FILE=0
RECORD_AUDIO=0
ACTION="screenshot"
REGION_TYPE="window"
notify() {
local summary message command
filename="${1:-""}"
summary="New ${ACTION}!"
if [[ $TO_FILE -eq 1 ]]; then
message+="Available in <i>${filename##*/}</i>"
else
message+="Available in the clipboard"
fi
command=(notify-send "${summary}" --app-name="$APP_NAME")
if [[ -n "$filename" && "$ACTION" == "screenshot" ]]; then
command+=(--icon="${filename}")
else
command+=("--icon=${ICONS[$ACTION]}")
fi
command+=("$message")
"${command[@]}"
}
process_args() {
while :; do
case ''${1:-""} in
screenshot)
ACTION="$1"
;;
video)
# If a video record is in progress Stop it
if pgrep "wl-screenrec"; then
kill -s SIGINT $(pgrep "wl-screenrec")
exit 0
fi
TO_FILE=1
ACTION="$1"
;;
-r | --region)
if [[ "${2:-""}" =~ ^(r|region|s|screen|w|window)$ ]]; then
REGION_TYPE="$2"
else
exit 1
fi
shift
;;
-f | --file)
TO_FILE=1
;;
-a | --with-audio)
RECORD_AUDIO=1
;;
*)
break
;;
esac
shift
done
}
get_app_name() {
local appname
case "$REGION_TYPE" in
r | region)
appname="region"
;;
s | screen)
appname="screen"
;;
w | window)
appname=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | "\(.app_id)"')
;;
esac
printf "%s" "${appname:-}"
}
get_region() {
local region switch
case "$REGION_TYPE" in
r | region)
region=$(slurp)
switch="-g"
;;
s | screen)
region=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | "\(.name)"')
switch="-o"
;;
w | window)
region=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')
switch="-g"
;;
esac
printf "%s%s" "${switch:-}" "${region:-}"
}
get_output_filename() {
local date
printf -v date '%(%F_%H.%M.%S)T'
printf "%s/%s-%s.%s" "${OUTPUT_DIR[$ACTION]}" "$date" "$(get_app_name)" "${OUTPUT_FILE_EXT[$ACTION]}"
}
ensure_directories_exist() {
for dir in "${!OUTPUT_DIR[@]}"; do
mkdir -p "${OUTPUT_DIR[$dir]}"
done
}
main() {
process_args "$@"
ensure_directories_exist
local command
command=("${COMMAND[$ACTION]}" "$(get_region)")
if [[ "$TO_FILE" -eq 1 ]]; then
local filename
filename=$(get_output_filename)
if [[ "$ACTION" = "video" ]]; then
if [[ "$RECORD_AUDIO" -eq 1 ]]; then
command+=(--audio)
fi
command+=(-f)
fi
command+=("$filename")
"${command[@]}"
else
"${command[@]}" - | wl-copy
fi
notify "${filename:-""}"
exit 0
}
main "$@"

View file

@ -1,134 +0,0 @@
@define-color color-base-bg #323232;
@define-color color-base-fg #ddd;
@define-color color-hover #f268b3;
@define-color color-selected #1cd180;
@define-color color-ok #1cd180;
@define-color color-warning #f2b768;
@define-color color-critical #f268b3;
* {
border: none;
border-radius: 0;
min-height:0;
}
window#waybar {
background: @color-base-bg ;
color: @color-base-fg;
font-family: "Fira Code Nerd Font";
font-size: 12px;
}
button,
button:disabled,label:disabled{
color:inherit;
}
button:hover{
background:none;
box-shadow:inherit;
box-shadow:inherit;
text-shadow:inherit;
text-shadow:inherit;
border-top:none;
}
#workspaces {
color:#fff;
}
#workspaces button {
margin:0 3px;
padding:4px 4px;
color:#9c9c9c;
border-bottom: 1px solid transparent;
}
#workspaces button:hover {
box-shadow:inherit;
text-shadow:inherit;
color: @color-hover;
border-bottom: 1px solid @color-hover;
}
#workspaces button.focused {
background: @color-selected;
color: @color-base-bg;
}
#workspaces button.visible:not(.focused) {
color: @color-selected;
border-color: @color-selected;
}
#clock,
#cpu,
#memory,
#backlight,
#network,
#tray,
#mode,
#battery,
#idle_inhibitor {
padding: 2px 4px;
margin: 0;
background-color: transparent;
}
#mode{
background:@color-warning;
color: @color-base-bg;
font-weight:200;
font-variant: small-caps;
font-size: 16px;
}
#pulseaudio {}
#pulseaudio.output.muted {
color:@color-critical;
}
#pulseaudio.input.source-muted {
color:@color-critical;
}
#battery.discharging {
color: @color-base-fg;
border-bottom: none;
}
#battery.charging, #battery.plugged {
border-bottom: 1px solid @color-ok;
color: @color-selected;
}
#battery.critical:not(.charging),
#cpu.critical,
#memory.critical,
#temperature.critical{
border-color: @color-critical;
color: @color-critical;
}
#battery.warning:not(.charging),
#cpu.warning,
#memory.warning{
border-color: @color-warning;
color: @color-warning;
}
#tray {
font-family: "DejaVu sans";
font-size: 12px;
}
#custom-screenrecord {
color: @color-critical;
border-bottom: 1px solid @color-critical;
animation-name: critical-animation;
animation-duration: 2s;
animation-timing-function: ease-in-out;
animation-direction: alternate;
animation-iteration-count: infinite;
}
@keyframes critical-animation {
from {color: @color-critical;}
to {color: white;}
}

View file

@ -1,9 +1,6 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; {
config = mkIf config.modules.desktop.sway.enable {
programs.fuzzel = {
settings = {

View file

@ -1,20 +1,61 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf cfg.enable {
config = mkIf config.modules.desktop.sway.enable {
services.kanshi = {
enable = cfg.kanshi.enable;
settings =
[
cfg.kanshi.standalone
cfg.kanshi.home
]
++ cfg.kanshi.others;
enable = config.modules.desktop.sway.kanshi ;
settings = [
{
profile.name = "standalone";
profile.outputs = [
{
criteria = "eDP-1";
scale = 1.33;
status = "enable";
}
];
}
{
profile.name = "home";
profile.outputs = [
{
criteria = "Iiyama North America PL2792UH 1166310803122";
mode = "3840x2160";
position = "1235,0";
scale = 1.75;
}
{
criteria = "Iiyama North America PL2792UH 1176923201598";
mode = "3840x2160";
position = "0,0";
transform = "90";
scale = 1.75;
}
{
criteria = "eDP-1";
status = "disable";
}
];
}
{
profile.name = "work";
profile.outputs = [
{
criteria = "Iiyama North America PL2792QN 1179214201663";
mode = "2560x1440";
position = "1450,0";
scale = 1.15;
}
{
criteria = "BOE 0x0A95 Unknown";
mode = "1920x1080";
position = "0,0";
scale = 1.325;
}
];
}
];
};
};
}

View file

@ -1,12 +1,6 @@
{ config, pkgs, lib, ... }:
with lib;
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
systemd.user.services.mako = {
Service = {
@ -30,11 +24,12 @@ in {
border-radius = 0;
border-size = 2;
icons = true;
icon-path = "${cfg.iconTheme}/share/icons/${cfg.iconThemePathname}";
max-icon-size = 64;
layer = "overlay";
anchor = "top-right";
format = ''<span font_scale='small-caps'>%a</span>\n<b>%s</b>\n%b'';
format = ''
<span font_scale='small-caps'>%a</span>\n<b>%s</b>\n%b
'';
"urgency=high" = {
border-color = "#F268b3";
};

View file

@ -1,12 +1,9 @@
{
config,
pkgs,
lib,
...
}:
with lib; let
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
config = mkIf config.modules.desktop.sway.enable {
wayland.windowManager.sway = {
package = config.lib.nixGL.wrap pkgs.sway;
@ -37,15 +34,10 @@ in {
};
keybindings = let
mod = config.wayland.windowManager.sway.config.modifier;
inherit
(config.wayland.windowManager.sway.config)
left
down
up
right
terminal
;
in {
inherit (config.wayland.windowManager.sway.config)
left down up right terminal;
in
{
# navigate only with direction or workspace
"${mod}+${left}" = "focus left";
"${mod}+${down}" = "focus down";
@ -84,10 +76,7 @@ in {
"${mod}+Alt+k" = "kill";
"${mod}+Alt+c" = "reload";
"${mod}+Alt+Backspace" = "exec swaynag -t warning -m 'Exit sway?' -B 'Yes' 'swaymsg exit'";
"${mod}+Alt+l" =
if cfg.swaylock.useNullPackage
then "exec swaylock"
else "exec ${pkgs.swaylock}/bin/swaylock";
"${mod}+Alt+l" = if cfg.swaylock.useNullPackage then "exec swaylock" else "exec ${pkgs.swaylock}/bin/swaylock";
# Manage windows placement
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
@ -98,12 +87,8 @@ in {
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+a" = "focus parent";
"${mod}+Shift+minus" = "move scratchpad";
"${mod}+minus" = "scratchpad show";
"${mod}+p" = "exec screencapt --region window";
"${mod}+Shift+p" = "exec screencapt --region screen";
"${mod}+Alt+p" = "mode screenshot";
"${mod}+Alt+r" = "mode screenrecord";
"${mod}+Shift+p" = "move scratchpad";
"${mod}+p" = "scratchpad show";
# Media stuff
"${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-";
"${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%";
@ -116,14 +101,10 @@ in {
"${mod}+shift+n" = "exec makoctl dismiss -a";
"${mod}+alt+n" = "mode notification";
};
modes = let
inherit
(config.wayland.windowManager.sway.config)
left
down
up
right
;
modes =
let
inherit (config.wayland.windowManager.sway.config)
left down up right;
in {
"resize" = {
"${left}" = "resize shrink width 10 px or 10 ppt";
@ -137,26 +118,6 @@ in {
"r" = "exec ${pkgs.mako}/bin/makoctl restore";
"Escape" = "mode default";
};
"screenshot" = {
"s" = "exec screencapt --region screen; mode default";
"Shift+s" = "exec screencapt --region screen -f; mode default";
"r" = "exec screencapt --region region; mode default";
"Shift+r" = "exec screencapt --region region -f; mode default";
"w" = "exec screencapt --region window; mode default";
"Shift+w" = "exec screencapt --region window -f; mode default";
"Return" = "mode default";
"Escape" = "mode default";
};
"screenrecord" = {
"s" = "exec screencapt video --region screen; mode default";
"Shift+s" = "exec screencapt --region video screen -a; mde default";
"r" = "exec screencapt video --region region; mode default";
"Shift+r" = "exec screencapt video --region region -a; mode default";
"w" = "exec screencapt video --region window -f ; mode default";
"Shift+w" = "exec screencapt --region video window -a; mode default";
"Return" = "mode default";
"Escape" = "mode default";
};
};
colors = {
focused = {
@ -214,8 +175,7 @@ in {
criteria = {
title = "^Open .*$";
};
}
];
}];
};
floating = {
border = 2;
@ -254,9 +214,5 @@ in {
title_align right
'';
};
home.file.".local/bin/screencapt" = {
executable = true;
source = ./files/screencapt.sh;
};
};
}

View file

@ -1,22 +1,16 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
config = mkIf config.modules.desktop.sway.enable {
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 300;
command =
if cfg.swaylock.useNullPackage
then ''/usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
}
{
timeout = 600;
@ -27,17 +21,11 @@ in {
events = [
{
event = "before-sleep";
command =
if cfg.swaylock.useNullPackage
then ''/usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
}
{
event = "lock";
command =
if cfg.swaylock.useNullPackage
then ''usr/bin/swaylock -f''
else ''${pkgs.swaylock}/bin/swaylock -f'';
command = if cfg.swaylock.useNullPackage then ''usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f'';
}
];
};

View file

@ -1,24 +1,15 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
config = mkIf config.modules.desktop.sway.enable {
programs.swaylock = {
package =
if cfg.swaylock.useNullPackage
then null
else pkgs.swaylock;
package = if cfg.swaylock.useNullPackage then null else pkgs.swaylock;
enable = true;
settings = {
image =
if cfg.wallpapers.lockscreen != ""
then "${cfg.wallpapers.lockscreen}"
else false;
image = if cfg.wallpapers.lockscreen != "" then "${cfg.wallpapers.lockscreen}" else false;
scaling = "center";
color = "000000";
indicator-radius = 70;

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{lib, config, ...}:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
config = mkIf cfg.enable {
programs.waybar = {
enable = true;
@ -19,50 +16,42 @@ in {
layer = "top";
spacing = 6;
disable-toolptips = true;
modules-center = [
"custom/screenrecord"
];
modules-center = [];
modules-left = [
"sway/workspaces"
"sway/mode"
];
modules-right =
[
modules-right = [
"network"
"custom/sep"
]
++ (
if cfg.waybar.laptop
then [
] ++ (
if cfg.waybar.laptop then [
"backlight"
"battery"
"custom/sep"
]
else [
]
)
++ [
) ++
[
"memory"
"cpu"
"temperature"
"custom/sep"
]
++ (
if cfg.waybar.gpuThermal.enable
then [
] ++ (
if cfg.waybar.gpuThermal.enable then [
"temperature#gpu"
"custom/sep"
]
else [
]
)
++ [
"pulseaudio#input"
"pulseaudio#output"
) ++
[
"pulseaudio"
"custom/sep"
"clock"
"custom/sep"
"privacy"
"tray"
];
"clock" = {
@ -83,14 +72,6 @@ in {
"format" = "|";
"tooltip" = false;
};
"custom/screenrecord" = {
"format" = " [rec.] ";
"interval" = 1;
"exec" = "echo '{\"class\": \"recording\"}'";
"exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec";
"on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)";
"tooltype" = false;
};
"idle_inhibitor" = {
"format" = "{icon}";
"format-icons" = {
@ -99,7 +80,7 @@ in {
};
};
"memory" = {
"format" = "{used:0.0f}/{total:0.0f}G ";
"format" = "{used:0.1f}G/{total:0.1f}G ";
"interval" = 30;
"states" = {
"critical" = 90;
@ -107,50 +88,26 @@ in {
};
};
"network" = {
"format-alt" = "{ifname}: {essid} {ipaddr}/{cidr} 󰈀 ";
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
"format-disconnected" = "Disconnected ";
"format-ethernet" = "{ifname} 󰈀 ";
"format-ethernet" = "{ifname}: {ipaddr}/{cidr} 󰈀 ";
"format-linked" = "{ifname} (No IP) 󰈀 ";
"format-wifi" = "{signalStrength}% ";
"format-wifi" = "{essid} ({signalStrength}%) ";
"tooltip" = false;
};
"privacy" = {
"icon-spacing" = 6;
"icon-size" = 11;
"transition-duration" = 250;
"modules" = [
{
"type" = "screenshare";
"tooltip" = false;
}
{
"type" = "audio-out";
"tooltip" = false;
}
{
"type" = "audio-in";
"tooltip" = false;
}
];
"ignore-monitor" = true;
};
"pulseaudio#output" = {
"format" = "{volume}% {icon} ";
"pulseaudio" = {
"format" = "{format_source} {volume}% {icon} ";
"format-bluetooth" = "{volume}% {icon}";
"format-icons" = {
"car" = "";
"default" = "󰕾";
"default" = "";
"hands-free" = "󰋎";
"headphone" = "󰋋";
"headset" = "󰋎";
"phone" = "";
"portable" = "";
};
"format-muted" = "󰖁 ";
"tooltip" = false;
};
"pulseaudio#input" = {
"format" = "{format_source} ";
"format-muted" = "{format_source} 󰝟 ";
"format-source" = "{volume}% ";
"format-source-muted" = " ";
"tooltip" = false;
@ -164,14 +121,11 @@ in {
"temperature" = {
"critical-threshold" = 80;
"format" = "{temperatureC}°C ";
"thermal-zone" =
mkIf (cfg.waybar.cpuThermal.thermalZone != null)
cfg.waybar.cpuThermal.thermalZone;
"hwmon-path-abs" =
mkIf (cfg.waybar.cpuThermal.hwmonPathAbs != "")
"thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != "" )
"${cfg.waybar.cpuThermal.thermalZone}";
"hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" )
"${cfg.waybar.cpuThermal.hwmonPathAbs}";
"input-filename" =
mkIf (cfg.waybar.cpuThermal.inputFilename != "")
"input-filename" = mkIf ( cfg.waybar.cpuThermal.inputFilename != "" )
"${cfg.waybar.cpuThermal.inputFilename}";
};
"temperature#gpu" = {
@ -216,7 +170,121 @@ in {
};
};
};
style = builtins.readFile ./files/waybar-style.css;
style = ''
@define-color color-base-bg #323232;
@define-color color-base-fg #ddd;
@define-color color-hover #f268b3;
@define-color color-selected #1cd180;
@define-color color-ok #1cd180;
@define-color color-warning #f2b768;
@define-color color-critical #f268b3;
* {
border: none;
border-radius: 0;
min-height:0;
}
window#waybar {
background: @color-base-bg ;
color: @color-base-fg;
font-family: "Fira Code Nerd Font";
font-size: 12px;
}
button,
button:disabled,label:disabled{
color:inherit;
}
button:hover{
background:none;
box-shadow:inherit;
box-shadow:inherit;
text-shadow:inherit;
text-shadow:inherit;
border-top:none;
}
#workspaces {
color:#fff;
}
#workspaces button {
margin:0 3px;
padding:4px 4px;
color:#9c9c9c;
border-bottom: 1px solid transparent;
}
#workspaces button:hover {
box-shadow:inherit;
text-shadow:inherit;
color: @color-hover;
border-bottom: 1px solid @color-hover;
}
#workspaces button.focused {
background: @color-selected;
color: @color-base-bg;
}
#workspaces button.visible:not(.focused) {
color: @color-selected;
border-color: @color-selected;
}
#clock,
#cpu,
#memory,
#backlight,
#network,
#tray,
#mode,
#battery,
#idle_inhibitor {
padding: 2px 4px;
margin: 0;
background-color: transparent;
}
#mode{
background:@color-warning;
font-weight:bold;
}
#pulseaudio {}
#pulseaudio.muted {
color:@color-critical;
}
#battery.discharging {
color: @color-base-fg;
border-bottom: none;
}
#battery.charging, #battery.plugged {
border-bottom: 1px solid @color-ok;
color: @color-selected;
}
#battery.critical:not(.charging),
#cpu.critical,
#memory.critical{
border-color: @color-critical;
color: @color-critical;
}
#battery.warning:not(.charging),
#cpu.warning,
#memory.warning{
border-color: @color-warning;
color: @color-warning;
}
#tray {
font-family: "DejaVu sans";
font-size: 12px;
}
'';
};
};
}

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.gaming.lutris;
in {
in
{
options.modules.gaming.lutris = {
enable = mkEnableOption "enable Lutris Gaming preservation platform";
};

View file

@ -1,12 +1,9 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.video.kdenlive;
in {
in
{
options.modules.video.kdenlive = {
enable = mkEnableOption "enable Kdenlive video editor";
};

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.video.mpv;
in {
in
{
options.modules.video.mpv = {
enable = mkEnableOption "enable MPV video player";
};

View file

@ -1,4 +1,5 @@
{
# Disable shield studies
# Mozilla shield studies (https://wiki.mozilla.org/Firefox/Shield) is a feature
# which allows mozilla to remotely install experimental addons.

View file

@ -1,4 +1,5 @@
{
"browser.sessionstore.enabled" = true;
"browser.sessionstore.restore_hidden_tabs" = true;
"browser.sessionstore.restore_pinned_tabs_on_demand" = true;
@ -12,12 +13,14 @@
# background before it is even opened.
"browser.newtab.preload" = false;
# Disable check for captive portal.
# By default, Firefox checks for the presence of a captive portal on every
# startup. This involves traffic to Akamai
# (https://support.mozilla.org/questions/1169302).
"network.captive-portal-service.enabled" = false;
# Disable Javascript in PDF viewer
# Disables executing of JavaScript in the PDF form viewer. It is possible that
# some PDFs are not rendered correctly due to missing functions.

View file

@ -104,4 +104,5 @@
# When you type "something" in the urlbar and press enter, Firefox tries
# "something.com", if Fixup URLs is enabled.
"browser.fixup.alternate.enabled" = false;
}

View file

@ -1,7 +1,7 @@
{
# Disable google safebrowsing
# Google safebrowsing can detect phishing and malware but it also sends
# information to google together with an unique id called wrkey
# informations to google together with an unique id called wrkey
# (http://electroholiker.de/?p=1594).
"browser.safebrowsing.enabled" = false;
"browser.safebrowsing.downloads.remote.url" = "";

View file

@ -1,4 +1,5 @@
{
# Disable Firefox Suggest
# The Firefox Suggest
# (https://support.mozilla.org/en-US/kb/navigate-web-faster-firefox-suggest)

View file

@ -1,4 +1,5 @@
{
# Disable Telemetry
# The telemetry feature
# (https://support.mozilla.org/kb/share-telemetry-data-mozilla-help-improve-firefox)
@ -34,4 +35,5 @@
"browser.crashReports.unsubmittedCheck.enabled" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
}

View file

@ -1,4 +1,5 @@
{
# Enable Do-not-Track
# With the do not track feature, you tell websites, that you do not want to be
# tracked. Most websites ignore this, so you need other privacy options as well.

View file

@ -1,13 +1,10 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
merge = foldr (a: b: a // b) { };
cfg = config.modules.web.firefox;
in {
in
{
options.modules.web.firefox = {
enable = mkEnableOption "enable Firefox web browser";
@ -31,6 +28,7 @@ in {
default = [];
description = "Optional Firefox Plugins to install";
};
};
config = mkIf cfg.enable {
programs.browserpass = {
@ -89,21 +87,13 @@ in {
default = "ddg";
engines = {
"Nix Packages" = {
urls = [
{
urls = [{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.web.qutebrowser;
in {
in
{
options.modules.web.qutebrowser = {
enable = mkEnableOption "enable Qutebrowser web browser";
};

View file

@ -1,12 +1,9 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.web.webcord;
in {
in
{
options.modules.web.webcord = {
enable = mkEnableOption "enable Lutris Gaming preservation platform";
};

View file

@ -1,4 +1,5 @@
_: {
_:
{
imports = [
./desktop/sway
./gaming/steam

View file

@ -1,12 +1,9 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in {
in
{
options.modules.desktop.sway = {
enable = mkEnableOption "Enable Steam Platform";
};

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.gaming.steam;
in {
in
{
options.modules.gaming.steam = {
enable = mkEnableOption "Enable Steam Platform";

View file

@ -1,16 +1,15 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.hardware.lact;
in {
in
{
options.modules.hardware.lact = {
enable = mkEnableOption "Install LACT daemon";
};
config = mkIf cfg.enable {
# Enable Lact (testing purpose for now)
environment.systemPackages = with pkgs; [
lact

View file

@ -1,11 +1,9 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
cfg = config.modules.hardware.laptop;
in {
in
{
options.modules.hardware.laptop = {
enable = mkEnableOption "Install Laptop utils";
@ -27,6 +25,7 @@ in {
};
};
config = mkIf cfg.enable {
# Wifi is installed on laptops
networking.wireless.iwd.enable = true;

View file

@ -1,11 +1,6 @@
{ pkgs, stateVersion, hostname, ... }:
{
pkgs,
stateVersion,
hostname,
...
}: {
imports = [
# Include the results of the hardware scan.
imports = [ # Include the results of the hardware scan.
../hosts/${hostname}/hardware-configuration.nix
../hosts/${hostname}/nixos-config.nix
../modules/nixos

View file

@ -1,4 +1,5 @@
{config, ...}: {
{ config, ...}:
{
security.doas.enable = true;
security.sudo.enable = false;
}

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
nix = {
package = pkgs.nixVersions.latest;
extraOptions = ''
@ -6,3 +7,4 @@
'';
};
}

View file

@ -1,4 +1,5 @@
{config, ...}: {
{ config, ... }:
{
time.timeZone = "Europe/Paris";
# English locale with YYY/MM/DD date format
i18n = {

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
lvm2_dmeventd
];

View file

@ -1,8 +1,5 @@
{ config, pkgs, ...}:
{
config,
pkgs,
...
}: {
environment.systemPackages = with pkgs; [
neovim
];

View file

@ -1,15 +1,9 @@
{ inputs, pkgs, ...}:
{
inputs,
pkgs,
...
}: {
nixpkgs.overlays = [
(final: prev: {
qutebrowser = prev.qutebrowser.override {
enableWideVine =
if pkgs.system == "x86_64-linux"
then true
else false;
enableWideVine = if pkgs.system == "x86_64-linux" then true else false;
};
})
inputs.nur.overlays.default

View file

@ -1,8 +1,5 @@
{ pkgs, username, ... }:
{
pkgs,
username,
...
}: {
# Services
services.pcscd.enable = true;