Apply treefmt

This commit is contained in:
teutat3s 2023-01-28 23:51:33 +01:00
parent 7a7ff7b1df
commit 9732e4edf1
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
20 changed files with 170 additions and 218 deletions

View file

@ -230,22 +230,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1642700792, "lastModified": 1642700792,
@ -311,21 +295,6 @@
} }
}, },
"flake-utils_4": { "flake-utils_4": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
@ -546,28 +515,6 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nvfetcher": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_4",
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1672979485,
"narHash": "sha256-LrY0K1yya3nvRlGDc98wm68ozVj7E6a1EXXEr7eHp8E=",
"owner": "berberman",
"repo": "nvfetcher",
"rev": "0a9ac5fd07b52467d81163b1f8c94c12e5c9aff9",
"type": "github"
},
"original": {
"owner": "berberman",
"repo": "nvfetcher",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -583,13 +530,12 @@
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nur": "nur", "nur": "nur",
"nvfetcher": "nvfetcher",
"triton-vmtools": "triton-vmtools" "triton-vmtools": "triton-vmtools"
} }
}, },
"triton-vmtools": { "triton-vmtools": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_4",
"nixpkgs": [ "nixpkgs": [
"nixos" "nixos"
] ]

View file

@ -38,8 +38,6 @@
nixos-generators.url = "github:nix-community/nixos-generators"; nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.url = "github:nix-community/nixos-generators";
triton-vmtools.url = "git+https://git.b12f.io/pub-solar/infra?ref=main&dir=vmtools"; triton-vmtools.url = "git+https://git.b12f.io/pub-solar/infra?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixos"; triton-vmtools.inputs.nixpkgs.follows = "nixos";
@ -47,18 +45,18 @@
keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixos"; keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixos";
}; };
outputs = outputs = {
{ self self,
, digga digga,
, nixos nixos,
, home home,
, nixos-hardware nixos-hardware,
, nur nur,
, agenix agenix,
, deploy deploy,
, triton-vmtools triton-vmtools,
, keycloak-theme-pub-solar keycloak-theme-pub-solar,
, ... ...
} @ inputs: } @ inputs:
digga.lib.mkFlake digga.lib.mkFlake
{ {
@ -142,19 +140,20 @@
anonymous = [pubsolaros users.pub-solar]; anonymous = [pubsolaros users.pub-solar];
}; };
}; };
};
home = { home = {
imports = [ (digga.lib.importExportableModules ./users/modules) ]; imports = [(digga.lib.importExportableModules ./users/modules)];
modules = [ ]; modules = [];
importables = rec { importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles; profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec { suites = with profiles; rec {
base = [ direnv git ]; base = [direnv git];
}; };
}; };
users = { users = {
pub-solar = { suites, ... }: { imports = suites.base; }; pub-solar = {suites, ...}: {imports = suites.base;};
barkeeper = { suites, ... }: { imports = suites.base; }; barkeeper = {suites, ...}: {imports = suites.base;};
}; # digga.lib.importers.rakeLeaves ./users/hm; }; # digga.lib.importers.rakeLeaves ./users/hm;
}; };
@ -169,5 +168,4 @@
}; };
}; };
}; };
};
} }

View file

@ -1,10 +1,10 @@
{ config
, lib
, pkgs
, self
, ...
}:
{ {
config,
lib,
pkgs,
self,
...
}: {
services.caddy = { services.caddy = {
enable = lib.mkForce true; enable = lib.mkForce true;
email = "admins@pub.solar"; email = "admins@pub.solar";
@ -79,8 +79,7 @@
reverse_proxy obs-portal.svc.e5756d08-36fd-424b-f8bc-acdb92ca7b82.lev-1.int.greenbaum.zone:3000 reverse_proxy obs-portal.svc.e5756d08-36fd-424b-f8bc-acdb92ca7b82.lev-1.int.greenbaum.zone:3000
''; '';
}; };
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [80 443];
} }

View file

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

View file

