reformat --> alejandra

This commit is contained in:
Joseph Hanson 2025-03-06 09:51:33 -06:00
parent f4e15b7e90
commit e6e258feeb
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
89 changed files with 875 additions and 901 deletions

View file

@ -11,7 +11,7 @@
profileModules = [ profileModules = [
./nixos/profiles/role-workstation.nix ./nixos/profiles/role-workstation.nix
./nixos/profiles/role-dev.nix ./nixos/profiles/role-dev.nix
{ home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } {home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix;}
]; ];
}; };
@ -24,13 +24,13 @@
inputs.nixos-hardware.nixosModules.lenovo-legion-15arh05h inputs.nixos-hardware.nixosModules.lenovo-legion-15arh05h
./nixos/profiles/hw-legion-15arh05h.nix ./nixos/profiles/hw-legion-15arh05h.nix
disko.nixosModules.disko disko.nixosModules.disko
(import ./nixos/profiles/disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; }) (import ./nixos/profiles/disko-nixos.nix {disks = ["/dev/nvme0n1"];})
]; ];
profileModules = [ profileModules = [
./nixos/profiles/role-dev.nix ./nixos/profiles/role-dev.nix
./nixos/profiles/role-gaming.nix ./nixos/profiles/role-gaming.nix
./nixos/profiles/role-workstation.nix ./nixos/profiles/role-workstation.nix
{ home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix; } {home-manager.users.jahanson = ./nixos/home/jahanson/workstation.nix;}
]; ];
}; };
} }

View file

@ -6,8 +6,7 @@
osConfig, osConfig,
... ...
}: }:
with lib.hm.gvariant; with lib.hm.gvariant; {
{
config = lib.mkIf osConfig.mySystem.de.gnome.enable { config = lib.mkIf osConfig.mySystem.de.gnome.enable {
# add user packages # add user packages
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -23,7 +22,7 @@ with lib.hm.gvariant;
workspaces-only-on-primary = false; workspaces-only-on-primary = false;
}; };
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {
home = [ "<Super>e" ]; home = ["<Super>e"];
}; };
"org/gnome/desktop/wm/preferences" = { "org/gnome/desktop/wm/preferences" = {
workspace-names = [ workspace-names = [

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
config = { config = {
networking.hostId = "ad4380db"; networking.hostId = "ad4380db";
networking.hostName = "durincore"; networking.hostName = "durincore";
@ -12,10 +11,10 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
kernelModules = [ ]; kernelModules = [];
}; };
kernelModules = [ "kvm-intel" ]; kernelModules = ["kvm-intel"];
extraModulePackages = [ ]; extraModulePackages = [];
}; };
fileSystems = { fileSystems = {
@ -39,7 +38,7 @@
}; };
}; };
swapDevices = [ ]; swapDevices = [];
# System settings and services. # System settings and services.
mySystem = { mySystem = {
@ -48,6 +47,5 @@
"wlp4s0" "wlp4s0"
]; ];
}; };
}; };
} }

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
config = { config = {
"core.https_address" = "10.1.1.15:8445"; # Need quotes around key "core.https_address" = "10.1.1.15:8445"; # Need quotes around key
}; };
@ -27,7 +26,7 @@
]; ];
profiles = [ profiles = [
{ {
config = { }; config = {};
description = ""; description = "";
devices = { devices = {
eth0 = { eth0 = {
@ -44,6 +43,6 @@
name = "default"; name = "default";
} }
]; ];
projects = [ ]; projects = [];
cluster = null; cluster = null;
} }

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
global = { global = {
"workgroup" = "WORKGROUP"; "workgroup" = "WORKGROUP";
"server string" = "gandalf"; "server string" = "gandalf";

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
outputs = { outputs = {
# ZFS automated snapshots # ZFS automated snapshots
templates = { templates = {
@ -14,22 +13,22 @@
}; };
datasets = { datasets = {
"eru/xen-backups" = { "eru/xen-backups" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
"eru/hansonhive" = { "eru/hansonhive" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
"eru/tm_joe" = { "eru/tm_joe" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
"eru/tm_elisia" = { "eru/tm_elisia" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
"eru/containers/volumes/xo-data" = { "eru/containers/volumes/xo-data" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
"eru/containers/volumes/xo-redis-data" = { "eru/containers/volumes/xo-redis-data" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
}; };
}; };
}; };

View file

@ -17,7 +17,7 @@
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ../../profiles/disko-nixos.nix { disks = [ "/dev/sda" ]; }) (import ../../profiles/disko-nixos.nix {disks = ["/dev/sda"];})
]; ];
boot = { boot = {
@ -31,8 +31,8 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
kernelModules = [ "nfs" ]; kernelModules = ["nfs"];
supportedFilesystems = [ "nfs" ]; supportedFilesystems = ["nfs"];
}; };
kernelModules = [ kernelModules = [
@ -42,7 +42,7 @@
"vfio_pci" "vfio_pci"
"vfio_virqfd" "vfio_virqfd"
]; ];
extraModulePackages = [ ]; extraModulePackages = [];
kernelParams = [ kernelParams = [
"iommu=pt" "iommu=pt"
"intel_iommu=on" "intel_iommu=on"
@ -50,7 +50,7 @@
]; # 100GB ]; # 100GB
}; };
swapDevices = [ ]; swapDevices = [];
users.users.root.openssh.authorizedKeys.keys = [ users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAGSFTSVPt43PBpSMSF1dGTzN2JbxztDZUml7g4+PnWe CSI-Driver@talos" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAGSFTSVPt43PBpSMSF1dGTzN2JbxztDZUml7g4+PnWe CSI-Driver@talos"
@ -107,13 +107,13 @@
sopsFile = ./secrets.sops.yaml; sopsFile = ./secrets.sops.yaml;
owner = "jahanson"; owner = "jahanson";
mode = "400"; mode = "400";
restartUnits = [ "syncthing.service" ]; restartUnits = ["syncthing.service"];
}; };
"syncthing/privateKey" = { "syncthing/privateKey" = {
sopsFile = ./secrets.sops.yaml; sopsFile = ./secrets.sops.yaml;
owner = "jahanson"; owner = "jahanson";
mode = "400"; mode = "400";
restartUnits = [ "syncthing.service" ]; restartUnits = ["syncthing.service"];
}; };
}; };
}; };

View file

@ -6,9 +6,7 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: }: {
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
@ -24,9 +22,9 @@
"usbhid" "usbhid"
"sd_mod" "sd_mod"
]; ];
initrd.kernelModules = [ ]; initrd.kernelModules = [];
kernelModules = [ "kvm-amd" ]; kernelModules = ["kvm-amd"];
extraModulePackages = [ ]; extraModulePackages = [];
}; };
fileSystems = { fileSystems = {
@ -57,7 +55,7 @@
# options = [ "fmask=0022" "dmask=0022" ]; # options = [ "fmask=0022" "dmask=0022" ];
# }; # };
swapDevices = [ ]; swapDevices = [];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -1,6 +1,9 @@
{ lib, config, ... }: {
with lib; lib,
let config,
...
}:
with lib; let
app = "lego-auto"; app = "lego-auto";
image = "ghcr.io/bjw-s/lego-auto:v0.3.0"; image = "ghcr.io/bjw-s/lego-auto:v0.3.0";
user = "999"; # string user = "999"; # string
@ -8,8 +11,7 @@ let
port = 9898; # int port = 9898; # int
cfg = config.mySystem.services.${app}; cfg = config.mySystem.services.${app};
appFolder = "/eru/containers/volumes/${app}"; appFolder = "/eru/containers/volumes/${app}";
in in {
{
options.mySystem.services.${app} = { options.mySystem.services.${app} = {
enable = mkEnableOption "${app}"; enable = mkEnableOption "${app}";
dnsimpleTokenPath = mkOption { dnsimpleTokenPath = mkOption {
@ -56,9 +58,11 @@ in
DNSIMPLE_OAUTH_TOKEN_FILE = "/config/dnsimple-token"; DNSIMPLE_OAUTH_TOKEN_FILE = "/config/dnsimple-token";
}; };
volumes = [ volumes =
[
"${appFolder}/cert:/cert" "${appFolder}/cert:/cert"
] ++ optionals (cfg.provider == "dnsimple") [ "${cfg.dnsimpleTokenPath}:/config/dnsimple-token" ]; ]
++ optionals (cfg.provider == "dnsimple") ["${cfg.dnsimpleTokenPath}:/config/dnsimple-token"];
}; };
}; };
} }

View file

