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:
- task: lint
- task: pc-run
format:
desc: Check project files
cmds:
- nixpkgs-fmt {{.ROOT_DIR}}

View file

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

View file

@ -1,7 +1,6 @@
{
config,
pkgs,
...
{ config
, pkgs
, ...
}: {
imports = [
<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";
inputs.nixos.url = "github:nixos/nixpkgs/nixos-22.11";
outputs = {
self,
nixos,
outputs =
{ self
, nixos
,
}: {
nixosConfigurations = let
nixosConfigurations =
let
exampleBase = {
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
systemd.services.sshd.wantedBy = nixos.lib.mkForce [ "multi-user.target" ];
users.users.root.openssh.authorizedKeys.keys = [ "<my ssh key>" ];
};
in {
in
{
x86 = nixos.lib.nixosSystem {
system = "x86_64-linux";
modules = [

View file

@ -1,11 +1,10 @@
# Edit this configuration file to define what should be installed 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`).
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
imports = [
# Host-specific

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,6 @@
{
config,
lib,
...
{ config
, lib
, ...
}: {
# Current nixpkgs cf-ddns only supports using a env file for the apitoken
# 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
{
inputs,
outputs,
pkgs,
config,
...
{ inputs
, outputs
, pkgs
, config
, ...
}: {
# Disable resolvd to ensure it doesnt re-write /etc/resolv.conf
config.services.resolved.enable = false;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,10 @@
# Edit this configuration file to define what should be installed 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`).
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
imports = [
# Host-specific

View file

@ -1,12 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
{ config
, lib
, pkgs
, modulesPath
, ...
}: {
imports = [ ];

View file

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

View file

@ -1,8 +1,7 @@
{
config,
pkgs,
lib,
inputs,
outputs,
...
{ config
, pkgs
, lib
, inputs
, 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;
})