@ -1,16 +1,15 @@
{ config
, latestModulesPath
, lib
, inputs
, pkgs
, profiles
, self
, ...
}:
let
psCfg = config.pub-solar;
in
{ {
config,
latestModulesPath,
lib,
inputs,
pkgs,
profiles,
self,
...
}: let
psCfg = config.pub-solar;
in {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -46,11 +45,11 @@ in
# Allow sudo without a password for the barkeeper user # Allow sudo without a password for the barkeeper user
security.sudo.extraRules = [ security.sudo.extraRules = [
{ {
users = [ "${psCfg.user.name}" ]; users = ["${psCfg.user.name}"];
commands = [ commands = [
{ {
command = "ALL"; command = "ALL";
options = [ "NOPASSWD" ]; options = ["NOPASSWD"];
} }
]; ];
} }
@ -65,7 +64,7 @@ in
isSystemUser = true; isSystemUser = true;
}; };
users.groups.hakkonaut = { }; users.groups.hakkonaut = {};
# # # # # #
# # # Triton host specific options # # # Triton host specific options

View file

@ -1,10 +1,10 @@
{ config
, lib
, pkgs
, self
, ...
}:
{ {
config,
lib,
pkgs,
self,
...
}: {
age.secrets.gitea-database-password = { age.secrets.gitea-database-password = {
file = "${self}/secrets/gitea-database-password.age"; file = "${self}/secrets/gitea-database-password.age";
mode = "600"; mode = "600";

View file

@ -1,31 +1,32 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = [ ]; config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [];
boot.initrd.availableKernelModules = [ "ahci" "virtio_pci" "xhci_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = ["ahci" "virtio_pci" "xhci_pci" "sr_mod" "virtio_blk"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ ]; boot.kernelModules = [];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
autoResize = true; autoResize = true;
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{
device = "/dev/disk/by-label/boot"; device = "/dev/disk/by-label/boot";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/data" = fileSystems."/data" = {
{
device = "/dev/disk/by-label/ephemeral0"; device = "/dev/disk/by-label/ephemeral0";
fsType = "ext4"; fsType = "ext4";
options = [ options = [
@ -34,7 +35,7 @@
]; ];
}; };
swapDevices = [ ]; swapDevices = [];
networking.useDHCP = lib.mkDefault false; networking.useDHCP = lib.mkDefault false;
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = lib.mkForce false;

View file

@ -1,11 +1,11 @@
{ config
, lib
, inputs
, pkgs
, self
, ...
}:
{ {
config,
lib,
inputs,
pkgs,
self,
...
}: {
age.secrets.keycloak-database-password = { age.secrets.keycloak-database-password = {
file = "${self}/secrets/keycloak-database-password.age"; file = "${self}/secrets/keycloak-database-password.age";
mode = "700"; mode = "700";

View file

@ -1,5 +1,8 @@
{ pkgs, inputs, ... }:
{ {
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
inputs.triton-vmtools.packages.${pkgs.system}.default inputs.triton-vmtools.packages.${pkgs.system}.default
]; ];

View file

@ -1,12 +1,12 @@
{ config {
, pkgs config,
, lib pkgs,
, ... lib,
...
}: }:
with lib; let with lib; let
cfg = config.pub-solar.core; cfg = config.pub-solar.core;
in in {
{
options.pub-solar.core = { options.pub-solar.core = {
enableCaddy = mkOption { enableCaddy = mkOption {
type = types.bool; type = types.bool;
@ -19,12 +19,12 @@ in
binaryCaches = mkOption { binaryCaches = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [];
description = "Binary caches to use."; description = "Binary caches to use.";
}; };
publicKeys = mkOption { publicKeys = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ]; default = [];
description = "Public keys of binary caches."; description = "Public keys of binary caches.";
}; };
}; };
@ -48,10 +48,10 @@ in
# These entries get added to /etc/hosts # These entries get added to /etc/hosts
networking.hosts = { networking.hosts = {
"127.0.0.1" = "127.0.0.1" =
[ ] []
++ lib.optionals cfg.enableCaddy [ "caddy.local" ] ++ lib.optionals cfg.enableCaddy ["caddy.local"]
++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] ++ lib.optionals config.pub-solar.printing.enable ["cups.local"]
++ lib.optionals cfg.enableHelp [ "help.local" ]; ++ lib.optionals cfg.enableHelp ["help.local"];
}; };
# Caddy reverse proxy for local services like cups # Caddy reverse proxy for local services like cups

View file

@ -1,8 +1,9 @@
{ config {
, pkgs config,
, lib pkgs,
, inputs lib,
, ... inputs,
...
}: { }: {
nix = { nix = {
# Use default version alias for nix package # Use default version alias for nix package
@ -15,9 +16,9 @@
# Prevents impurities in builds # Prevents impurities in builds
sandbox = true; sandbox = true;
# give root and @wheel special privileges with nix # give root and @wheel special privileges with nix
trusted-users = [ "root" "@wheel" ]; trusted-users = ["root" "@wheel"];
# This is just a representation of the nix default # This is just a representation of the nix default
system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; system-features = ["nixos-test" "benchmark" "big-parallel" "kvm"];
}; };
# Generally useful nix option defaults # Generally useful nix option defaults
extraOptions = '' extraOptions = ''

View file

@ -1,13 +1,13 @@
{ lib {
, config lib,
, pkgs config,
, ... pkgs,
...
}: }:
with lib; let with lib; let
psCfg = config.pub-solar; psCfg = config.pub-solar;
cfg = config.pub-solar.docker; cfg = config.pub-solar.docker;
in in {
{
options.pub-solar.docker = { options.pub-solar.docker = {
enable = mkEnableOption "Life in metal boxes"; enable = mkEnableOption "Life in metal boxes";
}; };
@ -15,8 +15,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
users.users = with pkgs; users.users = with pkgs;
pkgs.lib.setAttrByPath [ psCfg.user.name ] { pkgs.lib.setAttrByPath [psCfg.user.name] {
extraGroups = [ "docker" ]; extraGroups = ["docker"];
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View file

@ -1,12 +1,12 @@
{ lib {
, config lib,
, pkgs config,
, ... pkgs,
...
}: }:
with lib; let with lib; let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in in {
{
options.pub-solar.sway = { options.pub-solar.sway = {
enable = mkEnableOption "Life in boxes"; enable = mkEnableOption "Life in boxes";
@ -25,8 +25,8 @@ in
config = mkIf psCfg.sway.enable (mkMerge [ config = mkIf psCfg.sway.enable (mkMerge [
(mkIf (psCfg.sway.v4l2loopback.enable) { (mkIf (psCfg.sway.v4l2loopback.enable) {
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];
boot.kernelModules = [ "v4l2loopback" ]; boot.kernelModules = ["v4l2loopback"];
boot.extraModprobeConfig = '' boot.extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 devices=3 options v4l2loopback exclusive_caps=1 devices=3
''; '';
@ -51,13 +51,13 @@ in
}; };
}; };
}; };
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; extraPortals = with pkgs; [xdg-desktop-portal-gtk];
}; };
services.pipewire.enable = true; services.pipewire.enable = true;
home-manager = with pkgs; home-manager = with pkgs;
pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
home.packages = with pkgs; [ home.packages = with pkgs; [
sway sway
grim grim
@ -96,12 +96,12 @@ in
systemd.user.services.waybar = import ./waybar.service.nix {inherit pkgs psCfg;}; systemd.user.services.waybar = import ./waybar.service.nix {inherit pkgs psCfg;};
systemd.user.targets.sway-session = import ./sway-session.target.nix {inherit pkgs psCfg;}; systemd.user.targets.sway-session = import ./sway-session.target.nix {inherit pkgs psCfg;};
xdg.configFile."sway/config".text = import ./config/config.nix { inherit config pkgs; }; xdg.configFile."sway/config".text = import ./config/config.nix {inherit config pkgs;};
xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf; xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf;
xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf; xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf;
xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf; xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf;
xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf; xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf;
xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix { inherit pkgs psCfg; }; xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix {inherit pkgs psCfg;};
xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf; xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf;
xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf; xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf;
}; };

View file

@ -40,7 +40,8 @@ in {
screen screen
]; ];
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home-manager = with pkgs;
pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
home.packages = [ home.packages = [
ack ack
asciinema asciinema

View file

@ -1,4 +1,5 @@
self: with self; let self:
with self; let
looking-glass-client = self.looking-glass-client.overrideAttrs (old: { looking-glass-client = self.looking-glass-client.overrideAttrs (old: {
meta.platforms = ["x86_64-linux" "aarch64-linux"]; meta.platforms = ["x86_64-linux" "aarch64-linux"];
}); });

View file

@ -1,4 +1,5 @@
self: with self; let self:
with self; let
websocket-client = python39.pkgs.buildPythonPackage rec { websocket-client = python39.pkgs.buildPythonPackage rec {
pname = "websocket-client"; pname = "websocket-client";
version = "1.2.1"; version = "1.2.1";

View file

@ -1,4 +1,5 @@
self: with self; let self:
with self; let
uhk-agent-bin = stdenv.mkDerivation rec { uhk-agent-bin = stdenv.mkDerivation rec {
pname = "uhk-agent-bin"; pname = "uhk-agent-bin";
version = "1.5.14"; version = "1.5.14";

View file

@ -1,14 +1,13 @@
{ pkgs {
, lib pkgs,
, ... lib,
}: ...
let }: let
folder = ./.; folder = ./.;
toImport = name: value: folder + ("/" + name); toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix";
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in in {
{
inherit imports; inherit imports;
nix.settings.substituters = [ "https://cache.nixos.org/" ]; nix.settings.substituters = ["https://cache.nixos.org/"];
} }

View file

@ -2,10 +2,9 @@ let
# set ssh public keys here for your system and user # set ssh public keys here for your system and user
teutat3s = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms"; teutat3s = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms";
flora-6 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGP1InpTBN4AlF/4V8HHumAMLJzeO8DpzjUv9Co/+J09 root@pub-solar-infra-vm-1"; flora-6 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGP1InpTBN4AlF/4V8HHumAMLJzeO8DpzjUv9Co/+J09 root@pub-solar-infra-vm-1";
allKeys = [ flora-6 teutat3s ]; allKeys = [flora-6 teutat3s];
deployKeys = [ flora-6 teutat3s ]; deployKeys = [flora-6 teutat3s];
in in {
{
"gitea-database-password.age".publicKeys = deployKeys; "gitea-database-password.age".publicKeys = deployKeys;
"gitea-mailer-password.age".publicKeys = deployKeys; "gitea-mailer-password.age".publicKeys = deployKeys;
"keycloak-database-password.age".publicKeys = deployKeys; "keycloak-database-password.age".publicKeys = deployKeys;

View file

@ -1,10 +1,14 @@
{ config, hmUsers, pkgs, lib, ... }:
let
psCfg = config.pub-solar;
in
{ {
config,
hmUsers,
pkgs,
lib,
...
}: let
psCfg = config.pub-solar;
in {
config = { config = {
home-manager.users = { inherit (hmUsers) barkeeper; }; home-manager.users = {inherit (hmUsers) barkeeper;};
pub-solar = { pub-solar = {
# These are your personal settings # These are your personal settings