@ -1,14 +1,17 @@
{ lib, config, ... }: {
with lib; lib,
let config,
...
}:
with lib; let
app = "unifi"; app = "unifi";
# renovate: depName=goofball222/unifi datasource=github-releases # renovate: depName=goofball222/unifi datasource=github-releases
version = "8.4.62"; version = "8.4.62";
cfg = config.mySystem.services.${app}; cfg = config.mySystem.services.${app};
appFolder = "/eru/containers/volumes/${app}"; appFolder = "/eru/containers/volumes/${app}";
in in
# persistentFolder = "${config.mySystem.persistentFolder}/var/lib/${appFolder}"; # persistentFolder = "${config.mySystem.persistentFolder}/var/lib/${appFolder}";
{ {
options.mySystem.services.${app} = { options.mySystem.services.${app} = {
enable = mkEnableOption "${app}"; enable = mkEnableOption "${app}";
}; };
@ -16,7 +19,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.interfaces = { networking.firewall.interfaces = {
enp130s0f0 = { enp130s0f0 = {
allowedTCPPorts = [ 8443 ]; allowedTCPPorts = [8443];
}; };
podman0 = { podman0 = {
allowedTCPPorts = [ allowedTCPPorts = [
@ -25,7 +28,7 @@ in
8880 8880
8843 8843
]; ];
allowedUDPPorts = [ 3478 ]; allowedUDPPorts = [3478];
}; };
}; };
virtualisation.oci-containers.containers.${app} = { virtualisation.oci-containers.containers.${app} = {
@ -51,4 +54,4 @@ in
]; ];
}; };
}; };
} }

View file

@ -3,24 +3,27 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.de.gnome; cfg = config.mySystem.de.gnome;
in in {
{
options = { options = {
mySystem.de.gnome = { mySystem.de.gnome = {
enable = lib.mkEnableOption "GNOME" // { enable =
lib.mkEnableOption "GNOME"
// {
default = false; default = false;
}; };
systrayicons = lib.mkEnableOption "Enable systray icons" // { systrayicons =
lib.mkEnableOption "Enable systray icons"
// {
default = true; default = true;
}; };
gsconnect = lib.mkEnableOption "Enable gsconnect (KDEConnect for GNOME)" // { gsconnect =
lib.mkEnableOption "Enable gsconnect (KDEConnect for GNOME)"
// {
default = true; default = true;
}; };
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -49,14 +52,13 @@ in
}; };
}; };
udev.packages = lib.optionals cfg.systrayicons [ pkgs.gnome.gnome-settings-daemon ]; # support appindicator udev.packages = lib.optionals cfg.systrayicons [pkgs.gnome.gnome-settings-daemon]; # support appindicator
}; };
# systyray icons # systyray icons
# extra pkgs and extensions # extra pkgs and extensions
environment = { environment = {
systemPackages = systemPackages = with pkgs;
with pkgs;
[ [
wl-clipboard # ls ~/Downloads | wl-copy or wl-paste > clipboard.txt wl-clipboard # ls ~/Downloads | wl-copy or wl-paste > clipboard.txt
playerctl # gsconnect play/pause command playerctl # gsconnect play/pause command
@ -70,7 +72,7 @@ in
gnomeExtensions.caffeine gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock gnomeExtensions.dash-to-dock
] ]
++ optionals cfg.systrayicons [ pkgs.gnomeExtensions.appindicator ]; ++ optionals cfg.systrayicons [pkgs.gnomeExtensions.appindicator];
}; };
# enable gsconnect # enable gsconnect

View file

