chore: initial format
This commit is contained in:
parent
dc5bc4aecc
commit
c6e6e00b66
28 changed files with 172 additions and 184 deletions
|
@ -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}}
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -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"
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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 = [
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
{
|
{ inputs
|
||||||
inputs,
|
, outputs
|
||||||
outputs,
|
, config
|
||||||
config,
|
, sops-nix
|
||||||
sops-nix,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{ inputs
|
||||||
inputs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
@ -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 = {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
bat
|
bat
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ inputs
|
||||||
inputs,
|
, outputs
|
||||||
outputs,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
# Time
|
# Time
|
||||||
networking.timeServers = [ "10.8.10.1" ];
|
networking.timeServers = [ "10.8.10.1" ];
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
# Ref: https://nixos.wiki/wiki/GNOME
|
# Ref: https://nixos.wiki/wiki/GNOME
|
||||||
|
|
||||||
|
|
|
@ -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" = {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
services.prometheus.exporters = {
|
services.prometheus.exporters = {
|
||||||
node = {
|
node = {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
systemd.timers."reboot-required-check" = {
|
systemd.timers."reboot-required-check" = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 = [ ];
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}: {
|
}: {
|
||||||
imports = [ ./playground.nix ];
|
imports = [ ./playground.nix ];
|
||||||
boot.isContainer = true;
|
boot.isContainer = true;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, inputs
|
||||||
inputs,
|
, outputs
|
||||||
outputs,
|
, ...
|
||||||
...
|
|
||||||
}: { }
|
}: { }
|
||||||
|
|
|
@ -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;
|
|
||||||
})
|
|
Reference in a new issue