summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-06-30 09:56:30 -0400
committerseth <[email protected]>2024-06-30 10:23:04 -0400
commit088facf700946cb8f2d96c6089185bdc2a67180a (patch)
treec5b4e4cffbb3ee4ad2498c2251892bd457e9d3c7
parent5d3045a0769af3a94fba7b5cf646e8498aaef595 (diff)
alejandra -> nixfmt-rfc-style
-rw-r--r--checks.nix43
-rw-r--r--devShells.nix59
-rw-r--r--ext/openwrt.nix25
-rw-r--r--ext/terranix/cloudflare/dns.nix78
-rw-r--r--ext/terranix/cloudflare/pages_domains.nix26
-rw-r--r--ext/terranix/cloudflare/pages_projects.nix39
-rw-r--r--ext/terranix/cloudflare/ruleset.nix3
-rw-r--r--ext/terranix/cloudflare/tls.nix6
-rw-r--r--ext/terranix/cloudflare/tunnels.nix16
-rw-r--r--ext/terranix/default.nix41
-rw-r--r--ext/terranix/tailscale/acl.nix65
-rw-r--r--ext/terranix/tailscale/default.nix3
-rw-r--r--ext/terranix/tailscale/devices.nix19
-rw-r--r--ext/terranix/tailscale/tags.nix17
-rw-r--r--ext/terranix/versions.nix15
-rw-r--r--flake.nix17
-rw-r--r--hydraJobs.nix29
-rw-r--r--lib/default.nix9
-rw-r--r--lib/lib.nix66
-rw-r--r--lib/nginx.nix5
-rw-r--r--modules/darwin/archetypes/default.nix6
-rw-r--r--modules/darwin/archetypes/personal.nix10
-rw-r--r--modules/darwin/base/programs.nix10
-rw-r--r--modules/darwin/desktop/default.nix3
-rw-r--r--modules/darwin/desktop/fonts.nix14
-rw-r--r--modules/darwin/desktop/homebrew.nix14
-rw-r--r--modules/darwin/desktop/programs.nix14
-rw-r--r--modules/darwin/traits/home-manager.nix5
-rw-r--r--modules/darwin/traits/users/default.nix6
-rw-r--r--modules/darwin/traits/users/seth.nix10
-rw-r--r--modules/nixos/archetypes/personal.nix10
-rw-r--r--modules/nixos/archetypes/server.nix10
-rw-r--r--modules/nixos/base/default.nix3
-rw-r--r--modules/nixos/base/documentation.nix11
-rw-r--r--modules/nixos/base/networking.nix14
-rw-r--r--modules/nixos/base/nix.nix15
-rw-r--r--modules/nixos/base/programs.nix10
-rw-r--r--modules/nixos/base/security.nix14
-rw-r--r--modules/nixos/base/users.nix22
-rw-r--r--modules/nixos/desktop/audio.nix14
-rw-r--r--modules/nixos/desktop/budgie/default.nix6
-rw-r--r--modules/nixos/desktop/default.nix14
-rw-r--r--modules/nixos/desktop/fonts.nix26
-rw-r--r--modules/nixos/desktop/gnome/default.nix6
-rw-r--r--modules/nixos/desktop/plasma/default.nix6
-rw-r--r--modules/nixos/desktop/programs.nix15
-rw-r--r--modules/nixos/server/default.nix10
-rw-r--r--modules/nixos/server/host-user.nix20
-rw-r--r--modules/nixos/server/mixins/acme.nix18
-rw-r--r--modules/nixos/server/mixins/cloudflared.nix18
-rw-r--r--modules/nixos/server/mixins/hercules.nix46
-rw-r--r--modules/nixos/server/mixins/nginx.nix10
-rw-r--r--modules/nixos/server/mixins/promtail.nix14
-rw-r--r--modules/nixos/traits/24.05-compat.nix16
-rw-r--r--modules/nixos/traits/auto-upgrade.nix22
-rw-r--r--modules/nixos/traits/containers.nix14
-rw-r--r--modules/nixos/traits/home-manager.nix5
-rw-r--r--modules/nixos/traits/locale.nix14
-rw-r--r--modules/nixos/traits/nvidia.nix64
-rw-r--r--modules/nixos/traits/secrets.nix10
-rw-r--r--modules/nixos/traits/tailscale.nix20
-rw-r--r--modules/nixos/traits/users/default.nix6
-rw-r--r--modules/nixos/traits/users/seth.nix14
-rw-r--r--modules/nixos/traits/zram.nix10
-rw-r--r--modules/shared/base/default.nix6
-rw-r--r--modules/shared/base/documentation.nix14
-rw-r--r--modules/shared/base/nix.nix21
-rw-r--r--modules/shared/base/programs.nix18
-rw-r--r--modules/shared/traits/home-manager.nix10
-rw-r--r--modules/shared/traits/locale.nix16
-rw-r--r--modules/shared/traits/users/default.nix6
-rw-r--r--modules/shared/traits/users/seth.nix10
-rw-r--r--secrets/secrets.nix6
-rw-r--r--secrets/toSecrets.nix34
-rw-r--r--systems/atlas/default.nix5
-rw-r--r--systems/atlas/hardware-configuration.nix20
-rw-r--r--systems/atlas/miniflux.nix7
-rw-r--r--systems/atlas/nginx.nix10
-rw-r--r--systems/atlas/nixpkgs-tracker-bot.nix5
-rw-r--r--systems/atlas/teawiebot.nix5
-rw-r--r--systems/caroline/default.nix5
-rw-r--r--systems/darwin.nix15
-rw-r--r--systems/glados-wsl/default.nix3
-rw-r--r--systems/glados/boot.nix9
-rw-r--r--systems/glados/default.nix5
-rw-r--r--systems/glados/hardware-configuration.nix50
-rw-r--r--systems/nixinate.nix13
-rw-r--r--systems/nixos.nix23
-rw-r--r--users/default.nix23
-rw-r--r--users/seth/base/default.nix18
-rw-r--r--users/seth/base/standalone.nix12
-rw-r--r--users/seth/desktop/budgie/default.nix16
-rw-r--r--users/seth/desktop/default.nix32
-rw-r--r--users/seth/desktop/gnome/default.nix10
-rw-r--r--users/seth/desktop/plasma/default.nix10
-rw-r--r--users/seth/home.nix2
-rw-r--r--users/seth/programs/chromium.nix24
-rw-r--r--users/seth/programs/default.nix14
-rw-r--r--users/seth/programs/firefox/arkenfox.nix103
-rw-r--r--users/seth/programs/firefox/default.nix18
-rw-r--r--users/seth/programs/git.nix27
-rw-r--r--users/seth/programs/gpg.nix10
-rw-r--r--users/seth/programs/mangohud.nix18
-rw-r--r--users/seth/programs/neovim.nix22
-rw-r--r--users/seth/programs/ssh.nix62
-rw-r--r--users/seth/programs/starship/default.nix26
-rw-r--r--users/seth/programs/vim.nix10
-rw-r--r--users/seth/programs/vscode.nix14
-rw-r--r--users/seth/shell/bash.nix14
-rw-r--r--users/seth/shell/default.nix18
-rw-r--r--users/seth/shell/fish.nix27
-rw-r--r--users/seth/shell/nu.nix6
-rw-r--r--users/seth/shell/zsh.nix10
113 files changed, 1095 insertions, 967 deletions
diff --git a/checks.nix b/checks.nix
index 69a8818..b813d83 100644
--- a/checks.nix
+++ b/checks.nix
@@ -1,24 +1,23 @@
-{inputs, ...}: {
- perSystem = {
- lib,
- pkgs,
- ...
- }: {
- checks = {
- inherit
- (inputs.flake-checks.lib.mkChecks {
- inherit pkgs;
- root = lib.fileset.toSource {
- root = ./.;
- fileset = lib.fileset.gitTracked ./.;
- };
- })
- actionlint
- alejandra
- deadnix
- editorconfig
- statix
- ;
+{ inputs, ... }:
+{
+ perSystem =
+ { lib, pkgs, ... }:
+ {
+ checks = {
+ inherit
+ (inputs.flake-checks.lib.mkChecks {
+ inherit pkgs;
+ root = lib.fileset.toSource {
+ root = ./.;
+ fileset = lib.fileset.gitTracked ./.;
+ };
+ })
+ actionlint
+ alejandra
+ deadnix
+ editorconfig
+ statix
+ ;
+ };
};
- };
}
diff --git a/devShells.nix b/devShells.nix
index aa24e33..dd22cd4 100644
--- a/devShells.nix
+++ b/devShells.nix
@@ -1,33 +1,38 @@
{
- perSystem = {
- lib,
- pkgs,
- inputs',
- self',
- ...
- }: {
- devShells = {
- default = pkgs.mkShellNoCC {
- packages =
- [
- pkgs.nix
+ perSystem =
+ {
+ lib,
+ pkgs,
+ inputs',
+ self',
+ ...
+ }:
+ {
+ devShells = {
+ default = pkgs.mkShellNoCC {
+ packages =
+ [
+ pkgs.nix
- # format + lint
- pkgs.actionlint
- self'.formatter
- pkgs.deadnix
- pkgs.nil
- pkgs.statix
+ # format + lint
+ pkgs.actionlint
+ self'.formatter
+ pkgs.deadnix
+ pkgs.nil
+ pkgs.statix
- # utils
- pkgs.deploy-rs
- pkgs.fzf
- pkgs.just
- self'.packages.opentofu
- ]
- ++ lib.optional pkgs.stdenv.isDarwin [inputs'.nix-darwin.packages.darwin-rebuild]
- ++ lib.optionals pkgs.stdenv.isLinux [pkgs.nixos-rebuild inputs'.agenix.packages.agenix];
+ # utils
+ pkgs.deploy-rs
+ pkgs.fzf
+ pkgs.just
+ self'.packages.opentofu
+ ]
+ ++ lib.optional pkgs.stdenv.isDarwin [ inputs'.nix-darwin.packages.darwin-rebuild ]
+ ++ lib.optionals pkgs.stdenv.isLinux [
+ pkgs.nixos-rebuild
+ inputs'.agenix.packages.agenix
+ ];
+ };
};
};
- };
}
diff --git a/ext/openwrt.nix b/ext/openwrt.nix
index f02f8ef..8b39358 100644
--- a/ext/openwrt.nix
+++ b/ext/openwrt.nix
@@ -3,30 +3,33 @@
inputs,
withSystem,
...
-}: let
- pkgs = withSystem "x86_64-linux" ({pkgs, ...}: pkgs);
+}:
+let
+ pkgs = withSystem "x86_64-linux" ({ pkgs, ... }: pkgs);
- profileFromRelease = release:
- (inputs.openwrt-imagebuilder.lib.profiles {
- inherit pkgs release;
- })
- .identifyProfile;
+ profileFromRelease =
+ release: (inputs.openwrt-imagebuilder.lib.profiles { inherit pkgs release; }).identifyProfile;
- mkImage = {profile, ...} @ args:
+ mkImage =
+ { profile, ... }@args:
inputs.openwrt-imagebuilder.lib.build (
profileFromRelease args.release profile
- // builtins.removeAttrs args ["profile" "release"]
+ // builtins.removeAttrs args [
+ "profile"
+ "release"
+ ]
);
mapImages = lib.mapAttrs (lib.const mkImage);
-in {
+in
+{
flake.legacyPackages.x86_64-linux = {
openWrtImages = mapImages {
turret = {
release = "23.05.0";
profile = "netgear_wac104";
- files = pkgs.runCommand "image-files" {} ''
+ files = pkgs.runCommand "image-files" { } ''
mkdir -p $out/etc/uci-defaults
cat > $out/etc/uci-defaults/99-custom << EOF
diff --git a/ext/terranix/cloudflare/dns.nix b/ext/terranix/cloudflare/dns.nix
index 4da90ab..4be834c 100644
--- a/ext/terranix/cloudflare/dns.nix
+++ b/ext/terranix/cloudflare/dns.nix
@@ -1,52 +1,60 @@
-{lib, ...}: let
- mkRecord = {
- name,
- value,
- type,
- zone_id,
- }:
+{ lib, ... }:
+let
+ mkRecord =
{
- inherit name value type zone_id;
+ name,
+ value,
+ type,
+ zone_id,
+ }:
+ {
+ inherit
+ name
+ value
+ type
+ zone_id
+ ;
ttl = 1;
}
- // lib.optionalAttrs (type != "TXT") {proxied = true;};
+ // lib.optionalAttrs (type != "TXT") { proxied = true; };
zones = {
getchoo_com = lib.tfRef "var.getchoo_com_zone_id";
};
- inherit
- (zones)
- getchoo_com
- ;
+ inherit (zones) getchoo_com;
atlas_tunnel = lib.tfRef "data.cloudflare_tunnel.atlas-nginx.id" + ".cfargotunnel.com";
pagesSubdomainFor = project: lib.tfRef "resource.cloudflare_pages_project.${project}.subdomain";
- blockEmailSpoofingFor = domain: let
- zone_id = zones.${domain};
- in {
- "${domain}_dmarc" = {
- name = "_dmarc";
- value = "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s;";
- type = "TXT";
- inherit zone_id;
- };
+ blockEmailSpoofingFor =
+ domain:
+ let
+ zone_id = zones.${domain};
+ in
+ {
+ "${domain}_dmarc" = {
+ name = "_dmarc";
+ value = "v=DMARC1; p=reject; sp=reject; adkim=s; aspf=s;";
+ type = "TXT";
+ inherit zone_id;
+ };
- "${domain}_domainkey" = {
- name = "*._domainkey";
- value = "v=DKIM1; p=";
- type = "TXT";
- inherit zone_id;
- };
+ "${domain}_domainkey" = {
+ name = "*._domainkey";
+ value = "v=DKIM1; p=";
+ type = "TXT";
+ inherit zone_id;
+ };
- "${domain}_email" = {
- name = "@";
- value = "v=spf1 -all";
- type = "TXT";
- inherit zone_id;
+ "${domain}_email" = {
+ name = "@";
+ value = "v=spf1 -all";
+ type = "TXT";
+ inherit zone_id;
+ };
};
- };
-in {
+in
+{
resource.cloudflare_zone_dnssec = {
getchoo_com_dnssec = {
zone_id = getchoo_com;
diff --git a/ext/terranix/cloudflare/pages_domains.nix b/ext/terranix/cloudflare/pages_domains.nix
index c3c45bb..531b2de 100644
--- a/ext/terranix/cloudflare/pages_domains.nix
+++ b/ext/terranix/cloudflare/pages_domains.nix
@@ -1,30 +1,32 @@
-{lib, ...}: let
- setDomainsFor = {
- account_id,
- project,
- domains,
- }:
+{ lib, ... }:
+let
+ setDomainsFor =
+ {
+ account_id,
+ project,
+ domains,
+ }:
lib.listToAttrs (
map (domain: {
- name = "${project}_${builtins.replaceStrings ["."] ["_"] domain}";
+ name = "${project}_${builtins.replaceStrings [ "." ] [ "_" ] domain}";
value = {
inherit account_id;
project_name = lib.tfRef "resource.cloudflare_pages_project.${project}.name";
inherit domain;
};
- })
- domains
+ }) domains
);
-in {
+in
+{
resource.cloudflare_pages_domain =
setDomainsFor {
account_id = lib.tfRef "var.account_id";
project = "personal_website";
- domains = ["getchoo.com"];
+ domains = [ "getchoo.com" ];
}
// setDomainsFor {
account_id = lib.tfRef "var.account_id";
project = "teawie_api";
- domains = ["api.getchoo.com"];
+ domains = [ "api.getchoo.com" ];
};
}
diff --git a/ext/terranix/cloudflare/pages_projects.nix b/ext/terranix/cloudflare/pages_projects.nix
index 5b6e64e..37ca785 100644
--- a/ext/terranix/cloudflare/pages_projects.nix
+++ b/ext/terranix/cloudflare/pages_projects.nix
@@ -1,15 +1,16 @@
-{lib, ...}: let
- getGitHubRepo = {
- owner,
- repo_name,
- }: {
- type = "github";
- config = {
- inherit owner repo_name;
- production_branch = "main";
+{ lib, ... }:
+let
+ getGitHubRepo =
+ { owner, repo_name }:
+ {
+ type = "github";
+ config = {
+ inherit owner repo_name;
+ production_branch = "main";
+ };
};
- };
-in {
+in
+{
resource.cloudflare_pages_project = {
personal_website = {
account_id = lib.tfRef "var.account_id";
@@ -27,14 +28,16 @@ in {
destination_dir = "/dist";
};
- deployment_configs = let
- environment_variables = {
- MINIFLUX_URL = "https://miniflux.getchoo.com";
+ deployment_configs =
+ let
+ environment_variables = {
+ MINIFLUX_URL = "https://miniflux.getchoo.com";
+ };
+ in
+ {
+ production = [ { inherit environment_variables; } ];
+ preview = [ { inherit environment_variables; } ];
};
- in {
- production = [{inherit environment_variables;}];
- preview = [{inherit environment_variables;}];
- };
};
teawie_api = {
diff --git a/ext/terranix/cloudflare/ruleset.nix b/ext/terranix/cloudflare/ruleset.nix
index 9f611c4..98364d9 100644
--- a/ext/terranix/cloudflare/ruleset.nix
+++ b/ext/terranix/cloudflare/ruleset.nix
@@ -1,4 +1,5 @@
-{lib, ...}: {
+{ lib, ... }:
+{
resource.cloudflare_ruleset = {
getchoo_com_redirects = {
kind = "zone";
diff --git a/ext/terranix/cloudflare/tls.nix b/ext/terranix/cloudflare/tls.nix
index 1fcc7ac..77450ad 100644
--- a/ext/terranix/cloudflare/tls.nix
+++ b/ext/terranix/cloudflare/tls.nix
@@ -1,9 +1,11 @@
-{lib, ...}: let
+{ lib, ... }:
+let
baseSettings = {
always_use_https = "on";
ssl = "strict";
};
-in {
+in
+{
resource.cloudflare_zone_settings_override = {
getchoo_com_settings = {
zone_id = lib.tfRef "var.getchoo_com_zone_id";
diff --git a/ext/terranix/cloudflare/tunnels.nix b/ext/terranix/cloudflare/tunnels.nix
index f745deb..0bbf6f6 100644
--- a/ext/terranix/cloudflare/tunnels.nix
+++ b/ext/terranix/cloudflare/tunnels.nix
@@ -1,13 +1,9 @@
-{lib, ...}: {
- data.cloudflare_tunnel =
- lib.genAttrs
- [
- "atlas-nginx"
- ]
- (name: {
- inherit name;
- account_id = lib.tfRef "var.account_id";
- });
+{ lib, ... }:
+{
+ data.cloudflare_tunnel = lib.genAttrs [ "atlas-nginx" ] (name: {
+ inherit name;
+ account_id = lib.tfRef "var.account_id";
+ });
resource.cloudflare_authenticated_origin_pulls = {
getchoo_com_origin = {
diff --git a/ext/terranix/default.nix b/ext/terranix/default.nix
index c70d4d8..44ede51 100644
--- a/ext/terranix/default.nix
+++ b/ext/terranix/default.nix
@@ -1,25 +1,24 @@
-{inputs, ...}: {
- perSystem = {
- pkgs,
- system,
- ...
- }: {
- packages = {
- opentofu = pkgs.opentofu.withPlugins (plugins: [
- plugins.cloudflare
- plugins.tailscale
- ]);
+{ inputs, ... }:
+{
+ perSystem =
+ { pkgs, system, ... }:
+ {
+ packages = {
+ opentofu = pkgs.opentofu.withPlugins (plugins: [
+ plugins.cloudflare
+ plugins.tailscale
+ ]);
- terranix = inputs.terranix.lib.terranixConfiguration {
- inherit system;
- modules = [
- ./cloudflare
- ./tailscale
- ./cloud.nix
- ./vars.nix
- ./versions.nix
- ];
+ terranix = inputs.terranix.lib.terranixConfiguration {
+ inherit system;
+ modules = [
+ ./cloudflare
+ ./tailscale
+ ./cloud.nix
+ ./vars.nix
+ ./versions.nix
+ ];
+ };
};
};
- };
}
diff --git a/ext/terranix/tailscale/acl.nix b/ext/terranix/tailscale/acl.nix
index 338e373..80e3537 100644
--- a/ext/terranix/tailscale/acl.nix
+++ b/ext/terranix/tailscale/acl.nix
@@ -1,24 +1,51 @@
-{lib, ...}: {
+{ lib, ... }:
+{
resource.tailscale_acl.default = {
- acl = toString (builtins.toJSON {
- tagOwners = let
- me = ["getchoo@github"];
- tags = map (name: "tag:${name}") ["server" "personal"];
- in
- lib.genAttrs tags (_: me);
+ acl = toString (
+ builtins.toJSON {
+ tagOwners =
+ let
+ me = [ "getchoo@github" ];
+ tags = map (name: "tag:${name}") [
+ "server"
+ "personal"
+ ];
+ in
+ lib.genAttrs tags (_: me);
- acls = let
- mkAcl = action: src: dst: {inherit action src dst;};
- in [
- (mkAcl "accept" ["tag:personal"] ["*:*"])
- (mkAcl "accept" ["tag:server"] ["tag:server:*"])
- ];
+ acls =
+ let
+ mkAcl = action: src: dst: { inherit action src dst; };
+ in
+ [
+ (mkAcl "accept" [ "tag:personal" ] [ "*:*" ])
+ (mkAcl "accept" [ "tag:server" ] [ "tag:server:*" ])
+ ];
- ssh = let
- mkSshAcl = action: src: dst: users: {inherit action src dst users;};
- in [
- (mkSshAcl "accept" ["tag:personal"] ["tag:server" "tag:personal"] ["autogroup:nonroot" "root"])
- ];
- });
+ ssh =
+ let
+ mkSshAcl = action: src: dst: users: {
+ inherit
+ action
+ src
+ dst
+ users
+ ;
+ };
+ in
+ [
+ (mkSshAcl "accept" [ "tag:personal" ]
+ [
+ "tag:server"
+ "tag:personal"
+ ]
+ [
+ "autogroup:nonroot"
+ "root"
+ ]
+ )
+ ];
+ }
+ );
};
}
diff --git a/ext/terranix/tailscale/default.nix b/ext/terranix/tailscale/default.nix
index 2225fd5..b370b34 100644
--- a/ext/terranix/tailscale/default.nix
+++ b/ext/terranix/tailscale/default.nix
@@ -1,4 +1,5 @@
-{lib, ...}: {
+{ lib, ... }:
+{
imports = [
./acl.nix
./devices.nix
diff --git a/ext/terranix/tailscale/devices.nix b/ext/terranix/tailscale/devices.nix
index 44ee3f1..625c56e 100644
--- a/ext/terranix/tailscale/devices.nix
+++ b/ext/terranix/tailscale/devices.nix
@@ -1,11 +1,14 @@
-{lib, ...}: {
- data.tailscale_device = let
- toDevices = devices:
- lib.genAttrs devices (name: {
- name = "${name}.tailc59d6.ts.net";
- wait_for = "60s";
- });
- in
+{ lib, ... }:
+{
+ data.tailscale_device =
+ let
+ toDevices =
+ devices:
+ lib.genAttrs devices (name: {
+ name = "${name}.tailc59d6.ts.net";
+ wait_for = "60s";
+ });
+ in
toDevices [
"atlas"
"caroline"
diff --git a/ext/terranix/tailscale/tags.nix b/ext/terranix/tailscale/tags.nix
index ff41c82..3e82dbb 100644
--- a/ext/terranix/tailscale/tags.nix
+++ b/ext/terranix/tailscale/tags.nix
@@ -1,10 +1,15 @@
-{lib, ...}: {
- resource.tailscale_device_tags = let
- getDeviceID = device: lib.tfRef "data.tailscale_device.${device}.id";
- toTags = n: v: {device_id = getDeviceID n;} // v;
+{ lib, ... }:
+{
+ resource.tailscale_device_tags =
+ let
+ getDeviceID = device: lib.tfRef "data.tailscale_device.${device}.id";
+ toTags = n: v: { device_id = getDeviceID n; } // v;
- tags = lib.genAttrs ["server" "personal"] (n: ["tag:${n}"]);
- in
+ tags = lib.genAttrs [
+ "server"
+ "personal"
+ ] (n: [ "tag:${n}" ]);
+ in
builtins.mapAttrs toTags {
atlas.tags = tags.server;
caroline.tags = tags.personal;
diff --git a/ext/terranix/versions.nix b/ext/terranix/versions.nix
index 53bb5c6..6ac0b3e 100644
--- a/ext/terranix/versions.nix
+++ b/ext/terranix/versions.nix
@@ -1,12 +1,11 @@
-{lib, ...}: {
- terraform.required_providers = let
- registry = "registry.terraform.io";
+{ lib, ... }:
+{
+ terraform.required_providers =
+ let
+ registry = "registry.terraform.io";
- fmtSource = _: value:
- lib.recursiveUpdate value {
- source = "${registry}/${value.source}";
- };
- in
+ fmtSource = _: value: lib.recursiveUpdate value { source = "${registry}/${value.source}"; };
+ in
lib.mapAttrs fmtSource {
cloudflare.source = "cloudflare/cloudflare";
diff --git a/flake.nix b/flake.nix
index fdadd20..52af7a9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,12 +2,13 @@
description = "getchoo's flake for system configurations";
nixConfig = {
- extra-substituters = ["https://getchoo.cachix.org"];
- extra-trusted-public-keys = ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="];
+ extra-substituters = [ "https://getchoo.cachix.org" ];
+ extra-trusted-public-keys = [ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" ];
};
- outputs = inputs:
- inputs.flake-parts.lib.mkFlake {inherit inputs;} {
+ outputs =
+ inputs:
+ inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
@@ -31,9 +32,11 @@
./ext
];
- perSystem = {pkgs, ...}: {
- formatter = pkgs.alejandra;
- };
+ perSystem =
+ { pkgs, ... }:
+ {
+ formatter = pkgs.nixfmt-rfc-style;
+ };
};
inputs = {
diff --git a/hydraJobs.nix b/hydraJobs.nix
index ba26af5..9cc4617 100644
--- a/hydraJobs.nix
+++ b/hydraJobs.nix
@@ -3,25 +3,24 @@
self,
withSystem,
...
-}: let
+}:
+let
ciSystem = "x86_64-linux";
derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage;
mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg);
-in {
- flake.hydraJobs = withSystem ciSystem ({
- pkgs,
- self',
- ...
- }: {
- inherit (self') checks;
- inherit (self') devShells;
- darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations;
- homeConfigurations = mapCfgsToDerivs self.homeConfigurations;
- nixosConfigurations =
- mapCfgsToDerivs self.nixosConfigurations
- // {
+in
+{
+ flake.hydraJobs = withSystem ciSystem (
+ { pkgs, self', ... }:
+ {
+ inherit (self') checks;
+ inherit (self') devShells;
+ darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations;
+ homeConfigurations = mapCfgsToDerivs self.homeConfigurations;
+ nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations // {
# please add aarch64 runners github...please...
atlas = lib.deepSeq (derivFromCfg self.nixosConfigurations.atlas).drvPath pkgs.emptyFile;
};
- });
+ }
+ );
}
diff --git a/lib/default.nix b/lib/default.nix
index 6e4bec7..27e4a15 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,7 +1,4 @@
-{lib, ...} @ args: {
- flake.lib =
- (lib.extend (final: _: {
- my = import ./lib.nix (args // {lib = final;});
- }))
- .my;
+{ lib, ... }@args:
+{
+ flake.lib = (lib.extend (final: _: { my = import ./lib.nix (args // { lib = final; }); })).my;
}
diff --git a/lib/lib.nix b/lib/lib.nix
index aedb67a..e0e14e4 100644
--- a/lib/lib.nix
+++ b/lib/lib.nix
@@ -3,28 +3,34 @@
self,
inputs,
...
-}: let
+}:
+let
# function -> function -> { } -> { }
# wrap the `args` applied to `builder` with the result of `apply`
# applied to those `args`
- wrapBuilderWith = apply: builder: args: builder (apply args);
+ wrapBuilderWith =
+ apply: builder: args:
+ builder (apply args);
# string -> function -> { } -> { }
# wrap the `args` for `builder` of type `type` with nice defaults
- wrapBuilder = type:
- wrapBuilderWith ({
- modules ? [],
- specialArgs ? {},
+ wrapBuilder =
+ type:
+ wrapBuilderWith (
+ {
+ modules ? [ ],
+ specialArgs ? { },
...
- } @ args:
- args
- // {
- modules =
- modules
- ++ lib.attrValues (self."${type}Modules" or {});
+ }@args:
+ args
+ // {
+ modules = modules ++ lib.attrValues (self."${type}Modules" or { });
- specialArgs = specialArgs // {inherit inputs;};
- });
+ specialArgs = specialArgs // {
+ inherit inputs;
+ };
+ }
+ );
# function -> { } -> { }
# wrap the `args` to the nixos `builder` function with nice defaults
@@ -35,23 +41,25 @@
# function -> { } -> { }
# wrap the `args` to the homeManager `builder` function with nice defaults
- wrapUser = builder: args:
- wrapBuilderWith ({
- modules ? [],
- extraSpecialArgs ? {},
+ wrapUser =
+ builder: args:
+ wrapBuilderWith (
+ {
+ modules ? [ ],
+ extraSpecialArgs ? { },
...
- } @ args:
- args
- // {
- modules =
- modules
- ++ lib.attrValues (self.homeManagerModules or {});
+ }@args:
+ args
+ // {
+ modules = modules ++ lib.attrValues (self.homeManagerModules or { });
- extraSpecialArgs = extraSpecialArgs // {inherit inputs;};
- })
- builder
- args;
-in {
+ extraSpecialArgs = extraSpecialArgs // {
+ inherit inputs;
+ };
+ }
+ ) builder args;
+in
+{
# { } -> { }
# apply nice defaults to the `args` of `nixosSystem`
nixosSystem = wrapNixOS inputs.nixpkgs.lib.nixosSystem;
diff --git a/lib/nginx.nix b/lib/nginx.nix
index 0564dba..e7c22c3 100644
--- a/lib/nginx.nix
+++ b/lib/nginx.nix
@@ -12,8 +12,5 @@ lib: {
# string -> { } -> { }
# transform the names of an attribute set of nginx virtualHosts
# into a full subdomain
- toVHosts = domain:
- lib.mapAttrs' (
- name: lib.nameValuePair "${name}.${domain}"
- );
+ toVHosts = domain: lib.mapAttrs' (name: lib.nameValuePair "${name}.${domain}");
}
diff --git a/modules/darwin/archetypes/default.nix b/modules/darwin/archetypes/default.nix
index b4bd1b5..518cc57 100644
--- a/modules/darwin/archetypes/default.nix
+++ b/modules/darwin/archetypes/default.nix
@@ -1,5 +1 @@
-{
- imports = [
- ./personal.nix
- ];
-}
+{ imports = [ ./personal.nix ]; }
diff --git a/modules/darwin/archetypes/personal.nix b/modules/darwin/archetypes/personal.nix
index 7dcfbe0..a1eb761 100644
--- a/modules/darwin/archetypes/personal.nix
+++ b/modules/darwin/archetypes/personal.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.archetypes.personal;
-in {
+in
+{
options.archetypes.personal = {
enable = lib.mkEnableOption "personal archetype";
};
diff --git a/modules/darwin/base/programs.nix b/modules/darwin/base/programs.nix
index bb6d4f5..aefb852 100644
--- a/modules/darwin/base/programs.nix
+++ b/modules/darwin/base/programs.nix
@@ -1,11 +1,9 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.defaultPrograms;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
config = lib.mkIf enable {
programs = {
bash.enable = true;
diff --git a/modules/darwin/desktop/default.nix b/modules/darwin/desktop/default.nix
index cdfb246..6f4e791 100644
--- a/modules/darwin/desktop/default.nix
+++ b/modules/darwin/desktop/default.nix
@@ -1,4 +1,5 @@
-{lib, ...}: {
+{ lib, ... }:
+{
options.desktop = {
enable = lib.mkEnableOption "base desktop settings";
};
diff --git a/modules/darwin/desktop/fonts.nix b/modules/darwin/desktop/fonts.nix
index 9b068bd..a26f774 100644
--- a/modules/darwin/desktop/fonts.nix
+++ b/modules/darwin/desktop/fonts.nix
@@ -3,17 +3,19 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.desktop.fonts;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.fonts = {
- enable = lib.mkEnableOption "desktop fonts" // {default = true;};
+ enable = lib.mkEnableOption "desktop fonts" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
- fonts.packages = [
- (pkgs.nerdfonts.override {fonts = ["FiraCode"];})
- ];
+ fonts.packages = [ (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }) ];
};
}
diff --git a/modules/darwin/desktop/homebrew.nix b/modules/darwin/desktop/homebrew.nix
index 1015ff9..2371f57 100644
--- a/modules/darwin/desktop/homebrew.nix
+++ b/modules/darwin/desktop/homebrew.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.desktop.homebrew;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.homebrew = {
- enable = lib.mkEnableOption "Homebrew integration" // {default = true;};
+ enable = lib.mkEnableOption "Homebrew integration" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/darwin/desktop/programs.nix b/modules/darwin/desktop/programs.nix
index b681c59..75a86e3 100644
--- a/modules/darwin/desktop/programs.nix
+++ b/modules/darwin/desktop/programs.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.desktop.defaultPrograms;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.defaultPrograms = {
- enable = lib.mkEnableOption "default desktop programs" // {default = true;};
+ enable = lib.mkEnableOption "default desktop programs" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/darwin/traits/home-manager.nix b/modules/darwin/traits/home-manager.nix
index 9428499..6788651 100644
--- a/modules/darwin/traits/home-manager.nix
+++ b/modules/darwin/traits/home-manager.nix
@@ -1,3 +1,4 @@
-{inputs, ...}: {
- imports = [inputs.home-manager.darwinModules.home-manager];
+{ inputs, ... }:
+{
+ imports = [ inputs.home-manager.darwinModules.home-manager ];
}
diff --git a/modules/darwin/traits/users/default.nix b/modules/darwin/traits/users/default.nix
index a81dacf..df767b4 100644
--- a/modules/darwin/traits/users/default.nix
+++ b/modules/darwin/traits/users/default.nix
@@ -1,5 +1 @@
-{
- imports = [
- ./seth.nix
- ];
-}
+{ imports = [ ./seth.nix ]; }
diff --git a/modules/darwin/traits/users/seth.nix b/modules/darwin/traits/users/seth.nix
index 5e206f3..d60ff4e 100644
--- a/modules/darwin/traits/users/seth.nix
+++ b/modules/darwin/traits/users/seth.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.traits.users.seth;
-in {
+in
+{
config = lib.mkMerge [
(lib.mkIf cfg.enable {
home-manager.users.seth = {
diff --git a/modules/nixos/archetypes/personal.nix b/modules/nixos/archetypes/personal.nix
index 68aada9..e516fb1 100644
--- a/modules/nixos/archetypes/personal.nix
+++ b/modules/nixos/archetypes/personal.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.archetypes.personal;
-in {
+in
+{
options.archetypes = {
personal.enable = lib.mkEnableOption "personal archetype";
};
diff --git a/modules/nixos/archetypes/server.nix b/modules/nixos/archetypes/server.nix
index cbac329..165725d 100644
--- a/modules/nixos/archetypes/server.nix
+++ b/modules/nixos/archetypes/server.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.archetypes.server;
-in {
+in
+{
options.archetypes = {
server.enable = lib.mkEnableOption "server archetype";
};
diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix
index 421f733..d80d573 100644
--- a/modules/nixos/base/default.nix
+++ b/modules/nixos/base/default.nix
@@ -3,7 +3,8 @@
lib,
pkgs,
...
-}: {
+}:
+{
imports = [
../../shared
./documentation.nix
diff --git a/modules/nixos/base/documentation.nix b/modules/nixos/base/documentation.nix
index 5792c80..986c6ee 100644
--- a/modules/nixos/base/documentation.nix
+++ b/modules/nixos/base/documentation.nix
@@ -3,13 +3,18 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.base.documentation;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
config = lib.mkIf enable {
documentation.nixos.enable = false;
- environment.systemPackages = with pkgs; [man-pages man-pages-posix];
+ environment.systemPackages = with pkgs; [
+ man-pages
+ man-pages-posix
+ ];
};
}
diff --git a/modules/nixos/base/networking.nix b/modules/nixos/base/networking.nix
index 895127c..49feca5 100644
--- a/modules/nixos/base/networking.nix
+++ b/modules/nixos/base/networking.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.networking;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
options.base.networking = {
- enable = lib.mkEnableOption "base network settings" // {default = true;};
+ enable = lib.mkEnableOption "base network settings" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/nixos/base/nix.nix b/modules/nixos/base/nix.nix
index 8429346..6c49312 100644
--- a/modules/nixos/base/nix.nix
+++ b/modules/nixos/base/nix.nix
@@ -1,16 +1,17 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.nixSettings;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
config = lib.mkIf enable {
nix = {
channel.enable = lib.mkDefault false;
gc.dates = lib.mkDefault "weekly";
- settings.trusted-users = ["root" "@wheel"];
+ settings.trusted-users = [
+ "root"
+ "@wheel"
+ ];
};
};
}
diff --git a/modules/nixos/base/programs.nix b/modules/nixos/base/programs.nix
index 7d1a15b..def710c 100644
--- a/modules/nixos/base/programs.nix
+++ b/modules/nixos/base/programs.nix
@@ -1,11 +1,9 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.defaultPrograms;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
config = lib.mkIf enable {
programs = {
git.enable = true;
diff --git a/modules/nixos/base/security.nix b/modules/nixos/base/security.nix
index 4401f81..c3d606f 100644
--- a/modules/nixos/base/security.nix
+++ b/modules/nixos/base/security.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.security;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
options.base.security = {
- enable = lib.mkEnableOption "base security settings" // {default = true;};
+ enable = lib.mkEnableOption "base security settings" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/nixos/base/users.nix b/modules/nixos/base/users.nix
index 507a82a..b026f73 100644
--- a/modules/nixos/base/users.nix
+++ b/modules/nixos/base/users.nix
@@ -4,19 +4,23 @@
pkgs,
secretsDir,
...
-}: let
+}:
+let
cfg = config.base.users;
-in {
+in
+{
options.base.users = {
- enable = lib.mkEnableOption "base user configurations" // {default = true;};
+ enable = lib.mkEnableOption "base user configurations" // {
+ default = true;
+ };
defaultRoot = {
- enable = lib.mkEnableOption "default root user configuration" // {default = false;};
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ enable = lib.mkEnableOption "default root user configuration" // {
+ default = false;
+ };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
};
};
diff --git a/modules/nixos/desktop/audio.nix b/modules/nixos/desktop/audio.nix
index 1e47ab2..8e0c069 100644
--- a/modules/nixos/desktop/audio.nix
+++ b/modules/nixos/desktop/audio.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.desktop.audio;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.audio = {
- enable = lib.mkEnableOption "desktop audio configuration" // {default = true;};
+ enable = lib.mkEnableOption "desktop audio configuration" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/nixos/desktop/budgie/default.nix b/modules/nixos/desktop/budgie/default.nix
index dbd3715..dce24b4 100644
--- a/modules/nixos/desktop/budgie/default.nix
+++ b/modules/nixos/desktop/budgie/default.nix
@@ -3,9 +3,11 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.desktop.budgie;
-in {
+in
+{
options.desktop.budgie.enable = lib.mkEnableOption "budgie desktop";
config = lib.mkIf cfg.enable {
diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix
index 17392c4..83a4fba 100644
--- a/modules/nixos/desktop/default.nix
+++ b/modules/nixos/desktop/default.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.desktop;
-in {
+in
+{
options.desktop = {
enable = lib.mkEnableOption "desktop settings";
};
@@ -19,7 +17,5 @@ in {
./plasma
];
- config = lib.mkIf cfg.enable {
- services.xserver.enable = true;
- };
+ config = lib.mkIf cfg.enable { services.xserver.enable = true; };
}
diff --git a/modules/nixos/desktop/fonts.nix b/modules/nixos/desktop/fonts.nix
index 212f88c..f6df64c 100644
--- a/modules/nixos/desktop/fonts.nix
+++ b/modules/nixos/desktop/fonts.nix
@@ -3,12 +3,16 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.desktop.fonts;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.fonts = {
- enable = lib.mkEnableOption "desktop fonts" // {default = true;};
+ enable = lib.mkEnableOption "desktop fonts" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
@@ -16,7 +20,13 @@ in {
enableDefaultPackages = true;
packages = with pkgs; [
- (nerdfonts.override {fonts = ["FiraCode" "Hack" "Noto"];})
+ (nerdfonts.override {
+ fonts = [
+ "FiraCode"
+ "Hack"
+ "Noto"
+ ];
+ })
noto-fonts
noto-fonts-extra
noto-fonts-color-emoji
@@ -27,10 +37,10 @@ in {
enable = true;
cache32Bit = lib.mkDefault true;
defaultFonts = lib.mkDefault {
- serif = ["Noto Serif"];
- sansSerif = ["Noto Sans"];
- emoji = ["Noto Color Emoji"];
- monospace = ["Noto Sans Mono"];
+ serif = [ "Noto Serif" ];
+ sansSerif = [ "Noto Sans" ];
+ emoji = [ "Noto Color Emoji" ];
+ monospace = [ "Noto Sans Mono" ];
};
};
};
diff --git a/modules/nixos/desktop/gnome/default.nix b/modules/nixos/desktop/gnome/default.nix
index 8822bd4..1763e6b 100644
--- a/modules/nixos/desktop/gnome/default.nix
+++ b/modules/nixos/desktop/gnome/default.nix
@@ -3,9 +3,11 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.desktop.gnome;
-in {
+in
+{
options.desktop.gnome.enable = lib.mkEnableOption "GNOME desktop";
config = lib.mkIf cfg.enable {
diff --git a/modules/nixos/desktop/plasma/default.nix b/modules/nixos/desktop/plasma/default.nix
index b6e06da..7c43907 100644
--- a/modules/nixos/desktop/plasma/default.nix
+++ b/modules/nixos/desktop/plasma/default.nix
@@ -4,9 +4,11 @@
pkgs,
inputs,
...
-}: let
+}:
+let
cfg = config.desktop.plasma;
-in {
+in
+{
options.desktop.plasma.enable = lib.mkEnableOption "Plasma desktop";
config = lib.mkIf cfg.enable {
diff --git a/modules/nixos/desktop/programs.nix b/modules/nixos/desktop/programs.nix
index 94bde49..15ddbcc 100644
--- a/modules/nixos/desktop/programs.nix
+++ b/modules/nixos/desktop/programs.nix
@@ -3,18 +3,25 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.desktop.defaultPrograms;
enable = config.desktop.enable && cfg.enable;
-in {
+in
+{
options.desktop.defaultPrograms = {
- enable = lib.mkEnableOption "default desktop programs" // {default = true;};
+ enable = lib.mkEnableOption "default desktop programs" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
environment = {
noXlibs = lib.mkForce false;
- systemPackages = with pkgs; [wl-clipboard xclip];
+ systemPackages = with pkgs; [
+ wl-clipboard
+ xclip
+ ];
};
programs = {
diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix
index 735a30f..366abb3 100644
--- a/modules/nixos/server/default.nix
+++ b/modules/nixos/server/default.nix
@@ -4,9 +4,11 @@
pkgs,
inputs,
...
-}: let
+}:
+let
cfg = config.server;
-in {
+in
+{
options.server = {
enable = lib.mkEnableOption "server settings";
};
@@ -26,7 +28,7 @@ in {
man.enable = false;
};
- environment.defaultPackages = lib.mkForce [];
+ environment.defaultPackages = lib.mkForce [ ];
nix = {
gc = {
@@ -34,7 +36,7 @@ in {
options = "-d --delete-older-than 2d";
};
- settings.allowed-users = [config.networking.hostName];
+ settings.allowed-users = [ config.networking.hostName ];
};
};
}
diff --git a/modules/nixos/server/host-user.nix b/modules/nixos/server/host-user.nix
index 5aa1ce5..8b76e9d 100644
--- a/modules/nixos/server/host-user.nix
+++ b/modules/nixos/server/host-user.nix
@@ -3,18 +3,20 @@
lib,
secretsDir,
...
-}: let
+}:
+let
cfg = config.server.hostUser;
inherit (config.networking) hostName;
-in {
+in
+{
options.server.hostUser = {
- enable = lib.mkEnableOption "${hostName} user configuration" // {default = config.server.enable;};
+ enable = lib.mkEnableOption "${hostName} user configuration" // {
+ default = config.server.enable;
+ };
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
};
config = lib.mkIf cfg.enable (
@@ -22,7 +24,7 @@ in {
{
users.users.${hostName} = {
isNormalUser = true;
- extraGroups = ["wheel"];
+ extraGroups = [ "wheel" ];
};
}
diff --git a/modules/nixos/server/mixins/acme.nix b/modules/nixos/server/mixins/acme.nix
index 0e4a6d6..e809ad4 100644
--- a/modules/nixos/server/mixins/acme.nix
+++ b/modules/nixos/server/mixins/acme.nix
@@ -3,19 +3,21 @@
lib,
secretsDir,
...
-}: let
+}:
+let
cfg = config.server.mixins.acme;
-in {
+in
+{
options.server.mixins.acme = {
enable = lib.mkEnableOption "ACME mixin";
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
- useDns = lib.mkEnableOption "the usage of Cloudflare to obtain certs" // {default = true;};
+ useDns = lib.mkEnableOption "the usage of Cloudflare to obtain certs" // {
+ default = true;
+ };
};
config = lib.mkIf cfg.enable (
diff --git a/modules/nixos/server/mixins/cloudflared.nix b/modules/nixos/server/mixins/cloudflared.nix
index a5afb62..f781150 100644
--- a/modules/nixos/server/mixins/cloudflared.nix
+++ b/modules/nixos/server/mixins/cloudflared.nix
@@ -3,10 +3,12 @@
lib,
secretsDir,
...
-}: let
+}:
+let
cfg = config.server.mixins.cloudflared;
inherit (config.services) nginx;
-in {
+in
+{
options.server.mixins.cloudflared = {
enable = lib.mkEnableOption "cloudflared mixin";
tunnelName = lib.mkOption {
@@ -18,11 +20,9 @@ in {
'';
};
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
};
config = lib.mkIf cfg.enable (
@@ -33,7 +33,9 @@ in {
tunnels.${cfg.tunnelName} = {
default = "http_status:404";
- ingress = lib.mapAttrs (_: _: {service = "http://localhost:${toString nginx.defaultHTTPListenPort}";}) nginx.virtualHosts;
+ ingress = lib.mapAttrs (_: _: {
+ service = "http://localhost:${toString nginx.defaultHTTPListenPort}";
+ }) nginx.virtualHosts;
};
};
}
diff --git a/modules/nixos/server/mixins/hercules.nix b/modules/nixos/server/mixins/hercules.nix
index 103f58e..49ba46d 100644
--- a/modules/nixos/server/mixins/hercules.nix
+++ b/modules/nixos/server/mixins/hercules.nix
@@ -4,16 +4,16 @@
unstable,
secretsDir,
...
-}: let
+}:
+let
cfg = config.server.mixins.hercules-ci;
-in {
+in
+{
options.server.mixins.hercules-ci = {
enable = lib.mkEnableOption "hercules-ci mixin";
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
};
config = lib.mkIf cfg.enable (
@@ -25,29 +25,29 @@ in {
};
}
- (let
- secretNames = [
- "binaryCaches"
- "clusterJoinToken"
- "secretsJson"
- ];
- in
+ (
+ let
+ secretNames = [
+ "binaryCaches"
+ "clusterJoinToken"
+ "secretsJson"
+ ];
+ in
lib.mkIf cfg.manageSecrets {
- age.secrets = lib.genAttrs secretNames (
- file: {
- file = "${secretsDir}/${file}.age";
- mode = "400";
- owner = "hercules-ci-agent";
- group = "hercules-ci-agent";
- }
- );
+ age.secrets = lib.genAttrs secretNames (file: {
+ file = "${secretsDir}/${file}.age";
+ mode = "400";
+ owner = "hercules-ci-agent";
+ group = "hercules-ci-agent";
+ });
services.hercules-ci-agent = {
settings = lib.mapAttrs' (name: lib.nameValuePair (name + "Path")) (
lib.genAttrs secretNames (name: config.age.secrets.${name}.path)
);
};
- })
+ }
+ )
]
);
}
diff --git a/modules/nixos/server/mixins/nginx.nix b/modules/nixos/server/mixins/nginx.nix
index ba18ecf..11306a2 100644
--- a/modules/nixos/server/mixins/nginx.nix
+++ b/modules/nixos/server/mixins/nginx.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.server.mixins.nginx;
-in {
+in
+{
options.server.mixins.nginx = {
enable = lib.mkEnableOption "nginx mixin";
};
diff --git a/modules/nixos/server/mixins/promtail.nix b/modules/nixos/server/mixins/promtail.nix
index 1baaac6..6b4cf32 100644
--- a/modules/nixos/server/mixins/promtail.nix
+++ b/modules/nixos/server/mixins/promtail.nix
@@ -1,17 +1,15 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.server.mixins.promtail;
inherit (lib) types;
-in {
+in
+{
options.server.mixins.promtail = {
enable = lib.mkEnableOption "Promtail mixin";
clients = lib.mkOption {
type = types.listOf types.attrs;
- default = [{}];
+ default = [ { } ];
description = "Clients for promtail";
};
};
@@ -37,7 +35,7 @@ in {
relabel_configs = [
{
- source_labels = ["__journal__systemd_unit"];
+ source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}
];
diff --git a/modules/nixos/traits/24.05-compat.nix b/modules/nixos/traits/24.05-compat.nix
index 26dcbca..b6422d1 100644
--- a/modules/nixos/traits/24.05-compat.nix
+++ b/modules/nixos/traits/24.05-compat.nix
@@ -1,5 +1,17 @@
-{lib, ...}: {
+{ lib, ... }:
+{
imports = lib.optionals (lib.versionOlder lib.version "24.11pre") [
- (lib.mkAliasOptionModule ["hardware" "graphics" "extraPackages"] ["hardware" "opengl" "extraPackages"])
+ (lib.mkAliasOptionModule
+ [
+ "hardware"
+ "graphics"
+ "extraPackages"
+ ]
+ [
+ "hardware"
+ "opengl"
+ "extraPackages"
+ ]
+ )
];
}
diff --git a/modules/nixos/traits/auto-upgrade.nix b/modules/nixos/traits/auto-upgrade.nix
index bdb919c..1e65445 100644
--- a/modules/nixos/traits/auto-upgrade.nix
+++ b/modules/nixos/traits/auto-upgrade.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.traits.autoUpgrade;
-in {
+in
+{
options.traits.autoUpgrade = {
enable = lib.mkEnableOption "automatic updates";
};
@@ -14,16 +12,14 @@ in {
enable = true;
/*
- a workflow updates the flake every 24h at ~0:00UTC/8:00EST;
- most devices of mine will be in EST currently. this could probably be
- "01:00" or "daily" but i think that's a bit of a risk if i ever change/
- dont set the time zone for a device and forget about this lol
+ a workflow updates the flake every 24h at ~0:00UTC/8:00EST;
+ most devices of mine will be in EST currently. this could probably be
+ "01:00" or "daily" but i think that's a bit of a risk if i ever change/
+ dont set the time zone for a device and forget about this lol
*/
dates = lib.mkDefault "02:00";
flake = "github:getchoo/flake#${config.networking.hostName}";
- flags = [
- "--refresh"
- ];
+ flags = [ "--refresh" ];
};
};
}
diff --git a/modules/nixos/traits/containers.nix b/modules/nixos/traits/containers.nix
index 5170c34..d13c658 100644
--- a/modules/nixos/traits/containers.nix
+++ b/modules/nixos/traits/containers.nix
@@ -4,10 +4,12 @@
options,
pkgs,
...
-}: let
+}:
+let
cfg = config.traits.containers;
- enableNvidia = lib.elem "nvidia" (config.services.xserver.videoDrivers or []);
-in {
+ enableNvidia = lib.elem "nvidia" (config.services.xserver.videoDrivers or [ ]);
+in
+{
options.traits.containers = {
enable = lib.mkEnableOption "containers support";
};
@@ -18,7 +20,7 @@ in {
virtualisation = {
podman = {
enable = true;
- extraPackages = with pkgs; [podman-compose];
+ extraPackages = with pkgs; [ podman-compose ];
autoPrune.enable = true;
};
@@ -26,9 +28,7 @@ in {
};
}
- (lib.mkIf enableNvidia {
- hardware.nvidia-container-toolkit.enable = true;
- })
+ (lib.mkIf enableNvidia { hardware.nvidia-container-toolkit.enable = true; })
]
);
}
diff --git a/modules/nixos/traits/home-manager.nix b/modules/nixos/traits/home-manager.nix
index 01af5b1..687f01d 100644
--- a/modules/nixos/traits/home-manager.nix
+++ b/modules/nixos/traits/home-manager.nix
@@ -1,3 +1,4 @@
-{inputs, ...}: {
- imports = [inputs.home-manager.nixosModules.home-manager];
+{ inputs, ... }:
+{
+ imports = [ inputs.home-manager.nixosModules.home-manager ];
}
diff --git a/modules/nixos/traits/locale.nix b/modules/nixos/traits/locale.nix
index 1de19ce..bd30819 100644
--- a/modules/nixos/traits/locale.nix
+++ b/modules/nixos/traits/locale.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.traits.locale;
-in {
+in
+{
options.traits.locale = {
en_US = {
enable = lib.mkEnableOption "en_US locale";
@@ -14,9 +12,7 @@ in {
config = lib.mkMerge [
(lib.mkIf cfg.en_US.enable {
i18n = {
- supportedLocales = [
- "en_US.UTF-8/UTF-8"
- ];
+ supportedLocales = [ "en_US.UTF-8/UTF-8" ];
defaultLocale = "en_US.UTF-8";
};
diff --git a/modules/nixos/traits/nvidia.nix b/modules/nixos/traits/nvidia.nix
index 303d902..5fec7db 100644
--- a/modules/nixos/traits/nvidia.nix
+++ b/modules/nixos/traits/nvidia.nix
@@ -3,49 +3,53 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.traits.nvidia;
usingNvidia = lib.elem "nvidia" config.services.xserver.videoDrivers;
-in {
+in
+{
options.traits.nvidia = {
enable = lib.mkEnableOption "NVIDIA drivers";
nvk.enable = lib.mkEnableOption "NVK specialisation";
};
- config = lib.mkIf cfg.enable (lib.mkMerge [
- {
- boot.kernelParams = lib.optional usingNvidia "nvidia_drm.fbdev=1";
+ config = lib.mkIf cfg.enable (
+ lib.mkMerge [
+ {
+ boot.kernelParams = lib.optional usingNvidia "nvidia_drm.fbdev=1";
- services.xserver.videoDrivers = ["nvidia"];
+ services.xserver.videoDrivers = [ "nvidia" ];
- hardware = {
- graphics.extraPackages = [pkgs.vaapiVdpau];
- nvidia = {
- package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.latest;
- modesetting.enable = true;
- };
- };
- }
-
- (lib.mkIf cfg.nvk.enable {
- specialisation = {
- nvk.configuration = {
- boot = {
- kernelParams = ["nouveau.config=NvGspRm=1"];
- initrd.kernelModules = ["nouveau"];
+ hardware = {
+ graphics.extraPackages = [ pkgs.vaapiVdpau ];
+ nvidia = {
+ package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.latest;
+ modesetting.enable = true;
};
+ };
+ }
- environment.sessionVariables = {
- MESA_VK_VERSION_OVERRIDE = "1.3";
- };
+ (lib.mkIf cfg.nvk.enable {
+ specialisation = {
+ nvk.configuration = {
+ boot = {
+ kernelParams = [ "nouveau.config=NvGspRm=1" ];
+ initrd.kernelModules = [ "nouveau" ];
+ };
+
+ environment.sessionVariables = {
+ MESA_VK_VERSION_OVERRIDE = "1.3";
+ };
- hardware.graphics.extraPackages = lib.mkForce [];
+ hardware.graphics.extraPackages = lib.mkForce [ ];
- services.xserver.videoDrivers = lib.mkForce ["modesetting"];
+ services.xserver.videoDrivers = lib.mkForce [ "modesetting" ];
- system.nixos.tags = ["with-nvk"];
+ system.nixos.tags = [ "with-nvk" ];
+ };
};
- };
- })
- ]);
+ })
+ ]
+ );
}
diff --git a/modules/nixos/traits/secrets.nix b/modules/nixos/traits/secrets.nix
index 862e76f..af66969 100644
--- a/modules/nixos/traits/secrets.nix
+++ b/modules/nixos/traits/secrets.nix
@@ -3,14 +3,16 @@
lib,
inputs,
...
-}: let
+}:
+let
cfg = config.traits.secrets;
-in {
+in
+{
options.traits.secrets = {
enable = lib.mkEnableOption "secrets management";
};
- imports = [inputs.agenix.nixosModules.default];
+ imports = [ inputs.agenix.nixosModules.default ];
config = lib.mkIf cfg.enable {
_module.args = {
@@ -18,7 +20,7 @@ in {
};
age = {
- identityPaths = ["/etc/age/key"];
+ identityPaths = [ "/etc/age/key" ];
};
};
}
diff --git a/modules/nixos/traits/tailscale.nix b/modules/nixos/traits/tailscale.nix
index a7d8c06..73c74e3 100644
--- a/modules/nixos/traits/tailscale.nix
+++ b/modules/nixos/traits/tailscale.nix
@@ -3,24 +3,24 @@
lib,
secretsDir,
...
-}: let
+}:
+let
cfg = config.traits.tailscale;
-in {
+in
+{
options.traits.tailscale = {
enable = lib.mkEnableOption "Tailscale";
ssh.enable = lib.mkEnableOption "Tailscale SSH";
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable && cfg.ssh.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable && cfg.ssh.enable;
+ };
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
networking.firewall = {
- trustedInterfaces = [config.services.tailscale.interfaceName];
+ trustedInterfaces = [ config.services.tailscale.interfaceName ];
};
services.tailscale = {
@@ -31,11 +31,11 @@ in {
(lib.mkIf cfg.ssh.enable {
networking.firewall = {
- allowedTCPPorts = [22];
+ allowedTCPPorts = [ 22 ];
};
services.tailscale = {
- extraUpFlags = ["--ssh"];
+ extraUpFlags = [ "--ssh" ];
};
})
diff --git a/modules/nixos/traits/users/default.nix b/modules/nixos/traits/users/default.nix
index a81dacf..df767b4 100644
--- a/modules/nixos/traits/users/default.nix
+++ b/modules/nixos/traits/users/default.nix
@@ -1,5 +1 @@
-{
- imports = [
- ./seth.nix
- ];
-}
+{ imports = [ ./seth.nix ]; }
diff --git a/modules/nixos/traits/users/seth.nix b/modules/nixos/traits/users/seth.nix
index 9ebb6c8..4b84892 100644
--- a/modules/nixos/traits/users/seth.nix
+++ b/modules/nixos/traits/users/seth.nix
@@ -3,15 +3,15 @@
lib,
secretsDir,
...
-}: let
+}:
+let
cfg = config.traits.users.seth;
-in {
+in
+{
options.traits.users.seth = {
- manageSecrets =
- lib.mkEnableOption "automatic secrets management"
- // {
- default = config.traits.secrets.enable;
- };
+ manageSecrets = lib.mkEnableOption "automatic secrets management" // {
+ default = config.traits.secrets.enable;
+ };
};
config = lib.mkMerge [
diff --git a/modules/nixos/traits/zram.nix b/modules/nixos/traits/zram.nix
index 337137a..d0c6a36 100644
--- a/modules/nixos/traits/zram.nix
+++ b/modules/nixos/traits/zram.nix
@@ -1,10 +1,8 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.traits.zram;
-in {
+in
+{
options.traits.zram = {
enable = lib.mkEnableOption "zram setup & configuration";
};
diff --git a/modules/shared/base/default.nix b/modules/shared/base/default.nix
index 9154ae7..e2bbdee 100644
--- a/modules/shared/base/default.nix
+++ b/modules/shared/base/default.nix
@@ -3,10 +3,12 @@
lib,
inputs,
...
-}: let
+}:
+let
cfg = config.base;
inherit (inputs) self;
-in {
+in
+{
options.base = {
enable = lib.mkEnableOption "basic configurations";
};
diff --git a/modules/shared/base/documentation.nix b/modules/shared/base/documentation.nix
index 0139f7d..1335c17 100644
--- a/modules/shared/base/documentation.nix
+++ b/modules/shared/base/documentation.nix
@@ -1,13 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.documentation;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
options.base.documentation = {
- enable = lib.mkEnableOption "documentation settings" // {default = true;};
+ enable = lib.mkEnableOption "documentation settings" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix
index 26f16bc..9002455 100644
--- a/modules/shared/base/nix.nix
+++ b/modules/shared/base/nix.nix
@@ -3,22 +3,31 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.base.nixSettings;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
options.base.nixSettings = {
- enable = lib.mkEnableOption "nix settings" // {default = true;};
+ enable = lib.mkEnableOption "nix settings" // {
+ default = true;
+ };
};
config = lib.mkIf enable {
nix = {
settings = {
auto-optimise-store = pkgs.stdenv.isLinux;
- experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ "auto-allocate-uids"
+ "repl-flake"
+ ];
- trusted-substituters = ["https://getchoo.cachix.org"];
- trusted-public-keys = ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="];
+ trusted-substituters = [ "https://getchoo.cachix.org" ];
+ trusted-public-keys = [ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" ];
nix-path = config.nix.nixPath;
};
diff --git a/modules/shared/base/programs.nix b/modules/shared/base/programs.nix
index 796fce0..e5208b0 100644
--- a/modules/shared/base/programs.nix
+++ b/modules/shared/base/programs.nix
@@ -1,16 +1,14 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.base.defaultPrograms;
enable = config.base.enable && cfg.enable;
-in {
+in
+{
options.base.defaultPrograms = {
- enable = lib.mkEnableOption "default programs" // {default = true;};
+ enable = lib.mkEnableOption "default programs" // {
+ default = true;
+ };
};
- config = lib.mkIf enable {
- programs.gnupg.agent.enable = lib.mkDefault true;
- };
+ config = lib.mkIf enable { programs.gnupg.agent.enable = lib.mkDefault true; };
}
diff --git a/modules/shared/traits/home-manager.nix b/modules/shared/traits/home-manager.nix
index e49c4a5..6420b5a 100644
--- a/modules/shared/traits/home-manager.nix
+++ b/modules/shared/traits/home-manager.nix
@@ -3,9 +3,11 @@
lib,
inputs,
...
-}: let
+}:
+let
cfg = config.traits.home-manager;
-in {
+in
+{
options.traits.home-manager = {
enable = lib.mkEnableOption "home-manager configuration";
};
@@ -14,7 +16,9 @@ in {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
- extraSpecialArgs = {inherit inputs;};
+ extraSpecialArgs = {
+ inherit inputs;
+ };
};
};
}
diff --git a/modules/shared/traits/locale.nix b/modules/shared/traits/locale.nix
index 9c07c14..a260988 100644
--- a/modules/shared/traits/locale.nix
+++ b/modules/shared/traits/locale.nix
@@ -1,19 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.traits.locale;
-in {
+in
+{
options.traits.locale = {
US-east = {
enable = lib.mkEnableOption "eastern United States locale";
};
};
- config = lib.mkMerge [
- (lib.mkIf cfg.US-east.enable {
- time.timeZone = "America/New_York";
- })
- ];
+ config = lib.mkMerge [ (lib.mkIf cfg.US-east.enable { time.timeZone = "America/New_York"; }) ];
}
diff --git a/modules/shared/traits/users/default.nix b/modules/shared/traits/users/default.nix
index a81dacf..df767b4 100644
--- a/modules/shared/traits/users/default.nix
+++ b/modules/shared/traits/users/default.nix
@@ -1,5 +1 @@
-{
- imports = [
- ./seth.nix
- ];
-}
+{ imports = [ ./seth.nix ]; }
diff --git a/modules/shared/traits/users/seth.nix b/modules/shared/traits/users/seth.nix
index 136a343..b5f330d 100644
--- a/modules/shared/traits/users/seth.nix
+++ b/modules/shared/traits/users/seth.nix
@@ -3,9 +3,11 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.traits.users.seth;
-in {
+in
+{
options.traits.users.seth = {
enable = lib.mkEnableOption "Seth's user & home configurations";
};
@@ -17,7 +19,7 @@ in {
programs.fish.enable = true;
home-manager.users.seth = {
- imports = [../../../../users/seth];
+ imports = [ ../../../../users/seth ];
seth = {
enable = true;
shell.fish.enable = true;
@@ -33,7 +35,7 @@ in {
(lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) {
users.users.seth = {
- extraGroups = ["wheel"];
+ extraGroups = [ "wheel" ];
isNormalUser = true;
};
})
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
index 7a28470..7b933e9 100644
--- a/secrets/secrets.nix
+++ b/secrets/secrets.nix
@@ -9,9 +9,7 @@ let
glados = {
owner = owners.getchoo;
pubkey = "age1n7tyxx63wpgnmwkzn7dmkm62jxel840rk3ye3vsultrszsfrwuzsawdzhq";
- files = [
- "sethPassword.age"
- ];
+ files = [ "sethPassword.age" ];
};
glados-wsl = {
@@ -34,4 +32,4 @@ let
};
};
in
- toSecrets hosts
+toSecrets hosts
diff --git a/secrets/toSecrets.nix b/secrets/toSecrets.nix
index 3d495c6..fff6936 100644
--- a/secrets/toSecrets.nix
+++ b/secrets/toSecrets.nix
@@ -1,25 +1,19 @@
-hosts: let
- optional = attrset: val:
- if attrset ? ${val}
- then [attrset.${val}]
- else [];
+hosts:
+let
+ optional = attrset: val: if attrset ? ${val} then [ attrset.${val} ] else [ ];
mkPubkeys = host: optional host "pubkey" ++ optional host "owner";
- op = acc: host:
+ op =
+ acc: host:
acc
- // (
- builtins.listToAttrs (
- map (
- file: {
- name = "${host}/${file}";
- value = {
- publicKeys = mkPubkeys hosts.${host};
- };
- }
- )
- hosts.${host}.files
- )
- );
+ // (builtins.listToAttrs (
+ map (file: {
+ name = "${host}/${file}";
+ value = {
+ publicKeys = mkPubkeys hosts.${host};
+ };
+ }) hosts.${host}.files
+ ));
in
- builtins.foldl' op {} (builtins.attrNames hosts)
+builtins.foldl' op { } (builtins.attrNames hosts)
diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix
index 4bceca8..735a526 100644
--- a/systems/atlas/default.nix
+++ b/systems/atlas/default.nix
@@ -1,8 +1,5 @@
+{ config, modulesPath, ... }:
{
- config,
- modulesPath,
- ...
-}: {
imports = [
(modulesPath + "/profiles/minimal.nix")
./hardware-configuration.nix
diff --git a/systems/atlas/hardware-configuration.nix b/systems/atlas/hardware-configuration.nix
index 00c6cd8..9188d85 100644
--- a/systems/atlas/hardware-configuration.nix
+++ b/systems/atlas/hardware-configuration.nix
@@ -1,15 +1,17 @@
-{modulesPath, ...}: {
- imports = [
- (modulesPath + "/profiles/qemu-guest.nix")
- ];
+{ modulesPath, ... }:
+{
+ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = {
- extraModulePackages = [];
- kernelModules = [];
+ extraModulePackages = [ ];
+ kernelModules = [ ];
initrd = {
- availableKernelModules = ["virtio_pci" "usbhid"];
- kernelModules = [];
+ availableKernelModules = [
+ "virtio_pci"
+ "usbhid"
+ ];
+ kernelModules = [ ];
};
};
@@ -25,5 +27,5 @@
};
};
- swapDevices = [];
+ swapDevices = [ ];
}
diff --git a/systems/atlas/miniflux.nix b/systems/atlas/miniflux.nix
index 73ed2c6..ec5bd3a 100644
--- a/systems/atlas/miniflux.nix
+++ b/systems/atlas/miniflux.nix
@@ -1,9 +1,6 @@
+{ config, secretsDir, ... }:
{
- config,
- secretsDir,
- ...
-}: {
- age.secrets .miniflux.file = secretsDir + "/miniflux.age";
+ age.secrets.miniflux.file = secretsDir + "/miniflux.age";
services.miniflux = {
enable = true;
diff --git a/systems/atlas/nginx.nix b/systems/atlas/nginx.nix
index 9fe0b38..bdd3cc3 100644
--- a/systems/atlas/nginx.nix
+++ b/systems/atlas/nginx.nix
@@ -1,10 +1,8 @@
-{
- config,
- inputs,
- ...
-}: let
+{ config, inputs, ... }:
+let
inherit (inputs.self.lib.nginx) mkProxy toVHosts;
-in {
+in
+{
services.nginx = {
virtualHosts = toVHosts config.networking.domain {
miniflux = {
diff --git a/systems/atlas/nixpkgs-tracker-bot.nix b/systems/atlas/nixpkgs-tracker-bot.nix
index d02042d..74a7ed9 100644
--- a/systems/atlas/nixpkgs-tracker-bot.nix
+++ b/systems/atlas/nixpkgs-tracker-bot.nix
@@ -3,8 +3,9 @@
inputs,
secretsDir,
...
-}: {
- imports = [inputs.nixpkgs-tracker-bot.nixosModules.default];
+}:
+{
+ imports = [ inputs.nixpkgs-tracker-bot.nixosModules.default ];
age.secrets.nixpkgs-tracker-bot.file = secretsDir + "/nixpkgs-tracker-bot.age";
diff --git a/systems/atlas/teawiebot.nix b/systems/atlas/teawiebot.nix
index 8d4da63..8f6d560 100644
--- a/systems/atlas/teawiebot.nix
+++ b/systems/atlas/teawiebot.nix
@@ -3,8 +3,9 @@
secretsDir,
inputs,
...
-}: {
- imports = [inputs.teawiebot.nixosModules.default];
+}:
+{
+ imports = [ inputs.teawiebot.nixosModules.default ];
age.secrets.teawiebot.file = secretsDir + "/teawieBot.age";
diff --git a/systems/caroline/default.nix b/systems/caroline/default.nix
index 9a6efae..0788cc7 100644
--- a/systems/caroline/default.nix
+++ b/systems/caroline/default.nix
@@ -1,4 +1,5 @@
-{config, ...}: {
+{ config, ... }:
+{
archetypes.personal.enable = true;
homebrew.casks = [
@@ -13,7 +14,7 @@
hostName = "caroline";
};
- nix.settings.trusted-users = ["seth"];
+ nix.settings.trusted-users = [ "seth" ];
nixpkgs.hostPlatform = "x86_64-darwin";
services.tailscale.enable = true;
diff --git a/systems/darwin.nix b/systems/darwin.nix
index f36d152..a1b91f3 100644
--- a/systems/darwin.nix
+++ b/systems/darwin.nix
@@ -1,11 +1,12 @@
-{self, ...}: {
+{ self, ... }:
+{
flake = {
- darwinConfigurations = let
- inherit (self.lib) darwinSystem;
- in {
- caroline = darwinSystem {
- modules = [./caroline];
+ darwinConfigurations =
+ let
+ inherit (self.lib) darwinSystem;
+ in
+ {
+ caroline = darwinSystem { modules = [ ./caroline ]; };
};
- };
};
}
diff --git a/systems/glados-wsl/default.nix b/systems/glados-wsl/default.nix
index cd53a82..9088f3c 100644
--- a/systems/glados-wsl/default.nix
+++ b/systems/glados-wsl/default.nix
@@ -4,7 +4,8 @@
pkgs,
inputs,
...
-}: {
+}:
+{
imports = [
(modulesPath + "/profiles/minimal.nix")
inputs.nixos-wsl.nixosModules.wsl
diff --git a/systems/glados/boot.nix b/systems/glados/boot.nix
index 7f6793e..0aa6f9e 100644
--- a/systems/glados/boot.nix
+++ b/systems/glados/boot.nix
@@ -3,8 +3,9 @@
pkgs,
inputs,
...
-}: {
- imports = [inputs.lanzaboote.nixosModules.lanzaboote];
+}:
+{
+ imports = [ inputs.lanzaboote.nixosModules.lanzaboote ];
environment.systemPackages = with pkgs; [
sbctl
@@ -15,7 +16,7 @@
initrd.systemd.enable = true;
kernelPackages = pkgs.linuxPackages_latest;
- kernelParams = ["amd_pstate=active"];
+ kernelParams = [ "amd_pstate=active" ];
loader.systemd-boot.enable = lib.mkForce false;
@@ -24,6 +25,6 @@
pkiBundle = "/etc/secureboot";
};
- supportedFilesystems = ["ntfs"];
+ supportedFilesystems = [ "ntfs" ];
};
}
diff --git a/systems/glados/default.nix b/systems/glados/default.nix
index 491285d..7a096db 100644
--- a/systems/glados/default.nix
+++ b/systems/glados/default.nix
@@ -1,4 +1,5 @@
-{pkgs, ...}: {
+{ pkgs, ... }:
+{
imports = [
./boot.nix
./hardware-configuration.nix
@@ -11,7 +12,7 @@
plasma.enable = true;
};
- environment.systemPackages = [pkgs.obs-studio];
+ environment.systemPackages = [ pkgs.obs-studio ];
networking.hostName = "glados";
diff --git a/systems/glados/hardware-configuration.nix b/systems/glados/hardware-configuration.nix
index a7ff9e9..bd5f220 100644
--- a/systems/glados/hardware-configuration.nix
+++ b/systems/glados/hardware-configuration.nix
@@ -6,23 +6,28 @@
lib,
modulesPath,
...
-}: {
- imports = [
- (modulesPath + "/installer/scan/not-detected.nix")
- ];
+}:
+{
+ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
- extraModulePackages = [];
- kernelModules = ["kvm-amd"];
+ extraModulePackages = [ ];
+ kernelModules = [ "kvm-amd" ];
initrd = {
- availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
- kernelModules = [];
+ availableKernelModules = [
+ "xhci_pci"
+ "ahci"
+ "usb_storage"
+ "usbhid"
+ "sd_mod"
+ ];
+ kernelModules = [ ];
luks.devices."cryptroot" = {
device = "/dev/disk/by-uuid/bbbc1f37-53f5-4776-a70e-f2779179de50";
allowDiscards = true;
- crypttabExtraOpts = ["tpm2-device=auto"];
+ crypttabExtraOpts = [ "tpm2-device=auto" ];
};
};
};
@@ -31,25 +36,42 @@
"/" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
- options = ["subvol=root" "compress=zstd" "noatime"];
+ options = [
+ "subvol=root"
+ "compress=zstd"
+ "noatime"
+ ];
};
"/var/log" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
- options = ["subvol=var_log" "compress=zstd" "noatime"];
+ options = [
+ "subvol=var_log"
+ "compress=zstd"
+ "noatime"
+ ];
};
"/nix" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
- options = ["subvol=nix" "compress=zstd" "noatime" "nodatacow"];
+ options = [
+ "subvol=nix"
+ "compress=zstd"
+ "noatime"
+ "nodatacow"
+ ];
};
"/home" = {
device = "/dev/mapper/cryptroot";
fsType = "btrfs";
- options = ["subvol=home" "compress=zstd" "noatime"];
+ options = [
+ "subvol=home"
+ "compress=zstd"
+ "noatime"
+ ];
};
"/boot" = {
@@ -58,7 +80,7 @@
};
};
- swapDevices = [];
+ swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
diff --git a/systems/nixinate.nix b/systems/nixinate.nix
index 5f1c66f..0c54e9c 100644
--- a/systems/nixinate.nix
+++ b/systems/nixinate.nix
@@ -1,9 +1,8 @@
+{ inputs, self, ... }:
{
- inputs,
- self,
- ...
-}: {
- perSystem = {system, ...}: {
- apps = (inputs.nixinate.nixinate.${system} self).nixinate;
- };
+ perSystem =
+ { system, ... }:
+ {
+ apps = (inputs.nixinate.nixinate.${system} self).nixinate;
+ };
}
diff --git a/systems/nixos.nix b/systems/nixos.nix
index 9f95f02..2cd9b31 100644
--- a/systems/nixos.nix
+++ b/systems/nixos.nix
@@ -1,19 +1,16 @@
-{self, ...}: {
+{ self, ... }:
+{
flake = {
- nixosConfigurations = let
- inherit (self.lib) nixosSystem nixosSystemStable;
- in {
- glados = nixosSystem {
- modules = [./glados];
- };
+ nixosConfigurations =
+ let
+ inherit (self.lib) nixosSystem nixosSystemStable;
+ in
+ {
+ glados = nixosSystem { modules = [ ./glados ]; };
- glados-wsl = nixosSystem {
- modules = [./glados-wsl];
- };
+ glados-wsl = nixosSystem { modules = [ ./glados-wsl ]; };
- atlas = nixosSystemStable {
- modules = [./atlas];
+ atlas = nixosSystemStable { modules = [ ./atlas ]; };
};
- };
};
}
diff --git a/users/default.nix b/users/default.nix
index 38d391f..671ce14 100644
--- a/users/default.nix
+++ b/users/default.nix
@@ -1,15 +1,14 @@
+{ self, withSystem, ... }:
{
- self,
- withSystem,
- ...
-}: {
- flake.homeConfigurations = let
- inherit (self.lib) homeManagerConfiguration;
- pkgsFor = system: withSystem system ({pkgs, ...}: pkgs);
- in {
- seth = homeManagerConfiguration {
- pkgs = pkgsFor "x86_64-linux";
- modules = [./seth/home.nix];
+ flake.homeConfigurations =
+ let
+ inherit (self.lib) homeManagerConfiguration;
+ pkgsFor = system: withSystem system ({ pkgs, ... }: pkgs);
+ in
+ {
+ seth = homeManagerConfiguration {
+ pkgs = pkgsFor "x86_64-linux";
+ modules = [ ./seth/home.nix ];
+ };
};
- };
}
diff --git a/users/seth/base/default.nix b/users/seth/base/default.nix
index b6c7571..7b97b51 100644
--- a/users/seth/base/default.nix
+++ b/users/seth/base/default.nix
@@ -1,19 +1,13 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth;
-in {
+in
+{
options.seth = {
enable = lib.mkEnableOption "Seth's home configuration";
};
- imports = [
- ./standalone.nix
- ];
+ imports = [ ./standalone.nix ];
- config = lib.mkIf cfg.enable {
- home.stateVersion = "23.11";
- };
+ config = lib.mkIf cfg.enable { home.stateVersion = "23.11"; };
}
diff --git a/users/seth/base/standalone.nix b/users/seth/base/standalone.nix
index ce8863c..14845dc 100644
--- a/users/seth/base/standalone.nix
+++ b/users/seth/base/standalone.nix
@@ -3,24 +3,24 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.standalone;
enable = config.seth.enable && cfg.enable;
-in {
+in
+{
options.seth.standalone = {
enable = lib.mkEnableOption "Standalone options";
};
config = lib.mkIf enable {
- _module.args.osConfig = {};
+ _module.args.osConfig = { };
programs.home-manager.enable = true;
home = {
username = "seth";
homeDirectory =
- if pkgs.stdenv.isDarwin
- then "/Users/${config.home.username}"
- else "/home/${config.home.username}";
+ if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
};
};
}
diff --git a/users/seth/desktop/budgie/default.nix b/users/seth/desktop/budgie/default.nix
index bf72ee5..34ecbbd 100644
--- a/users/seth/desktop/budgie/default.nix
+++ b/users/seth/desktop/budgie/default.nix
@@ -1,16 +1,18 @@
-{
- lib,
- osConfig,
- ...
-}: let
+{ lib, osConfig, ... }:
+let
enable = osConfig.services.xserver.desktopManager.budgie.enable or false;
-in {
+in
+{
config = lib.mkIf enable {
dconf = {
enable = true;
settings = {
"com.solus-project.budgie-panel:Budgie" = {
- pinned-launchers = ["firefox.desktop" "nemo.desktop" "discord.desktop"];
+ pinned-launchers = [
+ "firefox.desktop"
+ "nemo.desktop"
+ "discord.desktop"
+ ];
};
};
};
diff --git a/users/seth/desktop/default.nix b/users/seth/desktop/default.nix
index 7f477df..9da094d 100644
--- a/users/seth/desktop/default.nix
+++ b/users/seth/desktop/default.nix
@@ -4,15 +4,15 @@
pkgs,
osConfig,
...
-}: let
+}:
+let
cfg = config.seth.desktop;
-in {
+in
+{
options.seth.desktop = {
- enable =
- lib.mkEnableOption "desktop"
- // {
- default = osConfig.desktop.enable or false;
- };
+ enable = lib.mkEnableOption "desktop" // {
+ default = osConfig.desktop.enable or false;
+ };
};
imports = [
@@ -35,19 +35,19 @@ in {
"--enable-features=UseSkiaRenderer,WaylandWindowDecorations"
];
in
- if pkgs.stdenv.isLinux
- then
- discord.overrideAttrs (old: {
- desktopItem = old.desktopItem.override (old': {
- exec = "${old'.exec} ${flags}";
- });
- })
- else discord
+ if pkgs.stdenv.isLinux then
+ discord.overrideAttrs (old: {
+ desktopItem = old.desktopItem.override (old': {
+ exec = "${old'.exec} ${flags}";
+ });
+ })
+ else
+ discord
)
pkgs.element-desktop
pkgs.spotify
- (pkgs.prismlauncher.override {withWaylandGLFW = true;})
+ (pkgs.prismlauncher.override { withWaylandGLFW = true; })
];
};
}
diff --git a/users/seth/desktop/gnome/default.nix b/users/seth/desktop/gnome/default.nix
index 2ed45b2..6550073 100644
--- a/users/seth/desktop/gnome/default.nix
+++ b/users/seth/desktop/gnome/default.nix
@@ -3,9 +3,11 @@
pkgs,
osConfig,
...
-}: let
+}:
+let
enable = osConfig.services.xserver.desktopManager.gnome.enable or false;
-in {
+in
+{
config = lib.mkIf enable {
home = {
packages = with pkgs; [
@@ -28,9 +30,7 @@ in {
"org/gnome/shell" = {
disable-user-extensions = false;
- enabled-extensions = [
- ];
+ enabled-extensions = [ "[email protected]" ];
favorite-apps = [
"chromium-browser.desktop"
diff --git a/users/seth/desktop/plasma/default.nix b/users/seth/desktop/plasma/default.nix
index c4a30a1..679b1cd 100644
--- a/users/seth/desktop/plasma/default.nix
+++ b/users/seth/desktop/plasma/default.nix
@@ -3,13 +3,13 @@
pkgs,
osConfig,
...
-}: let
+}:
+let
enable = osConfig.services.desktopManager.plasma6.enable or false;
-in {
+in
+{
config = lib.mkIf enable {
- home.packages = with pkgs; [
- papirus-icon-theme
- ];
+ home.packages = with pkgs; [ papirus-icon-theme ];
xdg = {
dataFile."konsole/catppuccin-mocha.colorscheme".source =
diff --git a/users/seth/home.nix b/users/seth/home.nix
index ca5b7c6..acfc535 100644
--- a/users/seth/home.nix
+++ b/users/seth/home.nix
@@ -1,5 +1,5 @@
{
- imports = [./.];
+ imports = [ ./. ];
seth = {
enable = true;
standalone.enable = true;
diff --git a/users/seth/programs/chromium.nix b/users/seth/programs/chromium.nix
index 5c44dec..da769ba 100644
--- a/users/seth/programs/chromium.nix
+++ b/users/seth/programs/chromium.nix
@@ -3,32 +3,32 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.programs.chromium;
-in {
+in
+{
options.seth.programs.chromium = {
- enable =
- lib.mkEnableOption "Chromium configuration"
- // {
- default = config.seth.desktop.enable;
- };
+ enable = lib.mkEnableOption "Chromium configuration" // {
+ default = config.seth.desktop.enable;
+ };
};
config = lib.mkIf cfg.enable {
programs.chromium = {
enable = true;
- dictionaries = [pkgs.hunspellDictsChromium.en_US];
+ dictionaries = [ pkgs.hunspellDictsChromium.en_US ];
extensions = [
# ublock origin
- {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";}
+ { id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; }
# bitwarden
- {id = "nngceckbapebfimnlniiiahkandclblb";}
+ { id = "nngceckbapebfimnlniiiahkandclblb"; }
# floccus bookmark sync
- {id = "fnaicdffflnofjppbagibeoednhnbjhg";}
+ { id = "fnaicdffflnofjppbagibeoednhnbjhg"; }
# tabby cat
- {id = "mefhakmgclhhfbdadeojlkbllmecialg";}
+ { id = "mefhakmgclhhfbdadeojlkbllmecialg"; }
];
};
};
diff --git a/users/seth/programs/default.nix b/users/seth/programs/default.nix
index 81cfdb7..950c939 100644
--- a/users/seth/programs/default.nix
+++ b/users/seth/programs/default.nix
@@ -4,15 +4,15 @@
pkgs,
inputs,
...
-}: let
+}:
+let
cfg = config.seth.programs;
-in {
+in
+{
options.seth.programs = {
- basePrograms.enable =
- lib.mkEnableOption "base programs and configurations"
- // {
- default = config.seth.enable;
- };
+ basePrograms.enable = lib.mkEnableOption "base programs and configurations" // {
+ default = config.seth.enable;
+ };
};
imports = with inputs; [
diff --git a/users/seth/programs/firefox/arkenfox.nix b/users/seth/programs/firefox/arkenfox.nix
index 7dfc121..de3992f 100644
--- a/users/seth/programs/firefox/arkenfox.nix
+++ b/users/seth/programs/firefox/arkenfox.nix
@@ -3,17 +3,17 @@
lib,
inputs,
...
-}: let
+}:
+let
cfg = config.seth.programs.firefox.arkenfox;
-in {
- imports = [inputs.arkenfox.hmModules.arkenfox];
+in
+{
+ imports = [ inputs.arkenfox.hmModules.arkenfox ];
options.seth.programs.firefox.arkenfox = {
- enable =
- lib.mkEnableOption "Arkenfox settings for Firefox"
- // {
- default = config.seth.programs.firefox.enable;
- };
+ enable = lib.mkEnableOption "Arkenfox settings for Firefox" // {
+ default = config.seth.programs.firefox.enable;
+ };
};
config = lib.mkIf cfg.enable {
@@ -23,51 +23,58 @@ in {
version = "126.1";
};
- profiles.arkenfox.arkenfox = let
- enableSections = sections: lib.genAttrs sections (_: {enable = true;});
- in
- lib.recursiveUpdate {
- enable = true;
+ profiles.arkenfox.arkenfox =
+ let
+ enableSections =
+ sections:
+ lib.genAttrs sections (_: {
+ enable = true;
+ });
+ in
+ lib.recursiveUpdate
+ {
+ enable = true;
- # enable safe browsing
- "0400"."0403"."browser.safebrowsing.downloads.remote.enabled".value = true;
+ # enable safe browsing
+ "0400"."0403"."browser.safebrowsing.downloads.remote.enabled".value = true;
- # fix hulu
- "1200"."1201"."security.ssl.require_safe_negotiation".value = false;
+ # fix hulu
+ "1200"."1201"."security.ssl.require_safe_negotiation".value = false;
- "2600"."2651"."browser.download.useDownloadDir" = {
- enable = true;
- value = true;
- };
+ "2600"."2651"."browser.download.useDownloadDir" = {
+ enable = true;
+ value = true;
+ };
- # disable rfp letterboxing
- "4500"."4504"."privacy.resistFingerprinting.letterboxing".value = false;
+ # disable rfp letterboxing
+ "4500"."4504"."privacy.resistFingerprinting.letterboxing".value = false;
- "5000" = {
- "5003"."signon.rememberSignons".enable = true;
- # enable search autocomplete
- "5021"."keyword.enabled".value = true;
- };
- } (enableSections [
- "0100"
- "0200"
- "0300"
- "0400"
- "0600"
- "0700"
- "0800"
- "0900"
- "1000"
- "1200"
- "1600"
- "1700"
- "2000"
- "2400"
- "2600"
- "2700"
- "2800"
- "4500"
- ]);
+ "5000" = {
+ "5003"."signon.rememberSignons".enable = true;
+ # enable search autocomplete
+ "5021"."keyword.enabled".value = true;
+ };
+ }
+ (enableSections [
+ "0100"
+ "0200"
+ "0300"
+ "0400"
+ "0600"
+ "0700"
+ "0800"
+ "0900"
+ "1000"
+ "1200"
+ "1600"
+ "1700"
+ "2000"
+ "2400"
+ "2600"
+ "2700"
+ "2800"
+ "4500"
+ ]);
};
};
}
diff --git a/users/seth/programs/firefox/default.nix b/users/seth/programs/firefox/default.nix
index d497f2a..6544ec0 100644
--- a/users/seth/programs/firefox/default.nix
+++ b/users/seth/programs/firefox/default.nix
@@ -4,20 +4,18 @@
pkgs,
inputs,
...
-}: let
+}:
+let
cfg = config.seth.programs.firefox;
-in {
+in
+{
options.seth.programs.firefox = {
- enable =
- lib.mkEnableOption "Firefox configuration"
- // {
- default = config.seth.desktop.enable;
- };
+ enable = lib.mkEnableOption "Firefox configuration" // {
+ default = config.seth.desktop.enable;
+ };
};
- imports = [
- ./arkenfox.nix
- ];
+ imports = [ ./arkenfox.nix ];
config = lib.mkIf cfg.enable {
home.sessionVariables = {
diff --git a/users/seth/programs/git.nix b/users/seth/programs/git.nix
index 674b3c8..4832bc1 100644
--- a/users/seth/programs/git.nix
+++ b/users/seth/programs/git.nix
@@ -1,13 +1,15 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth.programs.git;
-in {
+in
+{
options.seth.programs.git = {
- enable = lib.mkEnableOption "Git configuration settings" // {default = config.seth.enable;};
- gh.enable = lib.mkEnableOption "GitHub CLI support" // {default = cfg.enable;};
+ enable = lib.mkEnableOption "Git configuration settings" // {
+ default = config.seth.enable;
+ };
+ gh.enable = lib.mkEnableOption "GitHub CLI support" // {
+ default = cfg.enable;
+ };
};
config = lib.mkIf cfg.enable {
@@ -24,7 +26,10 @@ in {
gitCredentialHelper = {
enable = true;
- hosts = ["https://github.com" "https://github.example.com"];
+ hosts = [
+ "https://github.com"
+ "https://github.example.com"
+ ];
};
};
@@ -38,7 +43,9 @@ in {
};
extraConfig = {
- init = {defaultBranch = "main";};
+ init = {
+ defaultBranch = "main";
+ };
};
signing = {
diff --git a/users/seth/programs/gpg.nix b/users/seth/programs/gpg.nix
index e709180..68276f9 100644
--- a/users/seth/programs/gpg.nix
+++ b/users/seth/programs/gpg.nix
@@ -4,11 +4,15 @@
pkgs,
osConfig,
...
-}: let
+}:
+let
cfg = config.seth.programs.gpg;
-in {
+in
+{
options.seth.programs.gpg = {
- enable = lib.mkEnableOption "GnuPG configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "GnuPG configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
diff --git a/users/seth/programs/mangohud.nix b/users/seth/programs/mangohud.nix
index f104823..1668932 100644
--- a/users/seth/programs/mangohud.nix
+++ b/users/seth/programs/mangohud.nix
@@ -1,16 +1,12 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth.programs.mangohud;
-in {
+in
+{
options.seth.programs.mangohud = {
- enable =
- lib.mkEnableOption "MangoHud configuration"
- // {
- default = config.seth.desktop.enable;
- };
+ enable = lib.mkEnableOption "MangoHud configuration" // {
+ default = config.seth.desktop.enable;
+ };
};
config = lib.mkIf cfg.enable {
diff --git a/users/seth/programs/neovim.nix b/users/seth/programs/neovim.nix
index 815b150..e5fc22c 100644
--- a/users/seth/programs/neovim.nix
+++ b/users/seth/programs/neovim.nix
@@ -4,26 +4,32 @@
pkgs,
inputs,
...
-}: let
+}:
+let
cfg = config.seth.programs.neovim;
-in {
+in
+{
options.seth.programs.neovim = {
- enable = lib.mkEnableOption "Neovim configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "Neovim configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
home.packages = [
- (let
- getchvim = inputs.getchvim.packages.${pkgs.system}.default;
- in
+ (
+ let
+ getchvim = inputs.getchvim.packages.${pkgs.system}.default;
+ in
# remove desktop file
pkgs.symlinkJoin {
name = "${getchvim.name}-nodesktop";
- paths = [getchvim];
+ paths = [ getchvim ];
postBuild = ''
rm -rf $out/share/{applications,icons}
'';
- })
+ }
+ )
];
};
}
diff --git a/users/seth/programs/ssh.nix b/users/seth/programs/ssh.nix
index 7872510..2e0d3f4 100644
--- a/users/seth/programs/ssh.nix
+++ b/users/seth/programs/ssh.nix
@@ -3,11 +3,15 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.programs.ssh;
-in {
+in
+{
options.seth.programs.ssh = {
- enable = lib.mkEnableOption "SSH configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "SSH configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
@@ -15,35 +19,37 @@ in {
enable = true;
package = pkgs.openssh;
- matchBlocks = let
- sshDir = "${config.home.homeDirectory}/.ssh";
- in {
- # git forges
- "codeberg.org" = {
- identityFile = "${sshDir}/codeberg";
- user = "git";
- };
+ matchBlocks =
+ let
+ sshDir = "${config.home.homeDirectory}/.ssh";
+ in
+ {
+ # git forges
+ "codeberg.org" = {
+ identityFile = "${sshDir}/codeberg";
+ user = "git";
+ };
- # linux packaging
- "aur.archlinux.org" = {
- identityFile = "${sshDir}/aur";
- user = "aur";
- };
+ # linux packaging
+ "aur.archlinux.org" = {
+ identityFile = "${sshDir}/aur";
+ user = "aur";
+ };
- "pagure.io" = {
- identityFile = "${sshDir}/copr";
- user = "git";
- };
+ "pagure.io" = {
+ identityFile = "${sshDir}/copr";
+ user = "git";
+ };
- # router
- "192.168.1.1" = {
- identityFile = "${sshDir}/openwrt";
- user = "root";
- };
+ # router
+ "192.168.1.1" = {
+ identityFile = "${sshDir}/openwrt";
+ user = "root";
+ };
- # servers
- "atlas".user = "atlas";
- };
+ # servers
+ "atlas".user = "atlas";
+ };
};
services.ssh-agent.enable = pkgs.stdenv.isLinux;
diff --git a/users/seth/programs/starship/default.nix b/users/seth/programs/starship/default.nix
index b6082c1..fed7fd4 100644
--- a/users/seth/programs/starship/default.nix
+++ b/users/seth/programs/starship/default.nix
@@ -1,12 +1,12 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth.programs.starship;
-in {
+in
+{
options.seth.programs.starship = {
- enable = lib.mkEnableOption "Starship configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "Starship configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
@@ -19,13 +19,11 @@ in {
enableBashIntegration = false;
enableZshIntegration = false;
- settings =
- {
- format = "$all";
- palette = "catppuccin_mocha";
- command_timeout = 250;
- }
- // lib.importTOML ./starship.toml;
+ settings = {
+ format = "$all";
+ palette = "catppuccin_mocha";
+ command_timeout = 250;
+ } // lib.importTOML ./starship.toml;
};
};
}
diff --git a/users/seth/programs/vim.nix b/users/seth/programs/vim.nix
index b07b090..37e5345 100644
--- a/users/seth/programs/vim.nix
+++ b/users/seth/programs/vim.nix
@@ -3,12 +3,16 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.programs.vim;
inherit (config.xdg) configHome dataHome stateHome;
-in {
+in
+{
options.seth.programs.vim = {
- enable = lib.mkEnableOption "Vim configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "Vim configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
diff --git a/users/seth/programs/vscode.nix b/users/seth/programs/vscode.nix
index a2be13c..87f988b 100644
--- a/users/seth/programs/vscode.nix
+++ b/users/seth/programs/vscode.nix
@@ -3,15 +3,15 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.programs.vscode;
-in {
+in
+{
options.seth.programs.vscode = {
- enable =
- lib.mkEnableOption "VSCode configuration"
- // {
- default = config.seth.desktop.enable;
- };
+ enable = lib.mkEnableOption "VSCode configuration" // {
+ default = config.seth.desktop.enable;
+ };
};
config = lib.mkIf cfg.enable {
diff --git a/users/seth/shell/bash.nix b/users/seth/shell/bash.nix
index 216e609..3be0254 100644
--- a/users/seth/shell/bash.nix
+++ b/users/seth/shell/bash.nix
@@ -1,12 +1,12 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth.shell.bash;
-in {
+in
+{
options.seth.shell.bash = {
- enable = lib.mkEnableOption "Bash configuration" // {default = config.seth.enable;};
+ enable = lib.mkEnableOption "Bash configuration" // {
+ default = config.seth.enable;
+ };
};
config = lib.mkIf cfg.enable {
diff --git a/users/seth/shell/default.nix b/users/seth/shell/default.nix
index b86697c..bebd790 100644
--- a/users/seth/shell/default.nix
+++ b/users/seth/shell/default.nix
@@ -1,13 +1,15 @@
-{
- config,
- lib,
- ...
-}: let
+{ config, lib, ... }:
+let
cfg = config.seth.shell;
-in {
+in
+{
options.seth.shell = {
- aliases.enable = lib.mkEnableOption "Shell aliases" // {default = config.seth.enable;};
- variables.enable = lib.mkEnableOption "Shell variables" // {default = config.seth.enable;};
+ aliases.enable = lib.mkEnableOption "Shell aliases" // {
+ default = config.seth.enable;
+ };
+ variables.enable = lib.mkEnableOption "Shell variables" // {
+ default = config.seth.enable;
+ };
};
imports = [
diff --git a/users/seth/shell/fish.nix b/users/seth/shell/fish.nix
index 810d9fc..d910c05 100644
--- a/users/seth/shell/fish.nix
+++ b/users/seth/shell/fish.nix
@@ -3,12 +3,16 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.shell.fish;
-in {
+in
+{
options.seth.shell.fish = {
enable = lib.mkEnableOption "Fish configuration";
- withPlugins = lib.mkEnableOption "Fish plugins" // {default = true;};
+ withPlugins = lib.mkEnableOption "Fish plugins" // {
+ default = true;
+ };
};
config = lib.mkIf cfg.enable {
@@ -37,15 +41,14 @@ in {
}
(lib.mkIf cfg.withPlugins {
- plugins = let
- mkFishPlugins = map (plugin: {
- name = plugin;
- inherit (pkgs.fishPlugins.${plugin}) src;
- });
- in
- mkFishPlugins [
- "autopair"
- ];
+ plugins =
+ let
+ mkFishPlugins = map (plugin: {
+ name = plugin;
+ inherit (pkgs.fishPlugins.${plugin}) src;
+ });
+ in
+ mkFishPlugins [ "autopair" ];
})
];
};
diff --git a/users/seth/shell/nu.nix b/users/seth/shell/nu.nix
index 9b6deeb..f52f049 100644
--- a/users/seth/shell/nu.nix
+++ b/users/seth/shell/nu.nix
@@ -3,10 +3,12 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.shell.nushell;
theme = "catppuccin-${config.catppuccin.flavor}";
-in {
+in
+{
options.seth.shell.nushell = {
enable = lib.mkEnableOption "Nushell configuration";
};
diff --git a/users/seth/shell/zsh.nix b/users/seth/shell/zsh.nix
index 4ce116a..0983f15 100644
--- a/users/seth/shell/zsh.nix
+++ b/users/seth/shell/zsh.nix
@@ -3,12 +3,16 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.seth.shell.zsh;
-in {
+in
+{
options.seth.shell.zsh = {
enable = lib.mkEnableOption "Zsh configuration";
- withPlugins = lib.mkEnableOption "Zsh plugins" // {default = true;};
+ withPlugins = lib.mkEnableOption "Zsh plugins" // {
+ default = true;
+ };
};
config = lib.mkIf cfg.enable {