style: use alejandra formatter on all nix files

This commit is contained in:
Yorick Barbanneau 2025-09-25 23:33:01 +02:00
parent d563805909
commit 0d8a394dcf
Signed by: ephase
GPG key ID: 246042E52B41FFCF
76 changed files with 1287 additions and 935 deletions

View file

@ -19,8 +19,15 @@
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 = [
@ -32,7 +39,12 @@
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;
@ -44,7 +56,11 @@
];
};
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;
@ -78,15 +94,36 @@
};
});
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,13 +1,23 @@
{ inputs, lib, stateVersion, username, hostname, nixgl, ... }:
{
imports = [
inputs,
lib,
stateVersion,
username,
hostname,
nixgl,
...
}: {
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,11 +1,15 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "i915"];
@ -16,26 +20,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

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

View file

@ -1,11 +1,15 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "i915"];
@ -14,28 +18,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

@ -1,7 +1,5 @@
{ ... }:
{
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";

View file

@ -1,11 +1,15 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
@ -33,25 +37,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,4 +1,8 @@
{ pkgs, inputs, ... }: {
{
pkgs,
inputs,
...
}: {
config.modules = {
application = {
gnupg.enable = true;

View file

@ -1,5 +1,4 @@
_:
{
_: {
wayland.windowManager.sway.config.output = {
"eDP-1" = {
scale = "1.4";
@ -15,7 +14,7 @@ _:
};
};
programs.zsh.loginExtra = ''
#notmutch
# notmuch
export NOTMUCH_CONFIG="$HOME/.config/notmuch/config"
# export PATH=~/.local/bin:$PATH
# export XDG_DATA_HOME=$HOME/.local/share

View file

@ -1,4 +1,8 @@
{ pkgs, inputs, ... }: {
{
pkgs,
inputs,
...
}: {
config.modules = {
application = {
zathura.enable = true;

View file

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

View file

@ -1,19 +1,22 @@
{ 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}" = {
@ -34,7 +37,9 @@ in
"${config.sops.secrets."${inputs.nix-private.dav.personal.secret.key}".path}"
];
};
vdirsyncer = vdirsyncerConf // {
vdirsyncer =
vdirsyncerConf
// {
metadata = [
"color"
"displayname"
@ -70,7 +75,9 @@ in
type = "filesystem";
fileExt = ".vcf";
};
vdirsyncer = vdirsyncerConf // {
vdirsyncer =
vdirsyncerConf
// {
metadata = [
"displayname"
];

View file

@ -1,10 +1,14 @@
{ 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";
@ -23,11 +27,14 @@ 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;
};
@ -65,17 +72,21 @@ 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 = ''
@ -96,16 +107,20 @@ 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;
@ -167,63 +182,193 @@ 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,9 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.application.foot;
in
{
lib,
config,
...
}:
with lib; let
cfg = config.modules.application.foot;
in {
options.modules.application.foot = {
enable = mkEnableOption "enable Foot terminal emulator";

View file

@ -1,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.application.gnupg;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.application.gnupg;
in {
options.modules.application.gnupg = {
enable = mkEnableOption "enable GnuPG and related utils";
@ -20,7 +23,6 @@ in
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
# pinentry-gnome
gcr
@ -46,7 +48,10 @@ in
noAllowExternalCache = true;
};
services.ssh-agent.enable = if cfg.enableSshSupport then false else true;
services.ssh-agent.enable =
if cfg.enableSshSupport
then false
else true;
programs.password-store = {
enable = cfg.pass;
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.k8s;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.cli.k8s;
in {
options.modules.cli.k8s = {
enable = mkEnableOption "Install k8s utils";
@ -15,10 +18,12 @@ 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,6 +1,10 @@
{ 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";
@ -14,15 +18,15 @@ 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,13 +39,14 @@ let
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;
};
@ -80,8 +85,7 @@ in
+ (builtins.readFile ./files/keybindings.lua)
+ ''
${lib.concatStringsSep "\n" lspLuaConfig}
''
;
'';
plugins = with pkgs.vimPlugins; [
{
plugin = nvim-autopairs;
@ -93,34 +97,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/gitsign.lua;
}
{
plugin = indent-blankline-nvim;
@ -134,12 +138,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
{
@ -157,11 +161,12 @@ 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
@ -193,7 +198,6 @@ in
plugin = nvim-treesitter-context;
type = "lua";
config = (builtins.readFile ./files/plugins/treesitter_context.lua);
}
{
plugin = which-key-nvim;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.zsh;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.cli.zsh;
in {
options.modules.cli.zsh = {
enable = mkEnableOption "enable Zsh configuration";
};
@ -106,7 +109,8 @@ in
rev = "588691ba71b47e75793ed9edfcfaa058326a6f41";
hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E=";
};
}];
}
];
localVariables = {
BASE16_THEME = "${config.xdg.configHome}/zsh/plugins/base16";
# Make ESC key more reactive to go to normal mode

View file

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

View file

@ -1,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
options.modules.desktop.sway = {
enable = mkEnableOption "enable Sway Windows Manager";
@ -72,7 +75,6 @@ in
};
cpuThermal = {
thermalZone = mkOption {
type = types.nullOr types.int;
default = null;
@ -117,7 +119,6 @@ in
./includes/waybar.nix
];
config = mkIf cfg.enable {
programs.fuzzel.enable = true;
home.packages = with pkgs; [

View file

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

View file

@ -1,12 +1,14 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; {
config = mkIf config.modules.desktop.sway.enable {
services.kanshi = {
enable = config.modules.desktop.sway.kanshi;
settings = [
{
profile.name = "standalone";
profile.outputs = [
{

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
systemd.user.services.mako = {
Service = {

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf config.modules.desktop.sway.enable {
wayland.windowManager.sway = {
package = config.lib.nixGL.wrap pkgs.sway;
@ -34,10 +37,15 @@ 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";
@ -76,7 +84,10 @@ 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";
@ -105,10 +116,14 @@ 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";
@ -142,7 +157,6 @@ in
"Return" = "mode default";
"Escape" = "mode default";
};
};
colors = {
focused = {
@ -200,7 +214,8 @@ in
criteria = {
title = "^Open .*$";
};
}];
}
];
};
floating = {
border = 2;

View file

@ -1,16 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
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;
@ -21,11 +27,17 @@ 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,15 +1,24 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
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,9 +1,12 @@
{lib, config, pkgs, ...}:
with lib;
let
cfg = config.modules.desktop.sway;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.desktop.sway;
in {
config = mkIf cfg.enable {
programs.waybar = {
enable = true;
@ -23,33 +26,37 @@ in
"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"
"custom/sep"
@ -157,11 +164,14 @@ in
"temperature" = {
"critical-threshold" = 80;
"format" = " {temperatureC}°C ";
"thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != null )
"thermal-zone" =
mkIf (cfg.waybar.cpuThermal.thermalZone != null)
cfg.waybar.cpuThermal.thermalZone;
"hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" )
"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" = {

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
{
# 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,5 +1,4 @@
{
"browser.sessionstore.enabled" = true;
"browser.sessionstore.restore_hidden_tabs" = true;
"browser.sessionstore.restore_pinned_tabs_on_demand" = true;
@ -13,14 +12,12 @@
# 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,5 +104,4 @@
# 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
# informations to google together with an unique id called wrkey
# information 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,5 +1,4 @@
{
# Disable Firefox Suggest
# The Firefox Suggest
# (https://support.mozilla.org/en-US/kb/navigate-web-faster-firefox-suggest)

View file

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

View file

@ -1,5 +1,4 @@
{
# 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,10 +1,13 @@
{ 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";
@ -28,7 +31,6 @@ in
default = [];
description = "Optional Firefox Plugins to install";
};
};
config = mkIf cfg.enable {
programs.browserpass = {
@ -87,13 +89,21 @@ 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,9 +1,12 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.web.qutebrowser;
in
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.modules.web.qutebrowser;
in {
options.modules.web.qutebrowser = {
enable = mkEnableOption "enable Qutebrowser web browser";
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,9 +1,15 @@
{ 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,5 +1,8 @@
{ pkgs, username, ... }:
{
pkgs,
username,
...
}: {
# Services
services.pcscd.enable = true;