chore: initial format

This commit is contained in:
truxnell 2024-03-18 20:26:02 +11:00
parent dc5bc4aecc
commit c6e6e00b66
28 changed files with 172 additions and 184 deletions

View file

@ -28,3 +28,8 @@ tasks:
cmds: cmds:
- task: lint - task: lint
- task: pc-run - task: pc-run
format:
desc: Check project files
cmds:
- nixpkgs-fmt {{.ROOT_DIR}}

View file

@ -18,12 +18,13 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { outputs =
self, { self
nixpkgs, , nixpkgs
sops-nix, , sops-nix
... , ...
} @ inputs: let } @ inputs:
let
inherit (self) outputs; inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [ forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux" "aarch64-linux"

View file

@ -1,7 +1,6 @@
{ { config
config, , pkgs
pkgs, , ...
...
}: { }: {
imports = [ imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>

View file

@ -1,17 +1,20 @@
{ {
description = "A flake to build a basic NixOS iso"; description = "A flake to build a basic NixOS iso";
inputs.nixos.url = "github:nixos/nixpkgs/nixos-22.11"; inputs.nixos.url = "github:nixos/nixpkgs/nixos-22.11";
outputs = { outputs =
self, { self
nixos, , nixos
,
}: { }: {
nixosConfigurations = let nixosConfigurations =
let
exampleBase = { exampleBase = {
isoImage.squashfsCompression = "gzip -Xcompression-level 1"; isoImage.squashfsCompression = "gzip -Xcompression-level 1";
systemd.services.sshd.wantedBy = nixos.lib.mkForce [ "multi-user.target" ]; systemd.services.sshd.wantedBy = nixos.lib.mkForce [ "multi-user.target" ];
users.users.root.openssh.authorizedKeys.keys = [ "<my ssh key>" ]; users.users.root.openssh.authorizedKeys.keys = [ "<my ssh key>" ];
}; };
in { in
{
x86 = nixos.lib.nixosSystem { x86 = nixos.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [

View file

@ -1,11 +1,10 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
imports = [ imports = [
# Host-specific # Host-specific

View file

@ -1,13 +1,14 @@
{ { config
config, , inputs
inputs, , ...
... }:
}: let let
inherit (config.networking) hostName; inherit (config.networking) hostName;
# Only enable auto upgrade if current config came from a clean tree # Only enable auto upgrade if current config came from a clean tree
# This avoids accidental auto-upgrades when working locally. # This avoids accidental auto-upgrades when working locally.
isClean = inputs.self ? rev; isClean = inputs.self ? rev;
in { in
{
system.autoUpgrade = { system.autoUpgrade = {
enable = isClean; enable = isClean;
dates = "hourly"; dates = "hourly";

View file

@ -1,9 +1,8 @@
{ { inputs
inputs, , outputs
outputs, , config
config, , sops-nix
sops-nix, , ...
...
}: { }: {
imports = imports =
[ [

View file

@ -1,7 +1,6 @@
{ { inputs
inputs, , lib
lib, , ...
...
}: { }: {
nix = { nix = {
settings = { settings = {

View file

@ -1,12 +1,13 @@
{ { outputs
outputs, , lib
lib, , config
config, , ...
... }:
}: let let
inherit (config.networking) hostName; inherit (config.networking) hostName;
hosts = outputs.nixosConfigurations; hosts = outputs.nixosConfigurations;
in { in
{
services.openssh = { services.openssh = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bat bat

View file

@ -1,10 +1,11 @@
{ { pkgs
pkgs, , config
config, , ...
... }:
}: let let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in { in
{
users.users.truxnell = { users.users.truxnell = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish; shell = pkgs.fish;

View file

@ -1,8 +1,7 @@
{ { inputs
inputs, , outputs
outputs, , config
config, , ...
...
}: { }: {
# Time # Time
networking.timeServers = [ "10.8.10.1" ]; networking.timeServers = [ "10.8.10.1" ];

View file

@ -1,7 +1,6 @@
{ { config
config, , lib
lib, , ...
...
}: { }: {
# Current nixpkgs cf-ddns only supports using a env file for the apitoken # Current nixpkgs cf-ddns only supports using a env file for the apitoken
# but not for domains, which makes them hard to find. # but not for domains, which makes them hard to find.

View file

@ -1,10 +1,9 @@
# Ref: https://nixos.wiki/wiki/Encrypted_DNS#dnscrypt-proxy2 # Ref: https://nixos.wiki/wiki/Encrypted_DNS#dnscrypt-proxy2
{ { inputs
inputs, , outputs
outputs, , pkgs
pkgs, , config
config, , ...
...
}: { }: {
# Disable resolvd to ensure it doesnt re-write /etc/resolv.conf # Disable resolvd to ensure it doesnt re-write /etc/resolv.conf
config.services.resolved.enable = false; config.services.resolved.enable = false;

View file

@ -1,7 +1,9 @@
# Warning, this file is autogenerated by nix4vscode. Don't modify this manually. # Warning, this file is autogenerated by nix4vscode. Don't modify this manually.
{pkgs}: let { pkgs }:
let
vscode-utils = pkgs.vscode-utils; vscode-utils = pkgs.vscode-utils;
in { in
{
"ms-python"."python" = vscode-utils.extensionFromVscodeMarketplace { "ms-python"."python" = vscode-utils.extensionFromVscodeMarketplace {
name = "python"; name = "python";
publisher = "ms-python"; publisher = "ms-python";

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
programs.firefox = { programs.firefox = {
enable = true; enable = true;

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
# Ref: https://nixos.wiki/wiki/GNOME # Ref: https://nixos.wiki/wiki/GNOME

View file

@ -1,8 +1,7 @@
{ { inputs
inputs, , outputs
outputs, , config
config, , ...
...
}: { }: {
# init secret # init secret
config.sops.secrets."system/mail/maddy/envFile" = { config.sops.secrets."system/mail/maddy/envFile" = {

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , ...
...
}: { }: {
services.prometheus.exporters = { services.prometheus.exporters = {
node = { node = {

View file

@ -1,7 +1,6 @@
{ { config
config, , pkgs
pkgs, , ...
...
}: { }: {
systemd.timers."reboot-required-check" = { systemd.timers."reboot-required-check" = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];

View file

@ -1,8 +1,7 @@
{ { inputs
inputs, , outputs
outputs, , config
config, , ...
...
}: { }: {
# SOPS settings # SOPS settings
# https://github.com/Mic92/sops-nix # https://github.com/Mic92/sops-nix

View file

@ -1,11 +1,10 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ { config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
imports = [ imports = [
# Host-specific # Host-specific

View file

@ -1,12 +1,11 @@
# 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
config, , lib
lib, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = [ ]; imports = [ ];

View file

@ -1,7 +1,6 @@
{ { config
config, , lib
lib, , ...
...
}: { }: {
imports = [ ./playground.nix ]; imports = [ ./playground.nix ];
boot.isContainer = true; boot.isContainer = true;

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , inputs
inputs, , outputs
outputs, , ...
...
}: { } }: { }

View file

@ -1,8 +0,0 @@
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
# This is useful to avoid using channels when using legacy nix commands
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
in
import (fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
})