many things:

* flake.lock update, with code changes needed.
* miniserve.rs static directory listing.
* change from typst-ls to tinymist for typst lsp
* deletion of hugo template.
* change from self-built duckdns module to nixpkgs one.
This commit is contained in:
Gabe Venberg 2025-02-24 11:39:38 +01:00
parent 73451d607b
commit e8a5bb3bc9
29 changed files with 103 additions and 267 deletions

View file

@ -7,7 +7,7 @@
programs.kitty = {
enable = true;
font = {
package = pkgs.fira-code-nerdfont;
package = pkgs.nerd-fonts.fira-code;
name = "FiraCode Nerd Font";
};
themeFile = "gruvbox-dark";

View file

@ -4,7 +4,12 @@
pkgs,
...
}: {
programs.zellij.enable = true;
programs.zellij = {
enable = true;
enableBashIntegration = false;
enableZshIntegration = false;
enableFishIntegration = false;
};
home.file = {
".config/zellij/config.kdl".source = ./config.kdl;
};

View file

@ -5,11 +5,6 @@
lib,
...
}: {
virtualisation.docker = {
enable = true;
daemon.settings = {
userland-proxy = false;
};
};
virtualisation.docker.enable = true;
users.users.${config.host.user}.extraGroups = ["docker"];
}

View file

@ -12,12 +12,10 @@
volumes = ["/storage/factorio:/factorio"];
hostname = "factorio";
ports = [
"34197:34197"
"27015:27015"
"34197:34197/udp"
"27015:27015/tcp"
];
environment = {
UPDATE_MODS_ON_START = "true";
};
environment = {UPDATE_MODS_ON_START = "true";};
};
};
imports = [

View file

@ -0,0 +1,35 @@
{
inputs,
config,
pkgs,
lib,
...
}:let
port="8080";
in {
systemd.services.miniserve = {
wantedBy = ["multi-user.target"];
after = ["network.target"];
description = "A directory listing miniserve instance";
serviceConfig = {
ExecStart = lib.concatStringsSep " " [
"${pkgs.miniserve}/bin/miniserve"
"--enable-tar-gz"
"--show-wget-footer"
"--readme"
"--port ${port}"
"--qrcode"
# "--no-symlinks"
"--interfaces 127.0.0.1"
"/storage/miniserve"
];
};
};
services.nginx.virtualHosts."static.venberg.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
};
}

View file

