Format using nixfmt rfc style

This commit is contained in:
Paul-Henri Froidmont 2024-08-20 22:58:24 +02:00
parent d07a224bbc
commit f6be5f8b80
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
37 changed files with 934 additions and 612 deletions

View file

@ -1,9 +1,14 @@
{ inputs, config, lib, pkgs, ... }:
{
inputs,
lib,
pkgs,
...
}:
with lib;
with lib.my; {
imports = [ inputs.home-manager.nixosModules.home-manager ]
++ (mapModulesRec' (toString ./modules) import);
{
imports = [
inputs.home-manager.nixosModules.home-manager
] ++ (lib.my.mapModulesRec' (toString ./modules) import);
nix = {
package = pkgs.nixFlakes;
@ -23,22 +28,22 @@ with lib.my; {
};
};
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
system.configurationRevision = lib.mkIf (inputs.self ? rev) inputs.self.rev;
time.timeZone = mkDefault "Europe/Amsterdam";
time.timeZone = lib.mkDefault "Europe/Amsterdam";
i18n.defaultLocale = mkDefault "en_US.UTF-8";
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
console = {
keyMap = lib.mkDefault "fr";
font = mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz";
font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz";
earlySetup = true;
};
fonts.fontconfig.antialias = mkDefault true;
fonts.fontconfig.antialias = lib.mkDefault true;
fonts.fontconfig.subpixel = {
rgba = mkDefault "none";
lcdfilter = mkDefault "none";
rgba = lib.mkDefault "none";
lcdfilter = lib.mkDefault "none";
};
environment.systemPackages = with pkgs; [
@ -60,7 +65,10 @@ with lib.my; {
];
networking.hosts = {
"127.0.0.1" = [ "localhost" "membres.yourcoop.local" ];
"127.0.0.1" = [
"localhost"
"membres.yourcoop.local"
];
};
services.resolved.dnssec = "false";
}

View file

@ -25,16 +25,24 @@
};
};
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, ... }:
outputs =
inputs@{
self,
nixpkgs,
nixpkgs-unstable,
...
}:
let
inherit (lib.my) mapHosts;
system = "x86_64-linux";
mkPkgs = pkgs: extraOverlays:
mkPkgs =
pkgs: extraOverlays:
import pkgs {
inherit system;
config.allowUnfreePredicate = pkg:
config.allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [
"corefonts"
"steam"
@ -46,24 +54,30 @@
pkgs = mkPkgs nixpkgs [ self.overlay ];
pkgs-unstable = mkPkgs nixpkgs-unstable [ ];
lib = nixpkgs.lib.extend (self: super: {
lib = nixpkgs.lib.extend (
self: super: {
my = import ./lib {
inherit pkgs inputs;
lib = self;
};
});
}
);
in
{
lib = lib.my;
overlay = final: prev: { unstable = pkgs-unstable; };
overlays = { my = (import ./overlay.nix); };
overlays = {
my = import ./overlay.nix;
};
nixosConfigurations = (mapHosts ./hosts { }) // {
rpi3 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
specialArgs = {
inherit inputs;
};
modules = [ ./hosts/rpi3/default.nix ];
};
};

View file

@ -1,4 +1,5 @@
{ pkgs, config, lib, ... }: {
{ config, ... }:
{
imports = [ ./hardware-configuration.nix ];
modules = {
@ -26,7 +27,9 @@
services.tlp.enable = true;
home-manager.users.${config.user.name} = { pkgs, config, ... }: {
home-manager.users.${config.user.name} =
{ _ }:
{
services.network-manager-applet.enable = true;
services.blueman-applet.enable = true;
wayland.windowManager.hyprland.settings = {
@ -39,7 +42,12 @@
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ];
"bluez5.roles" = [
"hsp_hs"
"hsp_ag"
"hfp_hf"
"hfp_ag"
];
};
};
system.stateVersion = "21.05";

View file

@ -1,19 +1,28 @@
{ config, lib, pkgs, modulesPath, ... }:
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd.availableKernelModules = [ "nvme" "xhci_pci" "sdhci_pci" ];
initrd.kernelModules = [ "dm-snapshot" ];
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"sdhci_pci"
];
kernelModules = [ "dm-snapshot" ];
};
kernelModules = [ "kvm-amd" ];
# Required, otherwise the kernel freezes on boot
kernelParams = [ "amd_iommu=on" "iommu=pt" "pci=noats" ];
kernelParams = [
"amd_iommu=on"
"iommu=pt"
"pci=noats"
];
extraModulePackages = [ ];
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
initrd.luks.devices."crypted".device =
"/dev/disk/by-uuid/1e900b2e-daea-4558-b18f-3d3a5843de61";
initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/1e900b2e-daea-4558-b18f-3d3a5843de61";
};
hardware.cpu.amd.updateMicrocode = true;
@ -28,8 +37,7 @@
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/bb8fa9ef-9b8f-413d-913a-6c891649a954"; }];
swapDevices = [ { device = "/dev/disk/by-uuid/bb8fa9ef-9b8f-413d-913a-6c891649a954"; } ];
zramSwap.enable = true;
@ -37,7 +45,11 @@
bluetooth = {
enable = true;
# Enable A2DP Sink
settings = { General = { Enable = "Source,Sink,Media,Socket"; }; };
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
};
};

View file

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

View file

@ -19,28 +19,29 @@
loader.efi.canTouchEfiVariables = true;
};
fileSystems."/" = {
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/f1e21558-88e6-413e-b56a-04e0b25e9ddd";
fsType = "ext4";
};
fileSystems."/boot" = {
"/boot" = {
device = "/dev/disk/by-uuid/CCD1-0415";
fsType = "vfat";
};
fileSystems."/home/froidmpa/Nextcloud" = {
"/home/froidmpa/Nextcloud" = {
device = "/dev/disk/by-uuid/a4ba8b21-ea33-4487-b6f6-9bb7470a0acb";
fsType = "ext4";
};
fileSystems."/home/froidmpa/Backup" = {
"/home/froidmpa/Backup" = {
device = "/dev/disk/by-uuid/7fdc4e44-ecb4-49c7-9fb0-cb1ef6235b05";
fsType = "ext4";
};
};
swapDevices =
[{ device = "/dev/disk/by-uuid/f714775c-b5af-4c0c-8330-999b43db4794"; }];
swapDevices = [ { device = "/dev/disk/by-uuid/f714775c-b5af-4c0c-8330-999b43db4794"; } ];
zramSwap.enable = true;
@ -54,11 +55,14 @@
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime amdvlk ];
extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
amdvlk
];
};
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.resolved.dnssec = "false";
}