@ -3,15 +3,15 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.de.kde; cfg = config.mySystem.de.kde;
flameshotOverride = pkgs.unstable.flameshot.override { enableWlrSupport = true; }; flameshotOverride = pkgs.unstable.flameshot.override {enableWlrSupport = true;};
in in {
{
options = { options = {
mySystem.de.kde = { mySystem.de.kde = {
enable = lib.mkEnableOption "KDE" // { enable =
lib.mkEnableOption "KDE"
// {
default = false; default = false;
}; };
}; };

View file

@ -4,11 +4,9 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.cockpit; cfg = config.mySystem.services.cockpit;
in in {
{
options.mySystem.services.cockpit.enable = mkEnableOption "Cockpit"; options.mySystem.services.cockpit.enable = mkEnableOption "Cockpit";
config.services.cockpit = mkIf cfg.enable { config.services.cockpit = mkIf cfg.enable {

View file

@ -3,11 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.services.vault; cfg = config.mySystem.services.vault;
in in {
{
options.mySystem.services.vault = { options.mySystem.services.vault = {
enable = lib.mkEnableOption "vault"; enable = lib.mkEnableOption "vault";
address = lib.mkOption { address = lib.mkOption {

View file

@ -23,7 +23,7 @@
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition extraArgs = ["-f"]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted, # Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted # unless their parent is mounted
subvolumes = { subvolumes = {
@ -33,11 +33,11 @@
}; };
# Subvolume name is the same as the mountpoint # Subvolume name is the same as the mountpoint
"/home" = { "/home" = {
mountOptions = [ "compress=zstd" ]; mountOptions = ["compress=zstd"];
mountpoint = "/home"; mountpoint = "/home";
}; };
# Sub(sub)volume doesn't need a mountpoint as its parent is mounted # Sub(sub)volume doesn't need a mountpoint as its parent is mounted
"/home/user" = { }; "/home/user" = {};
# Parent is not mounted so the mountpoint must be set # Parent is not mounted so the mountpoint must be set
"/nix" = { "/nix" = {
mountOptions = [ mountOptions = [

View file

@ -1,5 +1,8 @@
{ lib, pkgs, ... }:
{ {
lib,
pkgs,
...
}: {
# Support windows partition # Support windows partition
mySystem = { mySystem = {
security.wheelNeedsSudoPassword = false; security.wheelNeedsSudoPassword = false;
@ -22,7 +25,7 @@
device = "nodev"; device = "nodev";
mirroredBoots = [ mirroredBoots = [
{ {
devices = [ "nodev" ]; devices = ["nodev"];
path = "/boot"; path = "/boot";
} }
]; ];

View file

@ -1,5 +1,8 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
boot = { boot = {
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
loader = { loader = {

View file

@ -1,12 +1,15 @@
{ lib, pkgs, ... }:
{ {
lib,
pkgs,
...
}: {
# Enable module for NVIDIA graphics # Enable module for NVIDIA graphics
mySystem = { mySystem = {
hardware.nvidia.enable = true; hardware.nvidia.enable = true;
}; };
# set xserver videodrivers for NVIDIA gpu # set xserver videodrivers for NVIDIA gpu
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = ["nvidia"];
# Install steam systemwide # Install steam systemwide
programs.steam = { programs.steam = {
enable = true; enable = true;
@ -35,5 +38,4 @@
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
}; };
} }

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./global.nix ./global.nix
]; ];

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./firefox ./firefox
]; ];

View file

@ -3,8 +3,7 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
let
cfg = config.myHome.programs.thunderbird; cfg = config.myHome.programs.thunderbird;
policies = { policies = {
@ -25,15 +24,14 @@ let
}; };
}; };
}; };
in in {
{
options.myHome.programs.thunderbird.enable = lib.mkEnableOption "Thunderbird"; options.myHome.programs.thunderbird.enable = lib.mkEnableOption "Thunderbird";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.thunderbird = { programs.thunderbird = {
enable = true; enable = true;
package = pkgs.thunderbird-128.override (old: { package = pkgs.thunderbird-128.override (old: {
extraPolicies = (old.extrapPolicies or { }) // policies; extraPolicies = (old.extrapPolicies or {}) // policies;
}); });
profiles.default.isDefault = true; profiles.default.isDefault = true;

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./ssh ./ssh
]; ];

View file

@ -1,14 +1,16 @@
{ config, lib, ... }:
with lib;
let
cfg = config.myHome.security.ssh;
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.myHome.security.ssh;
in {
options.myHome.security.ssh = { options.myHome.security.ssh = {
enable = mkEnableOption "ssh"; enable = mkEnableOption "ssh";
matchBlocks = mkOption { matchBlocks = mkOption {
type = types.attrs; type = types.attrs;
default = { }; default = {};
}; };
}; };

View file

@ -4,11 +4,9 @@
lib, lib,
... ...
}: }:
with lib; with lib; let
let
cfg = config.myHome.shell.atuind; cfg = config.myHome.shell.atuind;
in in {
{
options.myHome.shell.atuind = { options.myHome.shell.atuind = {
enable = mkEnableOption "atuind"; enable = mkEnableOption "atuind";
}; };
@ -17,10 +15,10 @@ in
(mkIf cfg.enable { (mkIf cfg.enable {
systemd.user.services.atuind = { systemd.user.services.atuind = {
Install = { Install = {
WantedBy = [ "default.target" ]; WantedBy = ["default.target"];
}; };
Unit = { Unit = {
After = [ "network.target" ]; After = ["network.target"];
}; };
Service = { Service = {
Environment = "ATUIN_LOG=info"; Environment = "ATUIN_LOG=info";

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./atuind ./atuind
./fish ./fish

View file

@ -3,11 +3,9 @@
config, config,
... ...
}: }:
with lib; with lib; let
let
cfg = config.myHome.shell.starship; cfg = config.myHome.shell.starship;
in in {
{
options.myHome.shell.starship = { options.myHome.shell.starship = {
enable = mkEnableOption "starship"; enable = mkEnableOption "starship";
}; };

View file

@ -4,11 +4,9 @@
lib, lib,
... ...
}: }:
with lib; with lib; let
let
cfg = config.myHome.shell.wezterm; cfg = config.myHome.shell.wezterm;
in in {
{
options.myHome.shell.wezterm = { options.myHome.shell.wezterm = {
enable = mkEnableOption "wezterm"; enable = mkEnableOption "wezterm";
configPath = mkOption { configPath = mkOption {

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
config = { config = {
"core.https_address" = "10.1.1.61:8443"; # Need quotes around key "core.https_address" = "10.1.1.61:8443"; # Need quotes around key
}; };
@ -27,7 +26,7 @@
]; ];
profiles = [ profiles = [
{ {
config = { }; config = {};
description = ""; description = "";
devices = { devices = {
eth0 = { eth0 = {
@ -44,6 +43,6 @@
name = "default"; name = "default";
} }
]; ];
projects = [ ]; projects = [];
cluster = null; cluster = null;
} }

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
outputs = { outputs = {
# ZFS automated snapshots # ZFS automated snapshots
templates = { templates = {
@ -14,27 +13,27 @@
datasets = { datasets = {
"nahar/qbittorrent" = { "nahar/qbittorrent" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
"nahar/sabnzbd" = { "nahar/sabnzbd" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
"nahar/containers/volumes/jellyfin" = { "nahar/containers/volumes/jellyfin" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
"nahar/containers/volumes/plex" = { "nahar/containers/volumes/plex" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
"nahar/containers/volumes/scrutiny" = { "nahar/containers/volumes/scrutiny" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
"nahar/containers/volumes/scrypted" = { "nahar/containers/volumes/scrypted" = {
useTemplate = [ "production" ]; useTemplate = ["production"];
recursive = true; recursive = true;
}; };
}; };

View file

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: ''
''
include "${config.sops.secrets."bind/rndc-keys/externaldns".path}"; include "${config.sops.secrets."bind/rndc-keys/externaldns".path}";
acl trusted { acl trusted {

View file

@ -1,5 +1,4 @@
{ ... }: {...}: ''
''
global global
log /dev/log local0 log /dev/log local0
log /dev/log local1 notice log /dev/log local1 notice

View file

@ -7,9 +7,7 @@
modulesPath, modulesPath,
pkgs, pkgs,
... ...
}: }: {
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
@ -25,9 +23,9 @@
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
initrd.kernelModules = [ ]; initrd.kernelModules = [];
kernelModules = [ "kvm-intel" ]; kernelModules = ["kvm-intel"];
extraModulePackages = [ ]; extraModulePackages = [];
}; };
fileSystems = { fileSystems = {
"/" = { "/" = {
@ -51,7 +49,7 @@
}; };
}; };
swapDevices = [ ]; swapDevices = [];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Until I can figure out why the tftp port is not opening, disable the firewall. # Until I can figure out why the tftp port is not opening, disable the firewall.
@ -118,12 +116,12 @@
bind = { bind = {
enable = true; enable = true;
extraConfig = import ./config/bind.nix { inherit config; }; extraConfig = import ./config/bind.nix {inherit config;};
}; };
haproxy = { haproxy = {
enable = true; enable = true;
config = import ./config/haproxy.nix { inherit config; }; config = import ./config/haproxy.nix {inherit config;};
tcpPorts = [ tcpPorts = [
6443 6443
6444 6444

View file

@ -1,13 +1,10 @@
{ pkgs, ... }: {pkgs, ...}: let
let
cleanupScript = pkgs.writeShellScriptBin "cleanup-backups.sh" ( cleanupScript = pkgs.writeShellScriptBin "cleanup-backups.sh" (
builtins.readFile ./prune-backups.sh builtins.readFile ./prune-backups.sh
); );
in in {
{
systemd.timers.cleanup-backups = { systemd.timers.cleanup-backups = {
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
timerConfig = { timerConfig = {
OnCalendar = "daily"; OnCalendar = "daily";
Persistent = true; Persistent = true;

View file

@ -1,12 +1,14 @@
{ lib, config, ... }: {
with lib; lib,
let config,
...
}:
with lib; let
app = "scrutiny"; app = "scrutiny";
# renovate: depName=AnalogJ/scrutiny datasource=github-releases # renovate: depName=AnalogJ/scrutiny datasource=github-releases
version = "v0.8.1"; version = "v0.8.1";
cfg = config.mySystem.services.${app}; cfg = config.mySystem.services.${app};
in in {
{
options.mySystem.services.${app} = { options.mySystem.services.${app} = {
enable = mkEnableOption "${app}"; enable = mkEnableOption "${app}";
@ -33,7 +35,7 @@ in
# --device /dev/disk/by-id/nvme-XXXXXXXXXXXXXXXXXXXXXXXXXXXX # --device /dev/disk/by-id/nvme-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
devices = mkOption { devices = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [];
description = '' description = ''
Devices to monitor on Scrutiny. Devices to monitor on Scrutiny.
''; '';

View file

@ -3,15 +3,15 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.de.kde; cfg = config.mySystem.de.kde;
flameshotOverride = pkgs.unstable.flameshot.override { enableWlrSupport = true; }; flameshotOverride = pkgs.unstable.flameshot.override {enableWlrSupport = true;};
in in {
{
options = { options = {
mySystem.de.kde = { mySystem.de.kde = {
enable = lib.mkEnableOption "KDE" // { enable =
lib.mkEnableOption "KDE"
// {
default = false; default = false;
}; };
}; };

View file

@ -1,12 +1,13 @@
# /home/jahanson/projects/mochi/nixos/modules/nixos/editor/vim.nix # /home/jahanson/projects/mochi/nixos/modules/nixos/editor/vim.nix
{ config, lib, ... }:
with lib;
let
cfg = config.mySystem.editor.vim;
users = [ "jahanson" ];
in
{ {
config,
lib,
...
}:
with lib; let
cfg = config.mySystem.editor.vim;
users = ["jahanson"];
in {
options.mySystem.editor.vim.enable = mkEnableOption "vim"; options.mySystem.editor.vim.enable = mkEnableOption "vim";
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Enable vim and set as default editor # Enable vim and set as default editor
@ -26,8 +27,9 @@ in
listToAttrs ( listToAttrs (
map (u: { map (u: {
name = u; name = u;
value = { }; value = {};
}) users })
users
) )
); );
}; };

View file

@ -3,11 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.games.steam; cfg = config.mySystem.games.steam;
in in {
{
options.mySystem.games.steam = { options.mySystem.games.steam = {
enable = lib.mkEnableOption "Steam"; enable = lib.mkEnableOption "Steam";
}; };
@ -24,6 +22,5 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
protonup-qt protonup-qt
]; ];
}; };
} }

View file

@ -4,15 +4,12 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.hardware.nvidia; cfg = config.mySystem.hardware.nvidia;
in in {
{
options.mySystem.hardware.nvidia.enable = mkEnableOption "NVIDIA config"; options.mySystem.hardware.nvidia.enable = mkEnableOption "NVIDIA config";
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
# ref: https://nixos.wiki/wiki/Nvidia # ref: https://nixos.wiki/wiki/Nvidia
# Enable OpenGL # Enable OpenGL
@ -30,7 +27,6 @@ in
# This is for the benefit of VSCODE running natively in wayland # This is for the benefit of VSCODE running natively in wayland
nvidia = { nvidia = {
# Modesetting is required. # Modesetting is required.
modesetting.enable = true; modesetting.enable = true;

View file

@ -1,9 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.shell.fish;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.shell.fish;
in {
options.mySystem.shell.fish = { options.mySystem.shell.fish = {
enable = mkEnableOption "Fish"; enable = mkEnableOption "Fish";
enablePlugins = mkOption { enablePlugins = mkOption {
@ -22,5 +24,4 @@ in
functions.enable = true; functions.enable = true;
}; };
}; };
} }

View file

@ -1,10 +1,12 @@
{ config, lib, ... }: {
with lib; config,
let lib,
...
}:
with lib; let
cfg = config.mySystem.security._1password; cfg = config.mySystem.security._1password;
user = "jahanson"; user = "jahanson";
in in {
{
options.mySystem.security._1password = { options.mySystem.security._1password = {
enable = mkEnableOption "_1password"; enable = mkEnableOption "_1password";
}; };
@ -14,7 +16,7 @@ in
_1password.enable = true; _1password.enable = true;
_1password-gui = { _1password-gui = {
enable = true; enable = true;
polkitPolicyOwners = [ "${user}" ]; polkitPolicyOwners = ["${user}"];
}; };
}; };

View file

@ -1,15 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.security.acme;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.security.acme;
in {
options.mySystem.security.acme.enable = mkEnableOption "acme"; options.mySystem.security.acme.enable = mkEnableOption "acme";
config = mkIf cfg.enable { config = mkIf cfg.enable {
sops.secrets = { sops.secrets = {
"security/acme/env".sopsFile = ./secrets.sops.yaml; "security/acme/env".sopsFile = ./secrets.sops.yaml;
"security/acme/env".restartUnits = [ "lego.service" ]; "security/acme/env".restartUnits = ["lego.service"];
}; };
security.acme = { security.acme = {

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./1password ./1password
./acme ./acme

View file

@ -4,14 +4,12 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.bind; cfg = config.mySystem.services.bind;
in in {
{
options.mySystem.services.bind = { options.mySystem.services.bind = {
enable = mkEnableOption "bind"; enable = mkEnableOption "bind";
package = mkPackageOption pkgs "bind" { }; package = mkPackageOption pkgs "bind" {};
extraConfig = mkOption { extraConfig = mkOption {
type = types.str; type = types.str;
}; };
@ -19,8 +17,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 53 ]; allowedTCPPorts = [53];
allowedUDPPorts = [ 53 ]; allowedUDPPorts = [53];
}; };
# Forces the machine to use the resolver provided by the network # Forces the machine to use the resolver provided by the network

View file

@ -4,14 +4,12 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.dnsmasq; cfg = config.mySystem.services.dnsmasq;
in in {
{
options.mySystem.services.dnsmasq = { options.mySystem.services.dnsmasq = {
enable = mkEnableOption "dnsmasq"; enable = mkEnableOption "dnsmasq";
package = mkPackageOption pkgs "dnsmasq" { }; package = mkPackageOption pkgs "dnsmasq" {};
bootAsset = mkOption { bootAsset = mkOption {
type = types.str; type = types.str;
example = "http://10.1.1.57:8086/boot.ipxe"; example = "http://10.1.1.57:8086/boot.ipxe";
@ -48,7 +46,7 @@ in
settings = { settings = {
# Disables only the DNS port. # Disables only the DNS port.
port = 0; port = 0;
dhcp-range = [ "10.1.1.1,proxy,255.255.255.0" ]; dhcp-range = ["10.1.1.1,proxy,255.255.255.0"];
# serves TFTP from dnsmasq # serves TFTP from dnsmasq
enable-tftp = true; enable-tftp = true;
tftp-root = cfg.tftpRoot; tftp-root = cfg.tftpRoot;

View file

@ -5,12 +5,10 @@
inputs, inputs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.libvirt-qemu; cfg = config.mySystem.services.libvirt-qemu;
in in {
{ imports = [inputs.nixvirt-git.nixosModules.default];
imports = [ inputs.nixvirt-git.nixosModules.default ];
options.mySystem.services.libvirt-qemu = { options.mySystem.services.libvirt-qemu = {
enable = mkEnableOption "libvirt-qemu"; enable = mkEnableOption "libvirt-qemu";
}; };
@ -30,7 +28,7 @@ in
qemu = { qemu = {
package = pkgs.qemu_kvm; package = pkgs.qemu_kvm;
ovmf.enable = true; ovmf.enable = true;
ovmf.packages = [ pkgs.OVMFFull.fd ]; ovmf.packages = [pkgs.OVMFFull.fd];
}; };
}; };
}; };

View file

@ -4,14 +4,12 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.matchbox; cfg = config.mySystem.services.matchbox;
in in {
{
options.mySystem.services.matchbox = { options.mySystem.services.matchbox = {
enable = mkEnableOption "matchbox"; enable = mkEnableOption "matchbox";
package = mkPackageOption pkgs "matchbox-server" { }; package = mkPackageOption pkgs "matchbox-server" {};
dataPath = mkOption { dataPath = mkOption {
type = types.str; type = types.str;
example = "/var/lib/matchbox"; example = "/var/lib/matchbox";
@ -38,10 +36,10 @@ in
networking.firewall = { networking.firewall = {
# HTTP communication # HTTP communication
allowedTCPPorts = [ 8086 ]; allowedTCPPorts = [8086];
}; };
users.groups.matchbox = { }; users.groups.matchbox = {};
users.users = { users.users = {
matchbox = { matchbox = {
home = cfg.dataPath; home = cfg.dataPath;
@ -51,8 +49,8 @@ in
}; };
systemd.services.matchbox = { systemd.services.matchbox = {
wantedBy = [ "multi-user.target" ]; wantedBy = ["multi-user.target"];
after = [ "network.target" ]; after = ["network.target"];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.matchbox-server}/bin/matchbox -address=0.0.0.0:8086 -data-path=${cfg.dataPath} -assets-path=${cfg.assetPath} -log-level=debug"; ExecStart = "${pkgs.matchbox-server}/bin/matchbox -address=0.0.0.0:8086 -data-path=${cfg.dataPath} -assets-path=${cfg.assetPath} -log-level=debug";
Restart = "on-failure"; Restart = "on-failure";

View file

@ -1,13 +1,14 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.services.nginx;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.services.nginx;
in {
options.mySystem.services.nginx.enable = mkEnableOption "nginx"; options.mySystem.services.nginx.enable = mkEnableOption "nginx";
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -63,6 +64,6 @@ in
}; };
# required for using acme certs # required for using acme certs
users.users.nginx.extraGroups = [ "acme" ]; users.users.nginx.extraGroups = ["acme"];
}; };
} }

View file

@ -3,11 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.services.nix-index-daily; cfg = config.mySystem.services.nix-index-daily;
in in {
{
options.mySystem.services.nix-index-daily = { options.mySystem.services.nix-index-daily = {
enable = lib.mkEnableOption "Automatic daily nix-index database updates"; enable = lib.mkEnableOption "Automatic daily nix-index database updates";
@ -29,8 +27,8 @@ in
systemd.user = { systemd.user = {
# Timer for nix-index update # Timer for nix-index update
timers.nix-index-update = { timers.nix-index-update = {
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
partOf = [ "nix-index-update.service" ]; partOf = ["nix-index-update.service"];
timerConfig = { timerConfig = {
OnCalendar = cfg.startTime; OnCalendar = cfg.startTime;
Persistent = true; Persistent = true;

View file

@ -1,9 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.services.onepassword-connect;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.services.onepassword-connect;
in {
options.mySystem.services.onepassword-connect = { options.mySystem.services.onepassword-connect = {
enable = mkEnableOption "onepassword-connect"; enable = mkEnableOption "onepassword-connect";
apiVersion = lib.mkOption { apiVersion = lib.mkOption {
@ -27,7 +29,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Create data dir # Create data dir
system.activationScripts.makeOnePasswordConnectDataDir = lib.stringAfter [ "var" ] '' system.activationScripts.makeOnePasswordConnectDataDir = lib.stringAfter ["var"] ''
mkdir -p "${cfg.dataDir}" mkdir -p "${cfg.dataDir}"
chown -R 999:999 ${cfg.dataDir} chown -R 999:999 ${cfg.dataDir}
''; '';
@ -37,7 +39,7 @@ in
onepassword-connect-api = { onepassword-connect-api = {
image = "docker.io/1password/connect-api:${cfg.apiVersion}"; image = "docker.io/1password/connect-api:${cfg.apiVersion}";
autoStart = true; autoStart = true;
ports = [ "8080:8080" ]; ports = ["8080:8080"];
volumes = [ volumes = [
"${cfg.credentialsFile}:/home/opuser/.op/1password-credentials.json" "${cfg.credentialsFile}:/home/opuser/.op/1password-credentials.json"
"${cfg.dataDir}:/home/opuser/.op/data" "${cfg.dataDir}:/home/opuser/.op/data"
@ -47,7 +49,7 @@ in
onepassword-connect-sync = { onepassword-connect-sync = {
image = "docker.io/1password/connect-sync:${cfg.syncVersion}"; image = "docker.io/1password/connect-sync:${cfg.syncVersion}";
autoStart = true; autoStart = true;
ports = [ "8081:8080" ]; ports = ["8081:8080"];
volumes = [ volumes = [
"${cfg.credentialsFile}:/home/opuser/.op/1password-credentials.json" "${cfg.credentialsFile}:/home/opuser/.op/1password-credentials.json"
"${cfg.dataDir}:/home/opuser/.op/data" "${cfg.dataDir}:/home/opuser/.op/data"

View file

@ -4,11 +4,9 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.podman; cfg = config.mySystem.services.podman;
in in {
{
options.mySystem.services.podman.enable = mkEnableOption "Podman"; options.mySystem.services.podman.enable = mkEnableOption "Podman";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -16,7 +14,7 @@ in
enable = true; enable = true;
dockerCompat = true; dockerCompat = true;
extraPackages = [ pkgs.zfs ]; extraPackages = [pkgs.zfs];
# regular cleanup # regular cleanup
autoPrune.enable = true; autoPrune.enable = true;
@ -42,16 +40,16 @@ in
lazypodman = "sudo DOCKER_HOST=unix:///run/podman/podman.sock lazydocker"; lazypodman = "sudo DOCKER_HOST=unix:///run/podman/podman.sock lazydocker";
}; };
networking.firewall.interfaces.podman0.allowedUDPPorts = [ 53 ]; networking.firewall.interfaces.podman0.allowedUDPPorts = [53];
# extra user for containers # extra user for containers
users.groups.kah = { }; users.groups.kah = {};
users.users = { users.users = {
kah = { kah = {
uid = 568; uid = 568;
group = "kah"; group = "kah";
}; };
jahanson.extraGroups = [ "kah" ]; jahanson.extraGroups = ["kah"];
}; };
}; };
} }

View file

@ -4,11 +4,9 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.qbittorrent; cfg = config.mySystem.services.qbittorrent;
in in {
{
options.mySystem.services.qbittorrent = { options.mySystem.services.qbittorrent = {
enable = mkEnableOption "qBittorrent"; enable = mkEnableOption "qBittorrent";
@ -68,7 +66,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.groups.${cfg.group} = { }; users.groups.${cfg.group} = {};
users.users = mkIf (cfg.user == "qbittorrent") { users.users = mkIf (cfg.user == "qbittorrent") {
qbittorrent = { qbittorrent = {
inherit (cfg) group; inherit (cfg) group;
@ -108,8 +106,8 @@ in
Group = cfg.group; Group = cfg.group;
} }
(lib.mkIf cfg.hardening { (lib.mkIf cfg.hardening {
CapabilityBoundingSet = [ "" ]; CapabilityBoundingSet = [""];
DeviceAllow = [ "" ]; DeviceAllow = [""];
DevicePolicy = "closed"; DevicePolicy = "closed";
LockPersonality = true; LockPersonality = true;
MemoryDenyWriteExecute = true; MemoryDenyWriteExecute = true;
@ -154,7 +152,7 @@ in
cfg.webuiPort cfg.webuiPort
cfg.qbittorrentPort cfg.qbittorrentPort
]; ];
allowedUDPPorts = [ cfg.qbittorrentPort ]; allowedUDPPorts = [cfg.qbittorrentPort];
}; };
}; };
} }

View file

@ -1,15 +1,17 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.services.rebootRequiredCheck;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.services.rebootRequiredCheck;
in {
options.mySystem.services.rebootRequiredCheck.enable = mkEnableOption "Reboot required check"; options.mySystem.services.rebootRequiredCheck.enable = mkEnableOption "Reboot required check";
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Enable timer # Enable timer
systemd.timers."reboot-required-check" = { systemd.timers."reboot-required-check" = {
wantedBy = [ "timers.target" ]; wantedBy = ["timers.target"];
timerConfig = { timerConfig = {
# start at boot # start at boot
OnBootSec = "0m"; OnBootSec = "0m";

View file

@ -4,14 +4,12 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.services.sanoid; cfg = config.mySystem.services.sanoid;
in in {
{
options.mySystem.services.sanoid = { options.mySystem.services.sanoid = {
enable = mkEnableOption "sanoid"; enable = mkEnableOption "sanoid";
package = mkPackageOption pkgs "sanoid" { }; package = mkPackageOption pkgs "sanoid" {};
datasets = mkOption { datasets = mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified); type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified);
}; };

View file

@ -1,5 +1,4 @@
{ sops, ... }: {sops, ...}: {
{
gui = { gui = {
user = sops.secrets.username; user = sops.secrets.username;
password = sops.secrets.password; password = sops.secrets.password;
@ -9,22 +8,22 @@
gandalf = { gandalf = {
name = "gandalf"; name = "gandalf";
id = "2VYHSOB-4QE3UIJ-EFKAD4D-J7YTLYG-4KF36C2-3SOLD4G-MFR6NK3-C2VSAQV"; id = "2VYHSOB-4QE3UIJ-EFKAD4D-J7YTLYG-4KF36C2-3SOLD4G-MFR6NK3-C2VSAQV";
addresses = [ "tcp://10.1.1.13:22000" ]; addresses = ["tcp://10.1.1.13:22000"];
}; };
legiondary = { legiondary = {
name = "legiondary"; name = "legiondary";
id = "O4WI2YC-BZBPF2W-2ALNQ2D-UOP3BK5-ZDSEHVH-DIHS2FG-BSVJCXG-GF47XAE"; id = "O4WI2YC-BZBPF2W-2ALNQ2D-UOP3BK5-ZDSEHVH-DIHS2FG-BSVJCXG-GF47XAE";
addresses = [ "dynamic" ]; addresses = ["dynamic"];
}; };
shadowfax = { shadowfax = {
name = "shadowfax"; name = "shadowfax";
id = "U3DS7CW-GBZT44M-IFP3MOB-AV6SHVY-YFVEL5P-HE3ACC5-NDDGAOB-HOTKJAC"; id = "U3DS7CW-GBZT44M-IFP3MOB-AV6SHVY-YFVEL5P-HE3ACC5-NDDGAOB-HOTKJAC";
addresses = [ "tcp://10.1.1.61:22000" ]; addresses = ["tcp://10.1.1.61:22000"];
}; };
telchar = { telchar = {
name = "telchar"; name = "telchar";
id = "ENO4NVK-DUKOLUT-ASJZOEI-IFBVBTA-GDNWKWS-DQF3TZW-JJ72VVB-VWTHNAH"; id = "ENO4NVK-DUKOLUT-ASJZOEI-IFBVBTA-GDNWKWS-DQF3TZW-JJ72VVB-VWTHNAH";
addresses = [ "dynamic" ]; addresses = ["dynamic"];
}; };
}; };

View file

@ -2,11 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
let
cfg = config.mySystem.services.syncthing; cfg = config.mySystem.services.syncthing;
in in {
{
options.mySystem.services.syncthing = { options.mySystem.services.syncthing = {
enable = lib.mkEnableOption "Syncthing"; enable = lib.mkEnableOption "Syncthing";
publicCertPath = lib.mkOption { publicCertPath = lib.mkOption {
@ -30,13 +28,13 @@ in
sopsFile = ./secrets.sops.yaml; sopsFile = ./secrets.sops.yaml;
owner = "jahanson"; owner = "jahanson";
mode = "400"; mode = "400";
restartUnits = [ "syncthing.service" ]; restartUnits = ["syncthing.service"];
}; };
"password" = { "password" = {
sopsFile = ./secrets.sops.yaml; sopsFile = ./secrets.sops.yaml;
owner = "jahanson"; owner = "jahanson";
mode = "400"; mode = "400";
restartUnits = [ "syncthing.service" ]; restartUnits = ["syncthing.service"];
}; };
}; };
@ -48,7 +46,7 @@ in
openDefaultPorts = true; openDefaultPorts = true;
key = "${cfg.privateKeyPath}"; key = "${cfg.privateKeyPath}";
cert = "${cfg.publicCertPath}"; cert = "${cfg.publicCertPath}";
settings = import ./config { inherit (config) sops; }; settings = import ./config {inherit (config) sops;};
}; };
}; };
# Don't create default ~/Sync folder # Don't create default ~/Sync folder

View file

@ -4,17 +4,13 @@
pkgs, pkgs,
... ...
}: }:
with lib; let
with lib;
let
cfg = config.mySystem.services.unpackerr; cfg = config.mySystem.services.unpackerr;
in in {
{
options.mySystem.services.unpackerr = { options.mySystem.services.unpackerr = {
enable = mkEnableOption "Unpackerr"; enable = mkEnableOption "Unpackerr";
package = mkPackageOption pkgs "unpackerr" { }; package = mkPackageOption pkgs "unpackerr" {};
user = mkOption { user = mkOption {
type = types.str; type = types.str;
@ -43,7 +39,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.groups.${cfg.group} = { }; users.groups.${cfg.group} = {};
users.users = mkIf (cfg.user == "unpackerr") { users.users = mkIf (cfg.user == "unpackerr") {
unpackerr = { unpackerr = {
inherit (cfg) group; inherit (cfg) group;
@ -53,8 +49,8 @@ in
systemd.services.unpackerr = { systemd.services.unpackerr = {
description = "Unpackerr service"; description = "Unpackerr service";
after = [ "network.target" ]; after = ["network.target"];
wantedBy = [ "multi-user.target" ]; wantedBy = ["multi-user.target"];
serviceConfig = { serviceConfig = {
User = cfg.user; User = cfg.user;
Group = cfg.group; Group = cfg.group;
@ -66,9 +62,11 @@ in
] ]
); );
EnvironmentFile = lib.optional ( EnvironmentFile =
lib.optional (
cfg.extraEnvVarsFile != null && cfg.extraEnvVarsFile != "" cfg.extraEnvVarsFile != null && cfg.extraEnvVarsFile != ""
) cfg.extraEnvVarsFile; )
cfg.extraEnvVarsFile;
}; };
}; };
}; };

View file

@ -1,17 +1,19 @@
{ lib, config, ... }:
let
cfg = config.mySystem.system.borgbackup;
in
{ {
lib,
config,
...
}: let
cfg = config.mySystem.system.borgbackup;
in {
options.mySystem.system.borgbackup = { options.mySystem.system.borgbackup = {
enable = lib.mkEnableOption "borgbackup"; enable = lib.mkEnableOption "borgbackup";
paths = lib.mkOption { paths = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
default = [ ]; default = [];
}; };
exclude = lib.mkOption { exclude = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
default = [ ]; default = [];
}; };
repo = lib.mkOption { repo = lib.mkOption {
example = "borgbackup@myserver:repo"; example = "borgbackup@myserver:repo";

View file

@ -1,5 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./borgbackup ./borgbackup
./pikabackup ./pikabackup

View file

@ -3,12 +3,10 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.system.borg.pika-backup; cfg = config.mySystem.system.borg.pika-backup;
user = "jahanson"; user = "jahanson";
in in {
{
options.mySystem.system.borg.pika-backup = { options.mySystem.system.borg.pika-backup = {
enable = lib.mkEnableOption "pika-backup"; enable = lib.mkEnableOption "pika-backup";
}; };

View file

@ -3,12 +3,10 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
let
cfg = config.mySystem.system.incus; cfg = config.mySystem.system.incus;
user = "jahanson"; user = "jahanson";
in in {
{
# sops.secrets.secret-domain-0 = { # sops.secrets.secret-domain-0 = {
# sopsFile = ./secret.sops.yaml; # sopsFile = ./secret.sops.yaml;
# }; # };
@ -27,14 +25,13 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
virtualisation.incus = { virtualisation.incus = {
inherit (cfg) preseed; inherit (cfg) preseed;
enable = true; enable = true;
ui.enable = true; ui.enable = true;
}; };
users.users.${user}.extraGroups = [ "incus-admin" ]; users.users.${user}.extraGroups = ["incus-admin"];
# systemd.services.incus-preseed.postStart = "${oidcSetup}"; # systemd.services.incus-preseed.postStart = "${oidcSetup}";

View file

@ -3,8 +3,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
motd = pkgs.writeShellScriptBin "motd" '' motd = pkgs.writeShellScriptBin "motd" ''
#! /usr/bin/env bash #! /usr/bin/env bash
source /etc/os-release source /etc/os-release
@ -41,8 +40,7 @@ let
printf "\n" printf "\n"
${lib.strings.concatStrings ( ${lib.strings.concatStrings (
lib.lists.forEach cfg.networkInterfaces ( lib.lists.forEach cfg.networkInterfaces (
x: x: "printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${x}\" \"$(ip -4 addr show ${x} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n"
"printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${x}\" \"$(ip -4 addr show ${x} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n"
) )
)} )}
printf "$BOLD * %-20s$ENDCOLOR %s\n" "Release" "$PRETTY_NAME" printf "$BOLD * %-20s$ENDCOLOR %s\n" "Release" "$PRETTY_NAME"
@ -82,17 +80,15 @@ let
fi fi
''; '';
cfg = config.mySystem.system.motd; cfg = config.mySystem.system.motd;
in in {
{
options.mySystem.system.motd = { options.mySystem.system.motd = {
enable = lib.mkEnableOption "MOTD"; enable = lib.mkEnableOption "MOTD";
networkInterfaces = lib.mkOption { networkInterfaces = lib.mkOption {
description = "Network interfaces to monitor"; description = "Network interfaces to monitor";
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
# default = lib.mapAttrsToList (_: val: val.interface) # default = lib.mapAttrsToList (_: val: val.interface)
default = [ ]; default = [];
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages = [

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.mySystem.system.nfs;
in
{ {
lib,
config,
...
}: let
cfg = config.mySystem.system.nfs;
in {
options.mySystem.system.nfs = { options.mySystem.system.nfs = {
enable = lib.mkEnableOption "nfs"; enable = lib.mkEnableOption "nfs";
exports = lib.mkOption { exports = lib.mkOption {

View file

@ -1,9 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.nix;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.nix;
in {
options.mySystem.nix = { options.mySystem.nix = {
autoOptimiseStore = mkOption { autoOptimiseStore = mkOption {
type = lib.types.bool; type = lib.types.bool;
@ -11,7 +13,9 @@ in
default = true; default = true;
}; };
gc = { gc = {
enable = mkEnableOption "automatic garbage collection" // { enable =
mkEnableOption "automatic garbage collection"
// {
default = true; default = true;
}; };
persistent = mkOption { persistent = mkOption {

View file

@ -1,11 +1,15 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.services.openssh;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.services.openssh;
in {
options.mySystem.services.openssh = { options.mySystem.services.openssh = {
enable = mkEnableOption "openssh" // { enable =
mkEnableOption "openssh"
// {
default = true; default = true;
}; };
passwordAuthentication = mkOption { passwordAuthentication = mkOption {

View file

@ -4,21 +4,18 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.system.systemd.pushover-alerts; cfg = config.mySystem.system.systemd.pushover-alerts;
in in {
{
options.mySystem.system.systemd.pushover-alerts.enable = options.mySystem.system.systemd.pushover-alerts.enable =
mkEnableOption "Pushover alerts for systemd failures" mkEnableOption "Pushover alerts for systemd failures"
// { // {
default = true; default = true;
}; };
options.systemd.services = mkOption { options.systemd.services = mkOption {
type = type = with types;
with types;
attrsOf (submodule { attrsOf (submodule {
config.onFailure = [ "notify-pushover@%n.service" ]; config.onFailure = ["notify-pushover@%n.service"];
}); });
}; };
@ -32,7 +29,7 @@ in
systemd.services."notify-pushover@" = mkIf cfg.enable { systemd.services."notify-pushover@" = mkIf cfg.enable {
enable = true; enable = true;
onFailure = lib.mkForce [ ]; # cant refer to itself on failure onFailure = lib.mkForce []; # cant refer to itself on failure
description = "Notify on failed unit %i"; description = "Notify on failed unit %i";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";

View file

@ -1,9 +1,11 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.security;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.security;
in {
options.mySystem.security = { options.mySystem.security = {
sshAgentAuth.enable = lib.mkEnableOption "openssh"; sshAgentAuth.enable = lib.mkEnableOption "openssh";
wheelNeedsSudoPassword = lib.mkOption { wheelNeedsSudoPassword = lib.mkOption {

View file

@ -1,14 +1,16 @@
{ lib, config, ... }:
with lib;
let
cfg = config.mySystem.system;
in
{ {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.system;
in {
options.mySystem.system = { options.mySystem.system = {
packages = mkOption { packages = mkOption {
type = with types; listOf package; type = with types; listOf package;
description = "List of system level package installs"; description = "List of system level package installs";
default = [ ]; default = [];
}; };
}; };
# System packages deployed globally. # System packages deployed globally.

View file

@ -1,8 +1,10 @@
{ lib, config, ... }:
let
cfg = config.mySystem.time;
in
{ {
lib,
config,
...
}: let
cfg = config.mySystem.time;
in {
options.mySystem.time = { options.mySystem.time = {
timeZone = lib.mkOption { timeZone = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -5,8 +5,7 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
cfg = config.mySystem.framework_wifi_swap; cfg = config.mySystem.framework_wifi_swap;
wifiSwap = pkgs.writeShellScriptBin "wifi_swap" '' wifiSwap = pkgs.writeShellScriptBin "wifi_swap" ''
#! /usr/bin/env bash #! /usr/bin/env bash
@ -34,10 +33,11 @@ let
;; ;;
esac esac
''; '';
in in {
{
options.mySystem.framework_wifi_swap = { options.mySystem.framework_wifi_swap = {
enable = mkEnableOption "framework_wifi_swap" // { enable =
mkEnableOption "framework_wifi_swap"
// {
default = false; default = false;
}; };
}; };

View file

@ -3,17 +3,15 @@
config, config,
pkgs, pkgs,
... ...
}: }: let
let
cfg = config.mySystem.system.zfs; cfg = config.mySystem.system.zfs;
in in
with lib; with lib; {
{
options.mySystem.system.zfs = { options.mySystem.system.zfs = {
enable = lib.mkEnableOption "zfs"; enable = lib.mkEnableOption "zfs";
mountPoolsAtBoot = lib.mkOption { mountPoolsAtBoot = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
default = [ ]; default = [];
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -44,4 +42,4 @@ with lib;
ZED_PUSHOVER_USER = "$(${pkgs.busybox}/bin/cat ${config.sops.secrets.pushover-user-key.path})"; ZED_PUSHOVER_USER = "$(${pkgs.busybox}/bin/cat ${config.sops.secrets.pushover-user-key.path})";
}; };
}; };
} }

View file

@ -1,10 +1,9 @@
{ ... }: {...}: let
let
finalVersion = "tauri-v2.0.4"; finalVersion = "tauri-v2.0.4";
in in
final: prev: { final: prev: {
cargo-tauri = prev.cargo-tauri.overrideAttrs (oldAttrs: { cargo-tauri = prev.cargo-tauri.overrideAttrs (oldAttrs: {
version = finalVersion; version = finalVersion;
vendorHash = "sha256-aTtvVpL979BUvSBwBqRqCWSWIBBmmty9vBD97Q5P4+E="; vendorHash = "sha256-aTtvVpL979BUvSBwBqRqCWSWIBBmmty9vBD97Q5P4+E=";
}); });
} }

View file

@ -8,9 +8,7 @@
stdenvNoCC, stdenvNoCC,
unzip, unzip,
nixosTests, nixosTests,
}: }: let
let
inherit (stdenvNoCC.hostPlatform) system; inherit (stdenvNoCC.hostPlatform) system;
channels = { channels = {
@ -34,14 +32,13 @@ let
}; };
}; };
in in
stdenvNoCC.mkDerivation (finalAttrs: { stdenvNoCC.mkDerivation (finalAttrs: {
pname = "coder"; pname = "coder";
version = channels.${channel}.version; version = channels.${channel}.version;
src = fetchurl { src = fetchurl {
hash = (channels.${channel}.hash).${system}; hash = (channels.${channel}.hash).${system};
url = url = let
let
systemName = systemName =
{ {
x86_64-linux = "linux_amd64"; x86_64-linux = "linux_amd64";
@ -59,8 +56,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
aarch64-darwin = "zip"; aarch64-darwin = "zip";
} }
.${system}; .${system};
in in "https://github.com/coder/coder/releases/download/v${finalAttrs.version}/coder_${finalAttrs.version}_${systemName}.${ext}";
"https://github.com/coder/coder/releases/download/v${finalAttrs.version}/coder_${finalAttrs.version}_${systemName}.${ext}";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -90,7 +86,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
postInstall = '' postInstall = ''
wrapProgram $out/bin/coder \ wrapProgram $out/bin/coder \
--prefix PATH : ${lib.makeBinPath [ terraform ]} --prefix PATH : ${lib.makeBinPath [terraform]}
''; '';
# integration tests require network access # integration tests require network access
@ -114,4 +110,4 @@ stdenvNoCC.mkDerivation (finalAttrs: {
inherit (nixosTests) coder; inherit (nixosTests) coder;
}; };
}; };
}) })

View file

@ -1,9 +1,8 @@
{ ... }: {...}: let
let
dbrev = "5613"; dbrev = "5613";
drivedbBranch = "RELEASE_7_4"; drivedbBranch = "RELEASE_7_4";
in in
final: prev: { final: prev: {
smartmontools = prev.smartmontools.overrideAttrs (oldAttrs: { smartmontools = prev.smartmontools.overrideAttrs (oldAttrs: {
inherit dbrev drivedbBranch; inherit dbrev drivedbBranch;
driverdb = builtins.fetchurl { driverdb = builtins.fetchurl {
@ -12,4 +11,4 @@ final: prev: {
name = "smartmontools-drivedb.h"; name = "smartmontools-drivedb.h";
}; };
}); });
} }

View file

@ -5,7 +5,6 @@
installShellFiles, installShellFiles,
git, git,
}: }:
buildGoModule rec { buildGoModule rec {
pname = "talosctl"; pname = "talosctl";
version = "1.9.0"; version = "1.9.0";
@ -24,7 +23,7 @@ buildGoModule rec {
"-w" "-w"
]; ];
subPackages = [ "cmd/talosctl" ]; subPackages = ["cmd/talosctl"];
doCheck = false; doCheck = false;
@ -58,7 +57,7 @@ buildGoModule rec {
description = "A CLI for out-of-band management of Kubernetes nodes created by Talos"; description = "A CLI for out-of-band management of Kubernetes nodes created by Talos";
homepage = "https://www.talos.dev/"; homepage = "https://www.talos.dev/";
license = licenses.mpl20; license = licenses.mpl20;
maintainers = with maintainers; [ flokli ]; maintainers = with maintainers; [flokli];
mainProgram = "talosctl"; mainProgram = "talosctl";
}; };
} }

View file

@ -12,7 +12,6 @@
udev, udev,
wrapGAppsHook3, wrapGAppsHook3,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "termius"; pname = "termius";
version = "9.5.0"; version = "9.5.0";
@ -31,7 +30,7 @@ stdenv.mkDerivation rec {
}; };
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
categories = [ "Network" ]; categories = ["Network"];
comment = "The SSH client that works on Desktop and Mobile"; comment = "The SSH client that works on Desktop and Mobile";
desktopName = "Termius"; desktopName = "Termius";
exec = "termius-app"; exec = "termius-app";
@ -82,7 +81,7 @@ stdenv.mkDerivation rec {
install -Dm644 meta/gui/icon.png $out/share/icons/hicolor/128x128/apps/termius-app.png install -Dm644 meta/gui/icon.png $out/share/icons/hicolor/128x128/apps/termius-app.png
''; '';
runtimeDependencies = [ (lib.getLib udev) ]; runtimeDependencies = [(lib.getLib udev)];
postFixup = '' postFixup = ''
makeWrapper $out/opt/termius/termius-app $out/bin/termius-app \ makeWrapper $out/opt/termius/termius-app $out/bin/termius-app \
@ -93,13 +92,13 @@ stdenv.mkDerivation rec {
description = "A cross-platform SSH client with cloud data sync and more"; description = "A cross-platform SSH client with cloud data sync and more";
homepage = "https://termius.com/"; homepage = "https://termius.com/";
downloadPage = "https://termius.com/linux/"; downloadPage = "https://termius.com/linux/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [binaryNativeCode];
license = licenses.unfree; license = licenses.unfree;
maintainers = with maintainers; [ maintainers = with maintainers; [
Br1ght0ne Br1ght0ne
th0rgal th0rgal
]; ];
platforms = [ "x86_64-linux" ]; platforms = ["x86_64-linux"];
mainProgram = "termius-app"; mainProgram = "termius-app";
}; };
} }

View file

@ -62,13 +62,17 @@
libpulseaudio, libpulseaudio,
kerberosSupport ? true, kerberosSupport ? true,
libkrb5, libkrb5,
}: }: let
branch =
let if isSnapshot
branch = if isSnapshot then "snapshot" else "stable"; then "snapshot"
vivaldiName = if isSnapshot then "vivaldi-snapshot" else "vivaldi"; else "stable";
vivaldiName =
if isSnapshot
then "vivaldi-snapshot"
else "vivaldi";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "vivaldi"; pname = "vivaldi";
version = "6.9.3447.37"; version = "6.9.3447.37";
@ -77,7 +81,8 @@ stdenv.mkDerivation rec {
aarch64-linux = "arm64"; aarch64-linux = "arm64";
x86_64-linux = "amd64"; x86_64-linux = "amd64";
} }
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); .${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
src = fetchurl { src = fetchurl {
url = "https://downloads.vivaldi.com/${branch}/vivaldi-${branch}_${version}-1_${suffix}.deb"; url = "https://downloads.vivaldi.com/${branch}/vivaldi-${branch}_${version}-1_${suffix}.deb";
@ -86,7 +91,8 @@ stdenv.mkDerivation rec {
aarch64-linux = "sha256-kYTnWad/jrJt9z+AhjXzHYxVSIwIIO3RKD7szuPEg2s="; aarch64-linux = "sha256-kYTnWad/jrJt9z+AhjXzHYxVSIwIIO3RKD7szuPEg2s=";
x86_64-linux = "sha256-+h7SHci8gZ+epKFHD0PiXyME2xT+loD2KXpJGFCfIFg="; x86_64-linux = "sha256-+h7SHci8gZ+epKFHD0PiXyME2xT+loD2KXpJGFCfIFg=";
} }
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); .${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
}; };
unpackPhase = '' unpackPhase = ''
@ -230,7 +236,7 @@ stdenv.mkDerivation rec {
description = "Browser for our Friends, powerful and personal"; description = "Browser for our Friends, powerful and personal";
homepage = "https://vivaldi.com"; homepage = "https://vivaldi.com";
license = licenses.unfree; license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [binaryNativeCode];
mainProgram = "vivaldi"; mainProgram = "vivaldi";
maintainers = with maintainers; [ maintainers = with maintainers; [
otwieracz otwieracz
@ -241,4 +247,4 @@ stdenv.mkDerivation rec {
"aarch64-linux" "aarch64-linux"
]; ];
}; };
} }

View file

@ -4,7 +4,6 @@
lib, lib,
stdenv, stdenv,
}: }:
# This derivation roughly follows the update-ffmpeg script that ships with the official Vivaldi # This derivation roughly follows the update-ffmpeg script that ships with the official Vivaldi
# downloads at https://vivaldi.com/download/ # downloads at https://vivaldi.com/download/
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -16,7 +15,7 @@ stdenv.mkDerivation rec {
hash = "sha256-a1peHhku+OaGvPyChvLdh6/7zT+v8OHNwt60QUq7VvU="; hash = "sha256-a1peHhku+OaGvPyChvLdh6/7zT+v8OHNwt60QUq7VvU=";
}; };
buildInputs = [ squashfsTools ]; buildInputs = [squashfsTools];
unpackPhase = '' unpackPhase = ''
unsquashfs -dest . $src unsquashfs -dest . $src
@ -29,13 +28,13 @@ stdenv.mkDerivation rec {
meta = with lib; { meta = with lib; {
description = "Additional support for proprietary codecs for Vivaldi"; description = "Additional support for proprietary codecs for Vivaldi";
homepage = "https://ffmpeg.org/"; homepage = "https://ffmpeg.org/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [binaryNativeCode];
license = licenses.lgpl21; license = licenses.lgpl21;
maintainers = with maintainers; [ maintainers = with maintainers; [
betaboon betaboon
cawilliamson cawilliamson
fptje fptje
]; ];
platforms = [ "x86_64-linux" ]; platforms = ["x86_64-linux"];
}; };
} }

View file

@ -25,9 +25,7 @@
util-linux, util-linux,
socat, socat,
hicolor-icon-theme, hicolor-icon-theme,
}: }: let
let
inherit (stdenvNoCC.hostPlatform) system; inherit (stdenvNoCC.hostPlatform) system;
throwSystem = throw "Unsupported system: ${system}"; throwSystem = throw "Unsupported system: ${system}";
@ -36,19 +34,20 @@ let
x86_64-linux = "x86_64"; x86_64-linux = "x86_64";
aarch64-linux = "arm64"; aarch64-linux = "arm64";
} }
.${system} or throwSystem; .${system}
or throwSystem;
hash = hash =
{ {
x86_64-linux = "sha256-O4gl0WulhDyqL9lDwqR1oxNAzVjHn+3q0UB8KP0/sBk="; x86_64-linux = "sha256-O4gl0WulhDyqL9lDwqR1oxNAzVjHn+3q0UB8KP0/sBk=";
aarch64-linux = ""; aarch64-linux = "";
} }
.${system} or throwSystem; .${system}
or throwSystem;
displayname = "XPipe PTB"; displayname = "XPipe PTB";
in in
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
pname = "xpipe-ptb"; pname = "xpipe-ptb";
version = "13.0-10"; version = "13.0-10";
@ -87,7 +86,7 @@ stdenvNoCC.mkDerivation rec {
]; ];
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
categories = [ "Network" ]; categories = ["Network"];
comment = "XPipe (Public Test Build) releases"; comment = "XPipe (Public Test Build) releases";
desktopName = displayname; desktopName = displayname;
exec = "/opt/${pname}/cli/bin/xpipe open %U"; exec = "/opt/${pname}/cli/bin/xpipe open %U";
@ -143,17 +142,17 @@ stdenvNoCC.mkDerivation rec {
description = "XPipe (Public Test Build) releases"; description = "XPipe (Public Test Build) releases";
homepage = "https://github.com/xpipe-io/${pname}"; homepage = "https://github.com/xpipe-io/${pname}";
downloadPage = "https://github.com/xpipe-io/${pname}/releases/latest"; downloadPage = "https://github.com/xpipe-io/${pname}/releases/latest";
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [binaryNativeCode];
changelog = "https://github.com/xpipe-io/${pname}/releases/tag/${version}"; changelog = "https://github.com/xpipe-io/${pname}/releases/tag/${version}";
license = [ license = [
licenses.asl20 licenses.asl20
licenses.unfree licenses.unfree
]; ];
maintainers = with maintainers; [ crschnick ]; maintainers = with maintainers; [crschnick];
platforms = [ platforms = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
]; ];
mainProgram = pname; mainProgram = pname;
}; };
} }

View file

@ -1,8 +1,7 @@
{ ... }: {...}: let
let
finalVersion = "0.149.3"; finalVersion = "0.149.3";
in in
final: prev: { final: prev: {
zed-editor = prev.zed-editor.overrideAttrs (oldAttrs: { zed-editor = prev.zed-editor.overrideAttrs (oldAttrs: {
version = finalVersion; version = finalVersion;
src = prev.fetchFromGithub { src = prev.fetchFromGithub {
@ -12,4 +11,4 @@ final: prev: {
"blade-graphics-0.4.0" = "sha256-sGXhXmgtd7Wx/Gf7HCWro4RsQOGS4pQt8+S3T+2wMfY="; "blade-graphics-0.4.0" = "sha256-sGXhXmgtd7Wx/Gf7HCWro4RsQOGS4pQt8+S3T+2wMfY=";
}; };
}); });
} }

View file

@ -1,8 +1,4 @@
{ {disks ? ["/dev/sda"], ...}: {
disks ? [ "/dev/sda" ],
...
}:
{
disko.devices = { disko.devices = {
disk = { disk = {
main = { main = {

View file

@ -1,5 +1,8 @@
{ lib, nixpkgs, ... }:
{ {
lib,
nixpkgs,
...
}: {
## Below is to align shell/system to flake's nixpkgs ## Below is to align shell/system to flake's nixpkgs
## ref: https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry ## ref: https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry
@ -10,7 +13,7 @@
registry.nixpkgs.flake = nixpkgs; registry.nixpkgs.flake = nixpkgs;
channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead.
nixPath = [ "nixpkgs=${nixpkgs}" ]; nixPath = ["nixpkgs=${nixpkgs}"];
settings = { settings = {
# but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake.

View file

@ -1,6 +1,5 @@
{ ... }: {...}: {
{ sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# Secret for machine-specific pushover # Secret for machine-specific pushover
sops.secrets = { sops.secrets = {
"services/pushover/env" = { "services/pushover/env" = {

View file

@ -1,5 +1,8 @@
{ lib, pkgs, ... }:
{ {
lib,
pkgs,
...
}: {
system = { system = {
# Enable printing changes on nix build etc with nvd # Enable printing changes on nix build etc with nvd
activationScripts.report-changes = '' activationScripts.report-changes = ''

View file

@ -1,8 +1,10 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
boot = { boot = {
initrd.availableKernelModules = [ initrd.availableKernelModules = [
"nvme" "nvme"
"xhci_pci" "xhci_pci"
@ -11,20 +13,18 @@ with lib;
"usb_storage" "usb_storage"
"sd_mod" "sd_mod"
]; ];
kernelModules = [ ]; kernelModules = [];
extraModulePackages = [ ]; extraModulePackages = [];
# for managing/mounting nfs # for managing/mounting nfs
supportedFilesystems = [ "nfs" ]; supportedFilesystems = ["nfs"];
loader = { loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
grub.memtest86.enable = true; grub.memtest86.enable = true;
}; };
}; };
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
} }

View file

@ -1,6 +1,5 @@
{ lib, ... }: {lib, ...}: {
{ imports = [];
imports = [ ];
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
@ -12,9 +11,9 @@
"usbhid" "usbhid"
"sr_mod" "sr_mod"
]; ];
initrd.kernelModules = [ ]; initrd.kernelModules = [];
kernelModules = [ ]; kernelModules = [];
extraModulePackages = [ ]; extraModulePackages = [];
}; };
mySystem = { mySystem = {

View file

@ -1,5 +1,4 @@
{ lib, ... }: {lib, ...}: {
{
mySystem = { mySystem = {
security.wheelNeedsSudoPassword = false; security.wheelNeedsSudoPassword = false;
}; };

View file

@ -1,8 +1,11 @@
{ lib, pkgs, ... }:
{ {
lib,
pkgs,
...
}: {
boot = { boot = {
# for managing/mounting nfs # for managing/mounting nfs
supportedFilesystems = [ "nfs" ]; supportedFilesystems = ["nfs"];
loader = { loader = {
grub = { grub = {
@ -11,7 +14,7 @@
efiInstallAsRemovable = true; efiInstallAsRemovable = true;
mirroredBoots = [ mirroredBoots = [
{ {
devices = [ "nodev" ]; devices = ["nodev"];
path = "/boot"; path = "/boot";
} }
]; ];

View file

@ -1,7 +1,10 @@
{ lib, pkgs, ... }:
# Role for headless servers
with lib;
{ {
lib,
pkgs,
...
}:
# Role for headless servers
with lib; {
config = { config = {
mySystem = { mySystem = {
services.rebootRequiredCheck.enable = true; services.rebootRequiredCheck.enable = true;
@ -20,7 +23,7 @@ with lib;
}; };
environment = { environment = {
systemPackages = [ pkgs.unstable.lazygit ]; systemPackages = [pkgs.unstable.lazygit];
}; };
documentation = { documentation = {

View file

@ -1,9 +1,9 @@
# Need the unstable nixpkgs to get latest dev tools # Need the unstable nixpkgs to get latest dev tools
let let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz"; nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
pkgs = import nixpkgs { allowUnfree = true; }; pkgs = import nixpkgs {allowUnfree = true;};
in in
pkgs.mkShell { pkgs.mkShell {
# Enable experimental features without having to specify the argument # Enable experimental features without having to specify the argument
NIX_CONFIG = "experimental-features = nix-command flakes"; NIX_CONFIG = "experimental-features = nix-command flakes";
shellHook = '' shellHook = ''
@ -21,4 +21,4 @@ pkgs.mkShell {
sops sops
statix statix
]; ];
} }