@ -4,7 +4,7 @@
...
}: {
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;

View file

@ -34,11 +34,11 @@
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"lastModified": 1735644329,
"narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
"type": "github"
},
"original": {
@ -54,11 +54,11 @@
]
},
"locked": {
"lastModified": 1730751873,
"narHash": "sha256-sdY29RWz0S7VbaoTwSy6RummdHKf0wUTaBlqPxrtvmQ=",
"lastModified": 1739841949,
"narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
"owner": "nix-community",
"repo": "disko",
"rev": "856a2902156ba304efebd4c1096dbf7465569454",
"rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
"type": "github"
},
"original": {
@ -69,11 +69,11 @@
},
"flake-compat": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
@ -90,11 +90,11 @@
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
@ -108,11 +108,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -126,11 +126,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -149,18 +149,14 @@
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730814269,
"narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=",
"lastModified": 1737465171,
"narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "d70155fdc00df4628446352fc58adc640cd705c2",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
@ -198,11 +194,11 @@
]
},
"locked": {
"lastModified": 1730837930,
"narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=",
"lastModified": 1740347597,
"narHash": "sha256-st5q9egkPGz8TUcVVlIQX7y6G3AzHob+6M963bwVq74=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f607e07f3ac7e53541120536708e824acccfaa8",
"rev": "12e26a74e5eb1a31e13daaa08858689e25ebd449",
"type": "github"
},
"original": {
@ -247,11 +243,11 @@
]
},
"locked": {
"lastModified": 1730779758,
"narHash": "sha256-5WI9AnsBwhLzVRnQm3Qn9oAbROnuLDQTpaXeyZCK8qw=",
"lastModified": 1738743987,
"narHash": "sha256-O3bnAfsObto6l2tQOmQlrO6Z2kD6yKwOWfs7pA0CpOc=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0e3f3f017c14467085f15d42343a3aaaacd89bcb",
"rev": "ae406c04577ff9a64087018c79b4fdc02468c87c",
"type": "github"
},
"original": {
@ -279,11 +275,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1730886862,
"narHash": "sha256-wCZtRGM1NGxq6VG4+TMzfsa4cuG2VJVtowtYuWW5W3g=",
"lastModified": 1740387674,
"narHash": "sha256-pGk/aA0EBvI6o4DeuZsr05Ig/r4uMlSaf5EWUZEWM10=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "90642a0deae927fa911d49d4f7c5616257105141",
"rev": "d58f642ddb23320965b27beb0beba7236e9117b5",
"type": "github"
},
"original": {
@ -298,19 +294,16 @@
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730453870,
"narHash": "sha256-d+kIgz4BvTXb7emjSFV3zjNydGmLUmuluQjdBb51R9o=",
"lastModified": 1740046902,
"narHash": "sha256-Xbhz8eEqBmNpvqaGFbF5JopmfNJccWUr8eExtU/iGX4=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "adb6bc4b661a43328752b4575be4968a4990c033",
"rev": "c4f6ae89468939d9fcf1a317c062cf5dd02004ea",
"type": "github"
},
"original": {
@ -322,11 +315,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"lastModified": 1740126099,
"narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"rev": "32fb99ba93fea2798be0e997ea331dd78167f814",
"type": "github"
},
"original": {
@ -336,22 +329,6 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730602179,
"narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
@ -371,11 +348,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1730877618,
"narHash": "sha256-HQTKujMb6SwnOqtWA+A7lR4MOCBZUW4vtrkK1E/QweU=",
"lastModified": 1739902813,
"narHash": "sha256-BgOQcKKz7VNvSHIbBllHisv32HvF3W3ALF9sdnC++V8=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "898246c943ba545a79d585093e97476ceb31f872",
"rev": "0ab9947137cd034ec64eb5cd9ede94e53af21f50",
"type": "github"
},
"original": {
@ -394,11 +371,11 @@
]
},
"locked": {
"lastModified": 1730760712,
"narHash": "sha256-F4H98tjNgySlSLItuOqHYo9LF85rFoS/Vr0uOrq7BM4=",
"lastModified": 1738508923,
"narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=",
"owner": "NuschtOS",
"repo": "search",
"rev": "aa5214c81b904a19f7a54f7a8f288f7902586eee",
"rev": "86e2038290859006e05ca7201425ea5b5de4aecb",
"type": "github"
},
"original": {
@ -426,15 +403,14 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1730883027,
"narHash": "sha256-pvXMOJIqRW0trsW+FzRMl6d5PbsM4rWfD5lcKCOrrwI=",
"lastModified": 1739262228,
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
"owner": "mic92",
"repo": "sops-nix",
"rev": "c5ae1e214ff935f2d3593187a131becb289ea639",
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
"type": "github"
},
"original": {
@ -481,11 +457,11 @@
]
},
"locked": {
"lastModified": 1730321837,
"narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=",
"lastModified": 1738680491,
"narHash": "sha256-8X7tR3kFGkE7WEF5EXVkt4apgaN85oHZdoTGutCFs6I=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "746901bb8dba96d154b66492a29f5db0693dbfcc",
"rev": "64dbb922d51a42c0ced6a7668ca008dded61c483",
"type": "github"
},
"original": {

View file

@ -8,7 +8,6 @@
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};

View file