View file

@ -1,23 +1,28 @@
{ inputs, pkgs, ... }: {
{ inputs, pkgs, ... }:
{
nix = {
registry.nixpkgs.flake = inputs.nixpkgs;
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
};
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.kernelParams = [ "cma=256M" ];
boot = {
loader.grub.enable = false;
loader.generic-extlinux-compatible.enable = true;
kernelParams = [ "cma=256M" ];
};
fileSystems."/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
swapDevices = [{
swapDevices = [
{
device = "/swapfile";
size = 1024;
}];
}
];
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keyFiles = [
@ -33,15 +38,20 @@
mutableSettings = false;
settings = {
http = { address = "0.0.0.0:80"; };
http = {
address = "0.0.0.0:80";
};
auth_attempts = 5;
block_auth_min = 15;
dns = {
bind_hosts = [ "0.0.0.0" ];
port = 53;
statistics_interval = 90;
upstream_dns =
[ "tls://doh.mullvad.net" "[/lan/]192.168.1.1" "[//]192.168.1.1" ];
upstream_dns = [
"tls://doh.mullvad.net"
"[/lan/]192.168.1.1"
"[//]192.168.1.1"
];
local_ptr_upstreams = [ "192.168.1.1" ];
use_private_ptr_resolvers = true;
resolve_clients = true;
@ -64,11 +74,19 @@
};
};
networking.hostName = "rpi3";
networking.firewall.allowedTCPPorts = [ 53 80 ];
networking.firewall.allowedUDPPorts = [ 53 ];
networking = {
hostName = "rpi3";
firewall.allowedTCPPorts = [
53
80
];
firewall.allowedUDPPorts = [ 53 ];
};
environment.systemPackages = with pkgs; [ vim htop-vim ];
environment.systemPackages = with pkgs; [
vim
htop-vim
];
system.stateVersion = "22.05";
}

View file

@ -1,26 +1,22 @@
{ lib, ... }:
with builtins;
with lib;
rec {
# attrsToList
attrsToList = attrs:
mapAttrsToList (name: value: { inherit name value; }) attrs;
attrsToList = attrs: lib.mapAttrsToList (name: value: { inherit name value; }) attrs;
# mapFilterAttrs ::
# (name -> value -> bool)
# (name -> value -> { name = any; value = any; })
# attrs
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
mapFilterAttrs =
pred: f: attrs:
lib.filterAttrs pred (lib.mapAttrs' f attrs);
# Generate an attribute set by mapping a function over a list of values.
genAttrs' = values: f: listToAttrs (map f values);
genAttrs' = values: f: lib.listToAttrs (map f values);
# anyAttrs :: (name -> value -> bool) attrs
anyAttrs = pred: attrs:
any (attr: pred attr.name attr.value) (attrsToList attrs);
anyAttrs = pred: attrs: lib.any (attr: pred attr.name attr.value) (attrsToList attrs);
# countAttrs :: (name -> value -> bool) attrs
countAttrs = pred: attrs:
count (attr: pred attr.name attr.value) (attrsToList attrs);
countAttrs = pred: attrs: lib.count (attr: pred attr.name attr.value) (attrsToList attrs);
}

View file

@ -1,4 +1,9 @@
{ inputs, lib, pkgs, ... }:
{
inputs,
lib,
pkgs,
...
}:
let
inherit (lib) makeExtensible attrValues foldr;
@ -6,13 +11,25 @@ let
modules = import ./modules.nix {
inherit lib;
self.attrs = import ./attrs.nix { inherit lib; self = { }; };
self.attrs = import ./attrs.nix {
inherit lib;
self = { };
};
};
mylib = makeExtensible (self:
with self; mapModules ./.
(file: import file { inherit self lib pkgs inputs; }));
mylib = makeExtensible (
self:
mapModules ./. (
file:
import file {
inherit
self
lib
pkgs
inputs
;
}
)
);
in
mylib.extend
(self: super:
foldr (a: b: a // b) { } (attrValues super))
mylib.extend (self: super: foldr (a: b: a // b) { } (attrValues super))

View file

@ -1,52 +1,62 @@
{ self, lib, ... }:
let
inherit (builtins) attrValues readDir pathExists concatLists;
inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix;
inherit (builtins)
attrValues
readDir
pathExists
concatLists
;
inherit (lib)
id
mapAttrsToList
filterAttrs
hasPrefix
hasSuffix
nameValuePair
removeSuffix
;
inherit (self.attrs) mapFilterAttrs;
in
rec {
mapModules = dir: fn:
mapFilterAttrs
(n: v:
v != null &&
!(hasPrefix "_" n))
(n: v:
let path = "${toString dir}/${n}"; in
if v == "directory" && pathExists "${path}/default.nix"
then nameValuePair n (fn path)
else if v == "regular" &&
n != "default.nix" &&
hasSuffix ".nix" n
then nameValuePair (removeSuffix ".nix" n) (fn path)
else nameValuePair "" null)
(readDir dir);
mapModules' = dir: fn:
attrValues (mapModules dir fn);
mapModulesRec = dir: fn:
mapFilterAttrs
(n: v:
v != null &&
!(hasPrefix "_" n))
(n: v:
let path = "${toString dir}/${n}"; in
if v == "directory"
then nameValuePair n (mapModulesRec path fn)
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
then nameValuePair (removeSuffix ".nix" n) (fn path)
else nameValuePair "" null)
(readDir dir);
mapModulesRec' = dir: fn:
mapModules =
dir: fn:
mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (
n: v:
let
dirs =
mapAttrsToList
(k: _: "${dir}/${k}")
(filterAttrs
(n: v: v == "directory" && !(hasPrefix "_" n))
(readDir dir));
path = "${toString dir}/${n}";
in
if v == "directory" && pathExists "${path}/default.nix" then
nameValuePair n (fn path)
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n then
nameValuePair (removeSuffix ".nix" n) (fn path)
else
nameValuePair "" null
) (readDir dir);
mapModules' = dir: fn: attrValues (mapModules dir fn);
mapModulesRec =
dir: fn:
mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (
n: v:
let
path = "${toString dir}/${n}";
in
if v == "directory" then
nameValuePair n (mapModulesRec path fn)
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n then
nameValuePair (removeSuffix ".nix" n) (fn path)
else
nameValuePair "" null
) (readDir dir);
mapModulesRec' =
dir: fn:
let
dirs = mapAttrsToList (k: _: "${dir}/${k}") (
filterAttrs (n: v: v == "directory" && !(hasPrefix "_" n)) (readDir dir)
);
files = attrValues (mapModules dir id);
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
in

View file

@ -1,26 +1,42 @@
{ inputs, lib, pkgs, ... }:
{
inputs,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let sys = "x86_64-linux";
in {
mkHost = path: attrs @ { system ? sys, ... }:
nixosSystem {
let
sys = "x86_64-linux";
in
rec {
mkHost =
path:
attrs@{
system ? sys,
...
}:
lib.nixosSystem {
inherit system;
specialArgs = { inherit lib inputs system; };
specialArgs = {
inherit lib inputs system;
};
modules = [
{
nixpkgs.pkgs = pkgs;
nix.registry.nixpkgs.flake = inputs.nixpkgs;
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
networking.hostName = lib.mkDefault (lib.removeSuffix ".nix" (baseNameOf path));
}
(filterAttrs (n: v: !elem n [ "system" ]) attrs)
(lib.filterAttrs (n: v: !lib.elem n [ "system" ]) attrs)
../common.nix
(import path)
];
};
mapHosts = dir: attrs @ { system ? system, ... }:
mapModules dir
(hostPath: mkHost hostPath attrs);
mapHosts =
dir:
attrs@{
system ? system,
...
}:
lib.my.mapModules dir (hostPath: mkHost hostPath attrs);
}

View file

@ -3,14 +3,16 @@
let
inherit (lib) mkOption types;
in
rec {
mkOpt = type: default:
mkOption { inherit type default; };
{
mkOpt = type: default: mkOption { inherit type default; };
mkOpt' = type: default: description:
mkOpt' =
type: default: description:
mkOption { inherit type default description; };
mkBoolOpt = default: mkOption {
mkBoolOpt =
default:
mkOption {
inherit default;
type = types.bool;
example = true;

View file

@ -1,12 +1,19 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.apps.rofi;
in {
options.modules.apps.rofi = { enable = mkBoolOpt false; };
let
cfg = config.modules.apps.rofi;
in
{
options.modules.apps.rofi = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.rofi = {
@ -31,7 +38,10 @@ in {
};
theme = ./theme.rasi;
};
home.packages = with pkgs.unstable; [ paper-icon-theme rofi-power-menu ];
home.packages = with pkgs.unstable; [
paper-icon-theme
rofi-power-menu
];
};
};
}

View file

@ -1,9 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
wallpaper = pkgs.fetchurl {
url =
"https://raw.githubusercontent.com/AngelJumbo/gruvbox-wallpapers/main/wallpapers/irl/houseonthesideofalake.jpg";
url = "https://raw.githubusercontent.com/AngelJumbo/gruvbox-wallpapers/main/wallpapers/irl/houseonthesideofalake.jpg";
sha256 = "sha256-obKI4qZvucogqRCl51lwV9X8SRaMqcbBwWMfc9TupIo=";
};
in
@ -23,9 +27,16 @@ in
corefonts # Microsoft free fonts
noto-fonts-emoji
meslo-lg
(nerdfonts.override { fonts = [ "Meslo" "NerdFontsSymbolsOnly" ]; })
(nerdfonts.override {
fonts = [
"Meslo"
"NerdFontsSymbolsOnly"
];
fontconfig.defaultFonts = { monospace = [ "MesloLGS Nerd Font Mono" ]; };
})
];
fontconfig.defaultFonts = {
monospace = [ "MesloLGS Nerd Font Mono" ];
};
};
programs.adb.enable = true;
@ -57,7 +68,9 @@ in
key = lib.mkDefault "3AC6F170F01133CE393BCD94BE948AFD7E7873BE";
signByDefault = true;
};
extraConfig = { init.defaultBranch = "master"; };
extraConfig = {
init.defaultBranch = "master";
};
};
ssh = {
enable = true;
@ -121,10 +134,8 @@ in
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
"application/msword" = "onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
"onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument*" =
"onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "onlyoffice-desktopeditors.desktop";
"application/vnd.openxmlformats-officedocument*" = "onlyoffice-desktopeditors.desktop";
"text/*" = "nvim.desktop";
};
@ -139,7 +150,8 @@ in
sessionVariables.EDITOR = "vim";
packages = (with pkgs.unstable; [
packages =
(with pkgs.unstable; [
brave
ungoogled-chromium
mullvad-browser
@ -167,9 +179,8 @@ in
tldr
ark
linuxPackages.perf
]) ++ [
pkgs.jellyfin-mpv-shim
];
])
++ [ pkgs.jellyfin-mpv-shim ];
};
};

View file

@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.dunst;
in {
options.modules.desktop.dunst = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
let
cfg = config.modules.desktop.dunst;
in
{
options.modules.desktop.dunst = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
services.dunst = {
enable = true;

View file

@ -1,11 +1,18 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.file-manager;
in {
options.modules.desktop.file-manager = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
let
cfg = config.modules.desktop.file-manager;
in
{
options.modules.desktop.file-manager = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.yazi = {
@ -39,11 +46,13 @@ in {
desc = "Copy files to clipboard";
}
];
input.prepend_keymap = [{
input.prepend_keymap = [
{
on = [ "<Esc>" ];
run = "close";
desc = "Cancel input";
}];
}
];
};
theme = {
status = {

View file

@ -1,12 +1,22 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.flameshot;
in {
options.modules.desktop.flameshot = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
let
cfg = config.modules.desktop.flameshot;
in
{
options.modules.desktop.flameshot = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
services.flameshot = {
enable = true;
package = pkgs.flameshot.overrideAttrs (old: {

View file

@ -1,16 +1,26 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.htop;
in {
options.modules.desktop.htop = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
let
cfg = config.modules.desktop.htop;
in
{
options.modules.desktop.htop = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
programs.htop = {
enable = true;
package = pkgs.htop-vim;
settings = {
settings =
{
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
@ -26,19 +36,25 @@ in {
TIME
COMM
];
} // (with config.lib.htop;
}
// (
with config.lib.htop;
leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]) // (with config.lib.htop;
]
)
// (
with config.lib.htop;
rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]);
]
);
};
};
};

View file

@ -1,7 +1,10 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.desktop.themes.gtk;
@ -9,8 +12,7 @@ let
name = "gruvbox-plus";
version = "5.1";
src = pkgs.fetchurl {
url =
"https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v${version}/gruvbox-plus-icon-pack-${version}.zip";
url = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/download/v${version}/gruvbox-plus-icon-pack-${version}.zip";
sha256 = "1n3hqwk1mqaj8vbmy0pqbiq6v5jqrhmhin506xbpnccl28f907j0";
};
dontUnpack = true;
@ -20,10 +22,13 @@ let
'';
};
in {
options.modules.desktop.themes.gtk = { enable = mkBoolOpt false; };
in
{
options.modules.desktop.themes.gtk = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.packages = [ pkgs.dconf ];
@ -48,8 +53,12 @@ in {
};
xdg.configFile = {
"gtk-3.0/gtk.css" = { source = ./gtk.css; };
"gtk-4.0/gtk.css" = { source = ./gtk.css; };
"gtk-3.0/gtk.css" = {
source = ./gtk.css;
};
"gtk-4.0/gtk.css" = {
source = ./gtk.css;
};
};
home = {

View file

@ -1,13 +1,20 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.themes.qt;
let
cfg = config.modules.desktop.themes.qt;
in {
options.modules.desktop.themes.qt = { enable = mkBoolOpt false; };
in
{
options.modules.desktop.themes.qt = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
libsForQt5.qt5.qtquickcontrols2

View file

@ -1,19 +1,23 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.desktop.vscode;
in {
let
cfg = config.modules.desktop.vscode;
in
{
options.modules.desktop.vscode = {
enable = mkBoolOpt false;
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = (
with pkgs.vscode-extensions; [
extensions = with pkgs.vscode-extensions; [
pkief.material-icon-theme
jnoortheen.nix-ide
arrterian.nix-env-selector
@ -22,8 +26,7 @@ in {
hashicorp.terraform
bradlc.vscode-tailwindcss
asciidoctor.asciidoctor-vscode
]
);
];
userSettings = {
"editor.formatOnSave" = true;
"editor.quickSuggestions" = {
@ -33,8 +36,14 @@ in {
"scala" = "html";
};
"tailwindCSS.experimental.classRegex" = [
[ "cls\\(([^)]*)\\)" "\"([^']*)\"" ]
[ "cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)" "\"([^']*)\"" ]
[
"cls\\(([^)]*)\\)"
"\"([^']*)\""
]
[
"cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)"
"\"([^']*)\""
]
];
"files.autoSave" = "onFocusChange";
@ -50,9 +59,7 @@ in {
"terraform.languageServer" = {
"external" = true;
"pathToBinary" = "";
"args" = [
"serve"
];
"args" = [ "serve" ];
"maxNumberOfProblems" = 100;
"trace.server" = "off";
};

View file

@ -1,18 +1,20 @@
{ options, config, lib, pkgs, ... }:
with lib;
with lib.my;
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.desktop.wm;
term = "${
config.home-manager.users.${config.user.name}.programs.kitty.package
}/bin/kitty";
term = "${config.home-manager.users.${config.user.name}.programs.kitty.package}/bin/kitty";
in
{
options.modules.desktop.wm = { enable = mkBoolOpt false; };
options.modules.desktop.wm = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
modules = {
desktop = {
@ -28,7 +30,9 @@ in
htop.enable = true;
flameshot.enable = true;
};
hardware = { audio.enable = true; };
hardware = {
audio.enable = true;
};
apps.rofi.enable = true;
};
@ -113,14 +117,20 @@ in
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
systemd.enable = true;
xwayland.enable = true;
settings = {
"$mod" = "SUPER";
env = [ "XCURSOR_SIZE,24" "WLR_NO_HARDWARE_CURSORS,1" ];
env = [
"XCURSOR_SIZE,24"
"WLR_NO_HARDWARE_CURSORS,1"
];
xwayland = { force_zero_scaling = true; };
xwayland = {
force_zero_scaling = true;
};
general = {
layout = "dwindle";
@ -134,7 +144,9 @@ in
hover_icon_on_border = false;
};
dwindle = { preserve_split = true; };
dwindle = {
preserve_split = true;
};
input = {
kb_layout = "fr";
@ -294,9 +306,19 @@ in
height = 25;
spacing = 2;
reload-style-on-change = true;
modules-left = [ "cpu" "memory" "disk" "hyprland/window" ];
modules-left = [
"cpu"
"memory"
"disk"
"hyprland/window"
];
modules-center = [ "hyprland/workspaces" ];
modules-right = [ "mpd" "battery" "clock" "tray" ];
modules-right = [
"mpd"
"battery"
"clock"
"tray"
];
tray = {
icon-size = 14;
@ -391,7 +413,11 @@ in
};
home = {
packages = with pkgs.unstable; [ wlr-randr wl-clipboard wdisplays ];
packages = with pkgs.unstable; [
wlr-randr
wl-clipboard
wdisplays
];
};
programs.swaylock = {

View file

@ -1,18 +1,30 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let cfg = config.modules.desktop.zsh;
in {
options.modules.desktop.zsh = { enable = lib.my.mkBoolOpt false; };
let
cfg = config.modules.desktop.zsh;
in
{
options.modules.desktop.zsh = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
environment.pathsToLink = [ "/share/zsh" ];
programs.zsh.enable = true;
users.users.${config.user.name} = { shell = pkgs.zsh; };
users.users.${config.user.name} = {
shell = pkgs.zsh;
};
home-manager.users.${config.user.name} = {
programs.zsh = {
programs = {
zsh = {
enable = true;
history = {
save = 50000;
@ -21,7 +33,8 @@ in {
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = /*bash*/''
initExtra = # bash
''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
@ -31,7 +44,11 @@ in {
'';
oh-my-zsh = {
enable = true;
plugins = [ "git" "terraform" "systemd" ];
plugins = [
"git"
"terraform"
"systemd"
];
};
plugins = [
{
@ -44,11 +61,11 @@ in {
}
];
};
programs.thefuck = {
thefuck = {
enable = true;
enableZshIntegration = true;
};
programs.starship = {
starship = {
enable = true;
enableZshIntegration = true;
settings = {
@ -57,11 +74,22 @@ in {
min_time = 0;
show_milliseconds = true;
};
scala = { symbol = " "; };
terraform = { symbol = "󱁢 "; };
nix_shell = { symbol = "󱄅 "; };
nodejs = { symbol = " "; };
php = { symbol = " "; };
scala = {
symbol = " ";
};
terraform = {
symbol = "󱁢 ";
};
nix_shell = {
symbol = "󱄅 ";
};
nodejs = {
symbol = " ";
};
php = {
symbol = " ";
};
};
};
};
};

View file

@ -1,73 +1,93 @@
{ inputs, config, lib, pkgs, ... }:
{
inputs,
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.editor.emacs;
in {
options.modules.editor.emacs = { enable = mkBoolOpt false; };
let
cfg = config.modules.editor.emacs;
in
{
options.modules.editor.emacs = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
home.packages = with pkgs.unstable; [
binutils
ripgrep
fd
findutils.locate
python311
libsecret
gcc
gnumake
cmake
nodejs
home = {
packages = [
pkgs.unstable.binutils
pkgs.unstable.ripgrep
pkgs.unstable.fd
pkgs.unstable.findutils.locate
pkgs.unstable.python311
pkgs.unstable.libsecret
pkgs.unstable.gcc
pkgs.unstable.gnumake
pkgs.unstable.cmake
pkgs.unstable.nodejs
opentofu
pandoc
pkgs.unstable.opentofu
pkgs.unstable.pandoc
# Formatters and linters
nixfmt-rfc-style # nix formatter
nixpkgs-fmt
shfmt # sh formatter
shellcheck # sh linter
html-tidy # HTML formatter
nodePackages.stylelint # CSS linter
nodePackages.js-beautify # JS/CSS/HTML formatter
pkgs.unstable.nixfmt-rfc-style # nix formatter
pkgs.unstable.nixpkgs-fmt
pkgs.unstable.shfmt # sh formatter
pkgs.unstable.shellcheck # sh linter
pkgs.unstable.html-tidy # HTML formatter
pkgs.unstable.nodePackages.stylelint # CSS linter
pkgs.unstable.nodePackages.js-beautify # JS/CSS/HTML formatter
# LSPs
coursier
pkgs.unstable.coursier
# metals # Scala
# Nix
nil
pkgs.unstable.nil
pkgs.phpactor # PHP
#OCaml
ocaml
dune_3
ocamlPackages.ocaml-lsp
ocamlPackages.ocamlformat
ocamlPackages.utop
ocamlPackages.ocp-indent
ocamlPackages.merlin
pkgs.unstable.ocaml
pkgs.unstable.dune_3
pkgs.unstable.ocamlPackages.ocaml-lsp
pkgs.unstable.ocamlPackages.ocamlformat
pkgs.unstable.ocamlPackages.utop
pkgs.unstable.ocamlPackages.ocp-indent
pkgs.unstable.ocamlPackages.merlin
# Used by org-roam
sqlite
graphviz
pkgs.unstable.sqlite
pkgs.unstable.graphviz
# Used by elfeed-tube
yt-dlp
mpv
pkgs.unstable.yt-dlp
pkgs.unstable.mpv
# Used by dirvish
imagemagick
ffmpegthumbnailer
mediainfo
poppler
gnutar
unzip
pkgs.unstable.imagemagick
pkgs.unstable.ffmpegthumbnailer
pkgs.unstable.mediainfo
pkgs.unstable.poppler
pkgs.unstable.gnutar
pkgs.unstable.unzip
];
sessionPath = [ "${config.home-manager.users.${config.user.name}.xdg.configHome}/emacs/bin" ];
activation = {
installDoomEmacs = ''
if [ ! -d "${config.home-manager.users.${config.user.name}.xdg.configHome}/emacs" ]; then
git clone --depth=1 --single-branch https://github.com/doomemacs/doomemacs "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs"
fi
'';
};
};
services.emacs = {
enable = true;
@ -83,29 +103,17 @@ in {
withTreeSitter = true;
withWebP = true;
};
extraPackages = epkgs:
with epkgs; [
extraPackages =
epkgs: with epkgs; [
vterm
pdf-tools
treesit-grammars.with-all-grammars
];
};
xdg.configFile = { "doom" = { source = ./doom.d; }; };
home.sessionPath = [
"${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs/bin"
];
home.activation = {
installDoomEmacs = ''
if [ ! -d "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs" ]; then
git clone --depth=1 --single-branch https://github.com/doomemacs/doomemacs "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs"
fi
'';
xdg.configFile = {
"doom" = {
source = ./doom.d;
};
};
};
};

View file

@ -1,12 +1,19 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.hardware.audio;
in {
options.modules.hardware.audio = { enable = mkBoolOpt false; };
let
cfg = config.modules.hardware.audio;
in
{
options.modules.hardware.audio = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
sound.enable = true;
security.rtkit.enable = true;

View file

@ -1,24 +1,29 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media.emulators;
in {
let
cfg = config.modules.media.emulators;
in
{
options.modules.media.emulators = {
psx.enable = mkBoolOpt false; # Playstation
ds.enable = mkBoolOpt false; # Nintendo DS
gc.enable = mkBoolOpt false; # GameCube
gb.enable = mkBoolOpt false; # GameBoy + GameBoy Color
gba.enable = mkBoolOpt false; # GameBoy Advance
snes.enable = mkBoolOpt false; # Super Nintendo
psx.enable = lib.my.mkBoolOpt false; # Playstation
ds.enable = lib.my.mkBoolOpt false; # Nintendo DS
gc.enable = lib.my.mkBoolOpt false; # GameCube
gb.enable = lib.my.mkBoolOpt false; # GameBoy + GameBoy Color
gba.enable = lib.my.mkBoolOpt false; # GameBoy Advance
snes.enable = lib.my.mkBoolOpt false; # Super Nintendo
};
config = {
user.packages = with pkgs; [
(mkIf cfg.psx.enable duckstation)
(mkIf cfg.ds.enable desmume)
(mkIf cfg.gc.enable dolphinEmu)
(mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) higan)
user.packages = [
(lib.mkIf cfg.psx.enable pkgs.duckstation)
(lib.mkIf cfg.ds.enable pkgs.desmume)
(lib.mkIf cfg.gc.enable pkgs.dolphinEmu)
(lib.mkIf (cfg.gba.enable || cfg.gb.enable || cfg.snes.enable) pkgs.higan)
];
};
}

View file

@ -1,20 +1,25 @@
{ options, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media;
in {
let
cfg = config.modules.media;
in
{
options.modules.media = {
steam.enable = mkBoolOpt false;
lutris.enable = mkBoolOpt false;
steam.enable = lib.my.mkBoolOpt false;
lutris.enable = lib.my.mkBoolOpt false;
};
config = {
user.packages = with pkgs; [
(mkIf cfg.steam.enable steam)
(mkIf cfg.lutris.enable lutris)
(mkIf cfg.lutris.enable wine)
(mkIf (cfg.steam.enable || cfg.lutris.enable) protontricks)
user.packages = [
(lib.mkIf cfg.steam.enable pkgs.steam)
(lib.mkIf cfg.lutris.enable pkgs.lutris)
(lib.mkIf cfg.lutris.enable pkgs.wine)
(lib.mkIf (cfg.steam.enable || cfg.lutris.enable) pkgs.protontricks)
];
};
}

View file

@ -1,12 +1,16 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
with lib;
with lib.my;
let cfg = config.modules.media.mpd;
in {
options.modules.media.mpd = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
let
cfg = config.modules.media.mpd;
in
{
options.modules.media.mpd = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
services.mpd = {
enable = true;
network.listenAddress = "any";

View file

@ -1,12 +1,19 @@
{ inputs, config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let cfg = config.modules.media.ncmpcpp;
in {
options.modules.media.ncmpcpp = { enable = mkBoolOpt false; };
let
cfg = config.modules.media.ncmpcpp;
in
{
options.modules.media.ncmpcpp = {
enable = lib.my.mkBoolOpt false;
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} = {
home = {

View file

@ -1,19 +1,28 @@
{ config, options, lib, home-manager, ... }:
{
config,
options,
lib,
...
}:
with lib;
with lib.my; {
options = with types; { user = mkOpt attrs { }; };
{
options = {
user = lib.my.mkOpt lib.types.attrs { };
};
config = {
user = {
name = "froidmpa";
description = "The primary user account";
extraGroups = [ "wheel" "adbusers" ];
extraGroups = [
"wheel"
"adbusers"
];
isNormalUser = true;
};
users.users.${config.user.name} = mkAliasDefinitions options.user;
users.users.${config.user.name} = lib.mkAliasDefinitions options.user;
home-manager = {
useUserPackages = true;
@ -21,7 +30,7 @@ with lib.my; {
users.${config.user.name} = {
home = {
enableNixpkgsReleaseCheck = true;
stateVersion = config.system.stateVersion;
inherit (config.system) stateVersion;
};
};
};

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.belgian-eid;
in
{
options.modules.services.belgian-eid = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.belgian-eid;
in {
options.modules.services.belgian-eid = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.pcscd.enable = true;

View file

@ -1,19 +1,25 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.docker;
in
{
options.modules.services.docker = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.docker;
in {
options.modules.services.docker = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
virtualisation = {
docker = {
enable = true;
autoPrune.enable = true;
enableOnBoot = mkDefault false;
enableOnBoot = lib.mkDefault false;
};
};

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.flatpak;
in
{
options.modules.services.flatpak = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.flatpak;
in {
options.modules.services.flatpak = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.flatpak.enable = true;
xdg.portal = {

View file

@ -1,13 +1,14 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
with lib;
with lib.my;
let
cfg = config.modules.services.languagetool;
in
{
options.modules.services.languagetool = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.languagetool;
in {
options.modules.services.languagetool = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.languagetool = {
enable = true;
allowOrigin = "*";

View file

@ -1,13 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
with lib;
with lib.my;
let
cfg = config.modules.services.libvirt;
in
{
options.modules.services.libvirt = {
enable = lib.my.mkBoolOpt false;
};
let cfg = config.modules.services.libvirt;
in {
options.modules.services.libvirt = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
virtualisation = {
libvirtd.enable = true;

View file

@ -1,3 +1 @@
final: prev: {
activitywatch-bin = prev.callPackage ./packages/activitywatch.nix { };
}
final: prev: { activitywatch-bin = prev.callPackage ./packages/activitywatch.nix { }; }

View file

@ -1,12 +1,13 @@
{ lib
, stdenv
, fetchzip
, autoPatchelfHook
, libGL
, freetype
, libdrm
, fontconfig
, harfbuzz
{
lib,
stdenv,
fetchzip,
autoPatchelfHook,
libGL,
freetype,
libdrm,
fontconfig,
harfbuzz,
}:
stdenv.mkDerivation rec {
@ -18,7 +19,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-4lfUxJTBpjrsRO+pmW7DNKV69tMr2wiarA5Fy4wPgMk=";
};
nativeBuildInputs = [ autoPatchelfHook libGL freetype libdrm fontconfig harfbuzz ];
nativeBuildInputs = [
autoPatchelfHook
libGL
freetype
libdrm
fontconfig
harfbuzz
];
installPhase = ''
mkdir -p $out/bin
cp -r * $out/