Update formatter
This commit is contained in:
parent
72483ad795
commit
3a154a8225
|
@ -1,6 +1,18 @@
|
||||||
{ pkgs, config, lib, ... }:
|
|
||||||
{
|
{
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
@ -45,7 +57,7 @@
|
||||||
|
|
||||||
hwAccelerationGPU = "intel";
|
hwAccelerationGPU = "intel";
|
||||||
|
|
||||||
/* System secrets */
|
# System secrets
|
||||||
sops = {
|
sops = {
|
||||||
gnupg.sshKeyPaths = [ ];
|
gnupg.sshKeyPaths = [ ];
|
||||||
age = {
|
age = {
|
||||||
|
|
|
@ -48,11 +48,11 @@
|
||||||
|
|
||||||
services.jackett = {
|
services.jackett = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.jackett.overrideAttrs(_: _: { doCheck = false; });
|
package = pkgs.jackett.overrideAttrs (_: _: { doCheck = false; });
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.delugedweb.requires = ["deluged-proxy.service"];
|
systemd.services.delugedweb.requires = [ "deluged-proxy.service" ];
|
||||||
systemd.services.deluged.bindsTo = [ "wireguard-wg1.service" ];
|
systemd.services.deluged.bindsTo = [ "wireguard-wg1.service" ];
|
||||||
systemd.services.deluged.requires = [ "network-online.target" ];
|
systemd.services.deluged.requires = [ "network-online.target" ];
|
||||||
systemd.services.deluged.serviceConfig.NetworkNamespacePath = "/var/run/netns/wg1ns";
|
systemd.services.deluged.serviceConfig.NetworkNamespacePath = "/var/run/netns/wg1ns";
|
||||||
|
@ -66,8 +66,14 @@
|
||||||
|
|
||||||
systemd.services.deluged-proxy = {
|
systemd.services.deluged-proxy = {
|
||||||
description = "Proxy for deluge-web to deluged in network namespace";
|
description = "Proxy for deluge-web to deluged in network namespace";
|
||||||
requires = [ "deluged.service" "deluged-proxy.socket" ];
|
requires = [
|
||||||
after = [ "deluged.service" "deluged-proxy.socket" ];
|
"deluged.service"
|
||||||
|
"deluged-proxy.socket"
|
||||||
|
];
|
||||||
|
after = [
|
||||||
|
"deluged.service"
|
||||||
|
"deluged-proxy.socket"
|
||||||
|
];
|
||||||
unitConfig.JoinsNamespaceOf = "deluged.service";
|
unitConfig.JoinsNamespaceOf = "deluged.service";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "deluge";
|
User = "deluge";
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
hostName = extraInfo.nextcloudURI;
|
hostName = extraInfo.nextcloudURI;
|
||||||
|
|
||||||
extraAppsEnable = true;
|
extraAppsEnable = true;
|
||||||
extraApps = {};
|
extraApps = { };
|
||||||
|
|
||||||
database.createLocally = true;
|
database.createLocally = true;
|
||||||
configureRedis = true;
|
configureRedis = true;
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
{ config, pkgs, extraInfo, ... }:
|
|
||||||
{
|
{
|
||||||
networking.firewall.allowedUDPPorts = [
|
config,
|
||||||
51821
|
pkgs,
|
||||||
];
|
extraInfo,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
networking.firewall.allowedUDPPorts = [ 51821 ];
|
||||||
|
|
||||||
/* Wireguard */
|
# Wireguard
|
||||||
networking.wireguard.interfaces.wg0 = {
|
networking.wireguard.interfaces.wg0 = {
|
||||||
ips = [ "10.100.0.6/8" ];
|
ips = [ "10.100.0.6/8" ];
|
||||||
|
|
||||||
|
@ -52,7 +55,6 @@
|
||||||
ip netns exec wg1ns ip link set lo up
|
ip netns exec wg1ns ip link set lo up
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
postShutdown = ''
|
postShutdown = ''
|
||||||
ip netns del wg1ns
|
ip netns del wg1ns
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -1,16 +1,27 @@
|
||||||
{ pkgs, config, lib, extraInfo, ... }:
|
|
||||||
{
|
{
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ];
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
extraInfo,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usbhid"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
||||||
/* Meta */
|
# Meta
|
||||||
isProfessional = false;
|
isProfessional = false;
|
||||||
|
|
||||||
/* Volumes */
|
# Volumes
|
||||||
luksDevices = [
|
luksDevices = [
|
||||||
{
|
{
|
||||||
name = "crypted-nixos";
|
name = "crypted-nixos";
|
||||||
|
@ -47,25 +58,24 @@
|
||||||
|
|
||||||
swapDeviceUUID = "5fe5e76b-df3d-43ce-abf9-d2b63078df09";
|
swapDeviceUUID = "5fe5e76b-df3d-43ce-abf9-d2b63078df09";
|
||||||
|
|
||||||
|
# Linux kernel
|
||||||
/* Linux kernel */
|
|
||||||
useLatestKernel = true;
|
useLatestKernel = true;
|
||||||
|
|
||||||
/* Custom udev rules for Nucleo's stlink interface */
|
# Custom udev rules for Nucleo's stlink interface
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b",MODE="660",GROUP="dialout",TAG+="uaccess"
|
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b",MODE="660",GROUP="dialout",TAG+="uaccess"
|
||||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748",MODE="660",GROUP="dialout",TAG+="uaccess"
|
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748",MODE="660",GROUP="dialout",TAG+="uaccess"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
/* Nix */
|
# Nix
|
||||||
allowUnfreePackages = true;
|
allowUnfreePackages = true;
|
||||||
|
|
||||||
/* Hardware acceleration */
|
# Hardware acceleration
|
||||||
hwAccelerationGPU = "amd";
|
hwAccelerationGPU = "amd";
|
||||||
|
|
||||||
keymap = "fr";
|
keymap = "fr";
|
||||||
|
|
||||||
/* System secrets */
|
# System secrets
|
||||||
sops = {
|
sops = {
|
||||||
gnupg.sshKeyPaths = [ ];
|
gnupg.sshKeyPaths = [ ];
|
||||||
age = {
|
age = {
|
||||||
|
@ -76,7 +86,7 @@
|
||||||
secrets.wg0_private = { };
|
secrets.wg0_private = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Wireguard */
|
# Wireguard
|
||||||
networking.wg-quick.interfaces.wg0 = {
|
networking.wg-quick.interfaces.wg0 = {
|
||||||
address = [ "10.100.0.4/8" ];
|
address = [ "10.100.0.4/8" ];
|
||||||
dns = [ "10.100.0.1" ];
|
dns = [ "10.100.0.1" ];
|
||||||
|
@ -103,11 +113,20 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* User config */
|
# User config
|
||||||
machineUsers = {
|
machineUsers = {
|
||||||
dala = {
|
dala = {
|
||||||
description = "Dala";
|
description = "Dala";
|
||||||
groups = [ "wheel" "video" "audio" "seat" "keys" "lp" "dialout" "network" ];
|
groups = [
|
||||||
|
"wheel"
|
||||||
|
"video"
|
||||||
|
"audio"
|
||||||
|
"seat"
|
||||||
|
"keys"
|
||||||
|
"lp"
|
||||||
|
"dialout"
|
||||||
|
"network"
|
||||||
|
];
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
enableHomeManagerProfile = true;
|
enableHomeManagerProfile = true;
|
||||||
|
|
48
flake.nix
48
flake.nix
|
@ -23,18 +23,24 @@
|
||||||
extra-config.url = "git+ssh://git@git.sr.ht/~dala/extra-config";
|
extra-config.url = "git+ssh://git@git.sr.ht/~dala/extra-config";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager, sops-nix, flake-utils, extra-config }:
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
nixpkgs-stable,
|
||||||
|
home-manager,
|
||||||
|
sops-nix,
|
||||||
|
flake-utils,
|
||||||
|
extra-config,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
machines = import ./machines.nix;
|
machines = import ./machines.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = builtins.mapAttrs
|
nixosConfigurations = builtins.mapAttrs (
|
||||||
(name: value:
|
name: value:
|
||||||
let
|
let
|
||||||
nixpkgs =
|
nixpkgs = if value.nixpkgsUnstable then nixpkgs-unstable else nixpkgs-stable;
|
||||||
if value.nixpkgsUnstable
|
|
||||||
then nixpkgs-unstable
|
|
||||||
else nixpkgs-stable;
|
|
||||||
in
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
system = value.system;
|
system = value.system;
|
||||||
|
@ -52,26 +58,24 @@
|
||||||
modules = [
|
modules = [
|
||||||
./configurations/${name}
|
./configurations/${name}
|
||||||
./modules/common
|
./modules/common
|
||||||
(if (value.machineType == "workstation")
|
(if (value.machineType == "workstation") then ./modules/workstation else ./modules/server)
|
||||||
then ./modules/workstation
|
(
|
||||||
else ./modules/server)
|
if (value.machineType == "workstation" && value.enableHomeManager) then
|
||||||
(if (value.machineType == "workstation" && value.enableHomeManager)
|
home-manager.nixosModules.home-manager
|
||||||
then home-manager.nixosModules.home-manager
|
else
|
||||||
else { })
|
{ }
|
||||||
|
)
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
)
|
) machines;
|
||||||
machines;
|
|
||||||
|
|
||||||
formatter = builtins.listToAttrs (map
|
formatter = builtins.listToAttrs (
|
||||||
(system:
|
map (system: {
|
||||||
{
|
|
||||||
name = system;
|
name = system;
|
||||||
value = nixpkgs-unstable.legacyPackages.${system}.nixpkgs-fmt;
|
value = nixpkgs-unstable.legacyPackages.${system}.nixfmt-rfc-style;
|
||||||
}
|
}) flake-utils.lib.defaultSystems
|
||||||
)
|
);
|
||||||
flake-utils.lib.defaultSystems);
|
|
||||||
|
|
||||||
hydraJobs = {
|
hydraJobs = {
|
||||||
nixos = builtins.mapAttrs (_: cfg: cfg.config.system.build.toplevel) self.nixosConfigurations;
|
nixos = builtins.mapAttrs (_: cfg: cfg.config.system.build.toplevel) self.nixosConfigurations;
|
||||||
|
|
|
@ -46,15 +46,15 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
boot.initrd.luks.devices = builtins.listToAttrs (map
|
boot.initrd.luks.devices = builtins.listToAttrs (
|
||||||
(fs: {
|
map (fs: {
|
||||||
name = fs.name;
|
name = fs.name;
|
||||||
value = {
|
value = {
|
||||||
device = "/dev/disk/by-uuid/${fs.deviceUUID}";
|
device = "/dev/disk/by-uuid/${fs.deviceUUID}";
|
||||||
preLVM = fs.isPreLVM;
|
preLVM = fs.isPreLVM;
|
||||||
};
|
};
|
||||||
})
|
}) config.luksDevices
|
||||||
config.luksDevices);
|
);
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = config.enableDefaultSystemdBoot;
|
boot.loader.systemd-boot.enable = config.enableDefaultSystemdBoot;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
{ lib, config, pkgs, machineInfos, modulesPath, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
machineInfos,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -13,7 +20,10 @@ with lib;
|
||||||
];
|
];
|
||||||
|
|
||||||
options.machineType = mkOption {
|
options.machineType = mkOption {
|
||||||
type = types.enum [ "workstation" "server" ];
|
type = types.enum [
|
||||||
|
"workstation"
|
||||||
|
"server"
|
||||||
|
];
|
||||||
default = "workstation";
|
default = "workstation";
|
||||||
example = "server";
|
example = "server";
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -46,7 +56,9 @@ with lib;
|
||||||
virtualisation.docker.enable = config.enableDocker;
|
virtualisation.docker.enable = config.enableDocker;
|
||||||
|
|
||||||
# Only enable fish shell if there is at least one user using it.
|
# Only enable fish shell if there is at least one user using it.
|
||||||
programs.fish.enable = builtins.any (user: user.shell == pkgs.fish) (builtins.attrValues config.machineUsers);
|
programs.fish.enable = builtins.any (user: user.shell == pkgs.fish) (
|
||||||
|
builtins.attrValues config.machineUsers
|
||||||
|
);
|
||||||
|
|
||||||
# We always want to disable the X server as only workstation use windows manager
|
# We always want to disable the X server as only workstation use windows manager
|
||||||
# and they always use wayland.
|
# and they always use wayland.
|
||||||
|
|
|
@ -24,7 +24,6 @@ let
|
||||||
The volume filesystem.
|
The volume filesystem.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -50,15 +49,15 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
fileSystems = builtins.listToAttrs (map
|
fileSystems = builtins.listToAttrs (
|
||||||
(fs: {
|
map (fs: {
|
||||||
name = fs.mountpoint;
|
name = fs.mountpoint;
|
||||||
value = {
|
value = {
|
||||||
device = "/dev/disk/by-uuid/${fs.deviceUUID}";
|
device = "/dev/disk/by-uuid/${fs.deviceUUID}";
|
||||||
fsType = fs.fsType;
|
fsType = fs.fsType;
|
||||||
};
|
};
|
||||||
})
|
}) config.filesystems
|
||||||
config.filesystems);
|
);
|
||||||
|
|
||||||
swapDevices = mkIf (config.swapDeviceUUID != null) [
|
swapDevices = mkIf (config.swapDeviceUUID != null) [
|
||||||
{ device = "/dev/disk/by-uuid/${config.swapDeviceUUID}"; }
|
{ device = "/dev/disk/by-uuid/${config.swapDeviceUUID}"; }
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.hwAccelerationGPU = mkOption {
|
options.hwAccelerationGPU = mkOption {
|
||||||
type = types.nullOr (types.enum [ "nvidia" "intel" "amd" ]);
|
type = types.nullOr (
|
||||||
|
types.enum [
|
||||||
|
"nvidia"
|
||||||
|
"intel"
|
||||||
|
"amd"
|
||||||
|
]
|
||||||
|
);
|
||||||
default = null;
|
default = null;
|
||||||
example = "nvidia";
|
example = "nvidia";
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -11,9 +22,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
boot.kernelParams = mkIf (config.hwAccelerationGPU == "intel") [
|
boot.kernelParams = mkIf (config.hwAccelerationGPU == "intel") [ "i915.enable_guc=2" ];
|
||||||
"i915.enable_guc=2"
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = config.hwAccelerationGPU != null;
|
enable = config.hwAccelerationGPU != null;
|
||||||
|
@ -30,8 +39,6 @@ with lib;
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers = mkIf (config.hwAccelerationGPU == "nvidia") [
|
services.xserver.videoDrivers = mkIf (config.hwAccelerationGPU == "nvidia") [ "nouveau" ];
|
||||||
"nouveau"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.useLatestKernel = mkOption {
|
options.useLatestKernel = mkOption {
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.allowUnfreePackages = mkOption {
|
options.allowUnfreePackages = mkOption {
|
||||||
|
|
|
@ -3,48 +3,34 @@ with lib;
|
||||||
let
|
let
|
||||||
userModule = types.submodule {
|
userModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
description = mkOption {
|
description = mkOption { type = types.str; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
groups = mkOption {
|
groups = mkOption { type = types.listOf types.str; };
|
||||||
type = types.listOf types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
uid = mkOption {
|
uid = mkOption { type = types.nullOr types.int; };
|
||||||
type = types.nullOr types.int;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = mkOption {
|
shell = mkOption { type = types.package; };
|
||||||
type = types.package;
|
|
||||||
};
|
|
||||||
|
|
||||||
enableHomeManagerProfile = mkOption {
|
enableHomeManagerProfile = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerConfig = mkOption {
|
homeManagerConfig = mkOption { default = { }; };
|
||||||
default = { };
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.machineUsers = mkOption {
|
options.machineUsers = mkOption { type = types.attrsOf userModule; };
|
||||||
type = types.attrsOf userModule;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
users.users = builtins.mapAttrs
|
users.users = builtins.mapAttrs (name: value: {
|
||||||
(name: value: {
|
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/home/${name}";
|
home = "/home/${name}";
|
||||||
description = value.description;
|
description = value.description;
|
||||||
extraGroups = value.groups;
|
extraGroups = value.groups;
|
||||||
shell = value.shell;
|
shell = value.shell;
|
||||||
uid = mkIf (value.uid != null) value.uid;
|
uid = mkIf (value.uid != null) value.uid;
|
||||||
})
|
}) config.machineUsers;
|
||||||
config.machineUsers;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
{ lib, config, pkgs, machineInfos, sopsHmModule, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
machineInfos,
|
||||||
|
sopsHmModule,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -30,18 +37,20 @@ with lib;
|
||||||
keymap = config.keymap;
|
keymap = config.keymap;
|
||||||
nvidiaGPU = (config.hwAccelerationGPU == "nvidia");
|
nvidiaGPU = (config.hwAccelerationGPU == "nvidia");
|
||||||
};
|
};
|
||||||
home-manager.users = builtins.mapAttrs
|
home-manager.users = builtins.mapAttrs (
|
||||||
(name: value:
|
name: value:
|
||||||
mkIf value.enableHomeManagerProfile ({
|
mkIf value.enableHomeManagerProfile (
|
||||||
|
{
|
||||||
home.username = name;
|
home.username = name;
|
||||||
home.homeDirectory = "/home/${name}";
|
home.homeDirectory = "/home/${name}";
|
||||||
home.stateVersion = machineInfos.stateVersion;
|
home.stateVersion = machineInfos.stateVersion;
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
enableFishShell = value.shell == pkgs.fish;
|
enableFishShell = value.shell == pkgs.fish;
|
||||||
isProfessional = config.isProfessional;
|
isProfessional = config.isProfessional;
|
||||||
} // value.homeManagerConfig)
|
}
|
||||||
|
// value.homeManagerConfig
|
||||||
)
|
)
|
||||||
config.machineUsers;
|
) config.machineUsers;
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
usersHasSway = builtins.any
|
usersHasSway = builtins.any (user: config.home-manager.users.${user}.desktop.enableSwayStack) (
|
||||||
(user:
|
builtins.attrNames config.machineUsers
|
||||||
config.home-manager.users.${user}.desktop.enableSwayStack
|
);
|
||||||
)
|
|
||||||
(builtins.attrNames config.machineUsers);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.sway = mkIf usersHasSway {
|
programs.sway = mkIf usersHasSway {
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -28,9 +33,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config.home.packages = with pkgs; [
|
config.home.packages = with pkgs; [
|
||||||
(mkIf config.communication.discord.enable (discord.override {
|
(mkIf config.communication.discord.enable (discord.override { nss = nss_latest; }))
|
||||||
nss = nss_latest;
|
|
||||||
}))
|
|
||||||
(mkIf config.communication.slack.enable slack)
|
(mkIf config.communication.slack.enable slack)
|
||||||
(mkIf config.communication.weechat.enable weechat)
|
(mkIf config.communication.weechat.enable weechat)
|
||||||
(mkIf config.communication.matrix.enable element)
|
(mkIf config.communication.matrix.enable element)
|
||||||
|
|
|
@ -18,7 +18,6 @@ let
|
||||||
yubico-pam
|
yubico-pam
|
||||||
yubikey-manager
|
yubikey-manager
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -33,15 +32,15 @@ in
|
||||||
./helix.nix
|
./helix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.isProfessional = mkOption {
|
options.isProfessional = mkOption { type = types.bool; };
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
htop
|
htop
|
||||||
firefox
|
firefox
|
||||||
autojump
|
autojump
|
||||||
|
@ -53,7 +52,8 @@ in
|
||||||
zathura
|
zathura
|
||||||
lazygit
|
lazygit
|
||||||
easyeffects
|
easyeffects
|
||||||
] ++ multimediaPackages
|
]
|
||||||
|
++ multimediaPackages
|
||||||
++ soundPackages
|
++ soundPackages
|
||||||
++ yubikeyTools;
|
++ yubikeyTools;
|
||||||
|
|
||||||
|
@ -70,5 +70,4 @@ in
|
||||||
"text/html" = "firefox.desktop";
|
"text/html" = "firefox.desktop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
desktopPackages = with pkgs; [
|
desktopPackages = with pkgs; [
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
{ config, pkgs, lib, keymap, nvidiaGPU, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
keymap,
|
||||||
|
nvidiaGPU,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
isQwerty = keymap == "us";
|
isQwerty = keymap == "us";
|
||||||
|
@ -6,26 +13,16 @@ let
|
||||||
rendererLine = if nvidiaGPU then "export WLR_RENDERER=vulkan" else "";
|
rendererLine = if nvidiaGPU then "export WLR_RENDERER=vulkan" else "";
|
||||||
monitorModule = types.submodule {
|
monitorModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption { type = types.str; };
|
||||||
type = types.str;
|
resolution = mkOption { type = types.str; };
|
||||||
};
|
position = mkOption { type = types.str; };
|
||||||
resolution = mkOption {
|
defaultWorkspace = mkOption { type = types.int; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
position = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
defaultWorkspace = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
desktop.monitors = mkOption {
|
desktop.monitors = mkOption { type = types.listOf monitorModule; };
|
||||||
type = types.listOf monitorModule;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config.wayland.windowManager.sway = mkIf config.desktop.enableSwayStack {
|
config.wayland.windowManager.sway = mkIf config.desktop.enableSwayStack {
|
||||||
|
@ -65,24 +62,23 @@ in
|
||||||
"xcursor_theme" = "Nordzy-cursors";
|
"xcursor_theme" = "Nordzy-cursors";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
output = builtins.listToAttrs
|
output =
|
||||||
(builtins.map
|
builtins.listToAttrs (
|
||||||
(monitor: {
|
builtins.map (monitor: {
|
||||||
name = monitor.name;
|
name = monitor.name;
|
||||||
value = {
|
value = {
|
||||||
resolution = monitor.resolution;
|
resolution = monitor.resolution;
|
||||||
position = monitor.position;
|
position = monitor.position;
|
||||||
};
|
};
|
||||||
})
|
}) config.desktop.monitors
|
||||||
config.desktop.monitors) // {
|
)
|
||||||
|
// {
|
||||||
"*".bg = "/home/dala/Perso/wallpapers/tanuki.jpg fill";
|
"*".bg = "/home/dala/Perso/wallpapers/tanuki.jpg fill";
|
||||||
};
|
};
|
||||||
workspaceOutputAssign = map
|
workspaceOutputAssign = map (monitor: {
|
||||||
(monitor: {
|
|
||||||
output = monitor.name;
|
output = monitor.name;
|
||||||
workspace = builtins.toString monitor.defaultWorkspace;
|
workspace = builtins.toString monitor.defaultWorkspace;
|
||||||
})
|
}) config.desktop.monitors;
|
||||||
config.desktop.monitors;
|
|
||||||
startup = [
|
startup = [
|
||||||
{
|
{
|
||||||
command = ''
|
command = ''
|
||||||
|
@ -134,9 +130,7 @@ in
|
||||||
modifier = "${modifier} normal";
|
modifier = "${modifier} normal";
|
||||||
};
|
};
|
||||||
|
|
||||||
bars = [{
|
bars = [ { command = "${pkgs.waybar}/bin/waybar"; } ];
|
||||||
command = "${pkgs.waybar}/bin/waybar";
|
|
||||||
}];
|
|
||||||
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"${modifier}+Return" = "exec ${terminal}";
|
"${modifier}+Return" = "exec ${terminal}";
|
||||||
|
@ -218,8 +212,8 @@ in
|
||||||
|
|
||||||
"${modifier}+r" = "mode resize";
|
"${modifier}+r" = "mode resize";
|
||||||
|
|
||||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; #increase sound volume
|
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume 0 +5%"; # increase sound volume
|
||||||
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; #decrease sound volume
|
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume 0 -5%"; # decrease sound volume
|
||||||
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; # mute sound
|
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute 0 toggle"; # mute sound
|
||||||
|
|
||||||
"XF86MonBrightnessUp" = "exec --no-startup-id light -A 10";
|
"XF86MonBrightnessUp" = "exec --no-startup-id light -A 10";
|
||||||
|
|
|
@ -5,7 +5,8 @@ with lib;
|
||||||
enable = true;
|
enable = true;
|
||||||
#systemd.enable = false;
|
#systemd.enable = false;
|
||||||
|
|
||||||
settings = [{
|
settings = [
|
||||||
|
{
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 30;
|
height = 30;
|
||||||
|
@ -15,9 +16,7 @@ with lib;
|
||||||
"sway/mode"
|
"sway/mode"
|
||||||
];
|
];
|
||||||
|
|
||||||
modules-center = [
|
modules-center = [ "sway/window" ];
|
||||||
"sway/window"
|
|
||||||
];
|
|
||||||
|
|
||||||
modules-right = [
|
modules-right = [
|
||||||
"memory"
|
"memory"
|
||||||
|
@ -134,7 +133,8 @@ with lib;
|
||||||
"format-alt" = "{:%A, %B %d}";
|
"format-alt" = "{:%A, %B %d}";
|
||||||
"tooltip-format" = "<big>{:%Y %B}</big>\n<tt>{calendar}</tt>";
|
"tooltip-format" = "<big>{:%Y %B}</big>\n<tt>{calendar}</tt>";
|
||||||
};
|
};
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
|
|
||||||
style = ''
|
style = ''
|
||||||
@keyframes blink-warning {
|
@keyframes blink-warning {
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ pkgs, config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
programs.wofi = mkIf config.desktop.enableSwayStack {
|
programs.wofi = mkIf config.desktop.enableSwayStack {
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ ./embedded.nix ];
|
||||||
./embedded.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options.development.enableGit = mkOption {
|
options.development.enableGit = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.development.embedded.enableTools = mkOption {
|
options.development.embedded.enableTools = mkOption {
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.enableFishShell = mkOption {
|
options.enableFishShell = mkOption { type = types.bool; };
|
||||||
type = types.bool;
|
|
||||||
};
|
|
||||||
|
|
||||||
config.programs.fish = mkIf config.enableFishShell {
|
config.programs.fish = mkIf config.enableFishShell {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.enableGPGKeyring = mkOption {
|
options.enableGPGKeyring = mkOption {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
programs.helix.settings = mkIf config.programs.helix.enable {
|
programs.helix.settings = mkIf config.programs.helix.enable { theme = "nord"; };
|
||||||
theme = "nord";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
mailAccountModule = types.submodule {
|
mailAccountModule = types.submodule {
|
||||||
|
@ -7,21 +12,13 @@ let
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
mailAddress = mkOption {
|
mailAddress = mkOption { type = types.str; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
mailPasswdEval = mkOption {
|
mailPasswdEval = mkOption { type = types.str; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
imapHost = mkOption {
|
imapHost = mkOption { type = types.str; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
smtpHost = mkOption {
|
smtpHost = mkOption { type = types.str; };
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultExtraMailboxes = [
|
defaultExtraMailboxes = [
|
||||||
|
@ -50,8 +47,7 @@ in
|
||||||
|
|
||||||
config = mkIf (!hasNoAddress) {
|
config = mkIf (!hasNoAddress) {
|
||||||
|
|
||||||
accounts.email.accounts = builtins.mapAttrs
|
accounts.email.accounts = builtins.mapAttrs (name: value: {
|
||||||
(name: value: {
|
|
||||||
primary = value.isPrimary;
|
primary = value.isPrimary;
|
||||||
address = value.mailAddress;
|
address = value.mailAddress;
|
||||||
userName = value.mailAddress;
|
userName = value.mailAddress;
|
||||||
|
@ -74,15 +70,12 @@ in
|
||||||
neomutt = {
|
neomutt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
mailboxName = "${name}/Inbox";
|
mailboxName = "${name}/Inbox";
|
||||||
extraMailboxes = map
|
extraMailboxes = map (mb: {
|
||||||
(mb: {
|
|
||||||
mailbox = mb;
|
mailbox = mb;
|
||||||
name = "${name}/${mb}";
|
name = "${name}/${mb}";
|
||||||
})
|
}) defaultExtraMailboxes;
|
||||||
defaultExtraMailboxes;
|
|
||||||
};
|
};
|
||||||
})
|
}) config.communication.mailAccounts;
|
||||||
config.communication.mailAccounts;
|
|
||||||
|
|
||||||
services.mbsync.enable = true;
|
services.mbsync.enable = true;
|
||||||
programs.mbsync.enable = true;
|
programs.mbsync.enable = true;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
options.desktop.enableNeovim = mkOption {
|
options.desktop.enableNeovim = mkOption {
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
tmuxExtraConfig = ''
|
tmuxExtraConfig = ''
|
||||||
|
|
Loading…
Reference in a new issue