@ -24,6 +24,7 @@ inputs.nixpkgs.lib.nixosSystem {
../../configs/nixos/grocy.nix
../../configs/nixos/factorio-docker.nix
../../configs/nixos/cyberchef.nix
../../configs/nixos/miniserve-static.nix
({
config,
pkgs,

View file

@ -29,7 +29,7 @@
ruff.enable = true;
taplo.enable = true;
texlab.enable = true;
typst_lsp.enable = true;
tinymist.enable = true;
uiua.enable = true;
yamlls.enable = true;
zls.enable = true;

View file

@ -1,6 +1,5 @@
{
imports = [
./duckdns.nix
./hostopts.nix
];
}

View file

@ -1,86 +0,0 @@
{
inputs,
config,
pkgs,
lib,
...
}: let
cfg = config.services.duckdns;
urlFile = pkgs.writeText "curlurl" "url=https://www.duckdns.org/update?domains=@domains_placeholder@&token=@token_placeholder@&ip=";
in {
# partially taken from https://github.com/NixOS/nixpkgs/pull/294489
options = {
services.duckdns = {
enable = lib.mkEnableOption "Enable duckdns updating";
tokenFile = lib.mkOption {
default = null;
type = lib.types.path;
description = ''
The path to a file containing the token
used to authenticate with DuckDNS.
'';
};
domains = lib.mkOption {
type = lib.types.nullOr (lib.types.listOf lib.types.str);
example = ["examplehost"];
description = lib.mdDoc ''
The record(s) to update in DuckDNS
(without the .duckdns.org prefix)
'';
};
domainsFile = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.path;
description = ''
The path to a file containing a
newline-separated list of DuckDNS
domain(s) to be updated
'';
};
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.domains != null || cfg.domainsFile != null;
message = "services.duckdns.domains or services.duckdns.domainsFile has to be defined";
}
];
systemd.services.duckdns = {
description = "DuckDNS Dynamic DNS Client";
after = ["network.target"];
wantedBy = ["multi-user.target"];
# every 5 minutes
startAt = "*:00/5:00";
serviceConfig = {
Type = "simple";
DynamicUser = true;
RuntimeDirectory = "duckdns-update";
RuntimeDirectoryMode = "700";
LoadCredential =
[
"tokenFile:${cfg.tokenFile}"
]
++ lib.optionals (cfg.domainsFile != null) ["domainsFile:${cfg.domainsFile}"];
};
script = ''
install --mode 600 ${urlFile} $RUNTIME_DIRECTORY/curlurl
# replace the token
${pkgs.replace-secret}/bin/replace-secret @token_placeholder@ $CREDENTIALS_DIRECTORY/tokenFile $RUNTIME_DIRECTORY/curlurl
# initalise the replacement file for the domains from the domains file if it exists, otherwise make it empty.
install --mode 600 ${
if (cfg.domainsFile != null)
then "$CREDENTIALS_DIRECTORY/domainsFile"
else "/dev/null"
} $RUNTIME_DIRECTORY/domains
# these are already in the nix store, so doesnt matter if they leak via cmdline.
echo '${lib.strings.concatStringsSep "\n" cfg.domains}' >> $RUNTIME_DIRECTORY/domains
${pkgs.gnused}/bin/sed -zi 's/\n/,/g' $RUNTIME_DIRECTORY/domains
${pkgs.replace-secret}/bin/replace-secret @domains_placeholder@ $RUNTIME_DIRECTORY/domains $RUNTIME_DIRECTORY/curlurl
${pkgs.curl}/bin/curl --no-progress-meter --insecure --config $RUNTIME_DIRECTORY/curlurl | ${pkgs.gnugrep}/bin/grep -v "KO"
'';
};
};
}

View file

@ -19,8 +19,8 @@
home.packages = with pkgs; [
tre-command
diskonaut
hyperfine
dua
fclones
libqalculate
];

View file

@ -3,12 +3,12 @@
path = ./default;
description = "a basic blank devshell flake";
};
hugo = {
path = ./hugo;
description = "a flake for getting a hugo website up and running";
};
latex = {
path = ./latex;
description = "A flake containing a basic latex environment";
};
typst = {
path= ./typst;
description = "A flake containing a basic typst environment";
};
}

View file

@ -1 +0,0 @@
use flake

View file

@ -1,16 +0,0 @@
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock
# for direnv
.direnv

View file

@ -1,5 +0,0 @@
+++
date = '{{ .Date }}'
draft = true
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
+++

View file

@ -1,26 +0,0 @@
{
description = "hugo development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in
with pkgs; {
devShells.default = mkShell {
buildInputs = [
hugo
just
rsync
];
};
});
}

View file

@ -1,22 +0,0 @@
languageCode = 'en-us'
baseURL = "https://example.com"
title = "Title"
enableRobotsTXT = true
[markup.goldmark.extensions]
definitionList = true
footnote = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.extensions.extras.insert]
enable = true
[markup.goldmark.extensions.extras.mark]
enable = true
[markup.goldmark.extensions.extras.subscript]
enable = true
[markup.goldmark.extensions.extras.superscript]
enable = true
[security]
enableInlineShortcodes = true

View file

@ -1,10 +0,0 @@
preview:
hugo serve --buildDrafts --buildExpired --buildFuture --navigateToChanged
USER:='root'
HOST:='1.1.1.1'
DIR:='/srv/folder'
deploy:
hugo --minify
rsync -rvz --delete public/ {{USER}}@{{HOST}}:{{DIR}} # this will delete everything on the server that's not in the local public folder

View file

@ -18,7 +18,6 @@
devShells.default = mkShell {
buildInputs = [
typst
just
];
};
});

View file

@ -1,5 +0,0 @@
preview:
typst watch main.typ
compile:
typst compile main.typ