Merge remote-tracking branch 'origin/main'
All checks were successful
/ check (push) Successful in 5m22s

This commit is contained in:
Daniel Flanagan 2024-12-19 12:23:43 -06:00
commit d32bba279a
11 changed files with 274 additions and 124 deletions

View file

@ -89,7 +89,7 @@
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default; pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides); # pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
unstable = { unstable = {
forSystems = nixpkgs-unstable.lib.genAttrs systems; forSystems = nixpkgs-unstable.lib.genAttrs systems;

View file

@ -39,7 +39,7 @@
emacs = {pkgs, ...}: { emacs = {pkgs, ...}: {
programs.emacs = { programs.emacs = {
enable = true; enable = false;
/* /*
extraConfig = '' extraConfig = ''
''; '';
@ -84,6 +84,7 @@
bat bat
homeManagerModules.helix homeManagerModules.helix
git git
jujutsu
zellij zellij
htop htop
@ -112,7 +113,7 @@
packages = with pkgs; [ packages = with pkgs; [
# tools I use when editing nix code # tools I use when editing nix code
kanidm # kanidm
nil nil
alejandra alejandra
gnupg gnupg
@ -132,7 +133,7 @@
# https://github.com/lotabout/skim/issues/494 # https://github.com/lotabout/skim/issues/494
enable = false; enable = false;
enableFishIntegration = true; enableFishIntegration = true;
defaultOptions = ["--no-clear-start" "--color=16"]; defaultOptions = ["--no-clear-start" "--color=16" "--height=20"];
}; };
programs.atuin = { programs.atuin = {
@ -362,6 +363,18 @@
}; };
}; };
jujutsu = {...}: {
programs.jujutsu = {
enable = true;
settings = {
user = {
email = "daniel@lyte.dev";
name = "Daniel Flanagan";
};
};
};
};
git = {lib, ...}: let git = {lib, ...}: let
email = lib.mkDefault "daniel@lyte.dev"; email = lib.mkDefault "daniel@lyte.dev";
in { in {

View file

@ -107,8 +107,6 @@
environment = { environment = {
variables = { variables = {
VISUAL = "hx"; VISUAL = "hx";
PAGER = "less";
MANPAGER = "less";
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
@ -197,22 +195,9 @@
}; };
}; };
less-pager = {pkgs, ...}: {
environment = {
systemPackages = [
pkgs.less
];
variables = {
PAGER = "less";
MANPAGER = "less";
};
};
};
helix-text-editor = {pkgs, ...}: { helix-text-editor = {pkgs, ...}: {
environment = { environment = {
systemPackages = [ systemPackages = [
pkgs.less
helix.packages.${pkgs.system}.helix helix.packages.${pkgs.system}.helix
]; ];
variables = { variables = {
@ -252,16 +237,21 @@
my-favorite-default-system-apps = {pkgs, ...}: { my-favorite-default-system-apps = {pkgs, ...}: {
imports = with nixosModules; [ imports = with nixosModules; [
less-pager
helix-text-editor helix-text-editor
zellij-multiplexer zellij-multiplexer
fish-shell fish-shell
]; ];
environment.systemPackages = with pkgs; [ environment = {
variables = {
PAGER = "bat --style=plain";
MANPAGER = "bat --style=plain";
};
systemPackages = with pkgs; [
curl curl
dua dua
eza # TODO: needs shell aliases bat
eza
fd fd
file file
iputils iputils
@ -276,6 +266,7 @@
rsync rsync
sd sd
]; ];
};
programs = { programs = {
traceroute.enable = true; traceroute.enable = true;
@ -462,7 +453,11 @@
}; };
}; };
development-tools = {pkgs, ...}: { development-tools = {
pkgs,
lib,
...
}: {
imports = with nixosModules; [ imports = with nixosModules; [
postgres postgres
podman podman
@ -543,7 +538,7 @@
}; };
programs.jujutsu = { programs.jujutsu = {
enable = false; # disabling for now due to CVE enable = lib.mkDefault true;
}; };
programs.k9s = { programs.k9s = {

View file

@ -816,9 +816,113 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
({...}: let ({...}: let
theme = pkgs.fetchzip { theme = pkgs.fetchzip {
url = "https://github.com/catppuccin/gitea/releases/download/v1.0.1/catppuccin-gitea.tar.gz"; url = "https://github.com/catppuccin/gitea/releases/download/v1.0.1/catppuccin-gitea.tar.gz";
sha256 = "sha256-HqVLW58lKPn81p3gTSjzkACHSBbmqPqeobAlJMubb8Y="; sha256 = "sha256-et5luA3SI7iOcEIQ3CVIu0+eiLs8C/8mOitYlWQa/uI=";
stripRoot = false;
}; };
logos = {
png = pkgs.fetchurl {
url = "https://lyte.dev/icon.png";
sha256 = "sha256-o/iZDohzXBGbpJ2PR1z23IF4FZignTAK88QwrfgTwlk=";
};
svg = pkgs.fetchurl {
url = "https://lyte.dev/img/logo.svg";
sha256 = "sha256-G9leVXNanoaCizXJaXn++JzaVcYOgRc3dJKhTQsMhVs=";
};
svg-with-background = pkgs.fetchurl {
url = "https://lyte.dev/img/logo-with-background.svg";
sha256 = "sha256-CdMTRXoQ3AI76aHW/sTqvZo1q/0XQdnQs9V1vGmiffY=";
};
};
forgejoCustomCss =
pkgs.writeText "iosevkalyte.css"
''
@font-face {
font-family: ldiosevka;
font-style: normal;
font-weight: 300;
src: local("Iosevka"), url("//lyte.dev/font/iosevkalytewebmin/iosevkalyteweb-regular.subset.woff2");
font-display: swap
}
@font-face {
font-family: ldiosevka;
font-style: italic;
font-weight: 300;
src: local("Iosevka"), url("//lyte.dev/font/iosevkalytewebmin/iosevkalyteweb-italic.subset.woff2");
font-display: swap
}
@font-face {
font-family: ldiosevka;
font-style: italic;
font-weight: 500;
src: local("Iosevka"), url("//lyte.dev/font/iosevkalytewebmin/iosevkalyteweb-bolditalic.woff2");
font-display: swap
}
:root {
--fonts-monospace: ldiosevka, ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace, var(--fonts-emoji);
}
'';
forgejoCustomHeaderTmpl =
pkgs.writeText "header.tmpl"
''
<link rel="stylesheet" href="/assets/css/iosevkalyte.css" />
<script async="" defer="" data-domain="lyte.dev" src="https://a.lyte.dev/js/script.js"></script>
'';
forgejoCustomHomeTmpl =
pkgs.writeText "home.tmpl"
''
{{template "base/head" .}}
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}" class="page-content home">
<div class="tw-mb-8 tw-px-8">
<div class="center">
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<div class="hero">
<h1 class="ui icon header title">
{{AppDisplayName}}
</h1>
<h2>{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
</div>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-flame"}} {{ctx.Locale.Tr "startpage.install"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.install_desc" "https://forgejo.org/download/#installation-from-binary" "https://forgejo.org/download/#container-image" "https://forgejo.org/download"}}
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-device-desktop"}} {{ctx.Locale.Tr "startpage.platform"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.platform_desc"}}
</p>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-rocket"}} {{ctx.Locale.Tr "startpage.lightweight"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.lightweight_desc"}}
</p>
</div>
<div class="eight wide center column">
<h1 class="hero ui icon header">
{{svg "octicon-code"}} {{ctx.Locale.Tr "startpage.license"}}
</h1>
<p class="large">
{{ctx.Locale.Tr "startpage.license_desc" "https://forgejo.org/download" "https://codeberg.org/forgejo/forgejo"}}
</p>
</div>
</div>
</div>
{{template "base/footer" .}}
'';
in { in {
# systemd.tmpfiles.settings = { # systemd.tmpfiles.settings = {
# "10-forgejo" = { # "10-forgejo" = {
@ -833,6 +937,7 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
# }; # };
services.forgejo = { services.forgejo = {
enable = true; enable = true;
package = pkgs.unstable-packages.forgejo;
stateDir = "/storage/forgejo"; stateDir = "/storage/forgejo";
settings = { settings = {
DEFAULT = { DEFAULT = {
@ -860,8 +965,8 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
# LEVEL = "Debug"; # LEVEL = "Debug";
}; };
ui = { ui = {
THEMES = "forgejo-auto,forgejo-light,forgejo-dark"; THEMES = "catppuccin-mocha-sapphire,forgejo-auto,forgejo-light,forgejo-dark";
DEFAULT_THEME = "forgejo-auto"; DEFAULT_THEME = "catppuccin-mocha-sapphire";
}; };
indexer = { indexer = {
REPO_INDEXER_ENABLED = "true"; REPO_INDEXER_ENABLED = "true";
@ -900,8 +1005,19 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
systemd.services.forgejo = { systemd.services.forgejo = {
preStart = lib.mkAfter '' preStart = lib.mkAfter ''
rm -rf ${config.services.forgejo.stateDir}/custom/public rm -rf ${config.services.forgejo.stateDir}/custom/public
mkdir -p ${config.services.forgejo.stateDir}/custom/public mkdir -p ${config.services.forgejo.stateDir}/custom/public/
ln -sf ${theme} ${config.services.forgejo.stateDir}/custom/public/css mkdir -p ${config.services.forgejo.stateDir}/custom/public/assets/
mkdir -p ${config.services.forgejo.stateDir}/custom/public/assets/img/
mkdir -p ${config.services.forgejo.stateDir}/custom/public/assets/css/
mkdir -p ${config.services.forgejo.stateDir}/custom/templates/custom/
ln -sf ${logos.png} ${config.services.forgejo.stateDir}/custom/public/assets/img/logo.png
ln -sf ${logos.svg} ${config.services.forgejo.stateDir}/custom/public/assets/img/logo.svg
ln -sf ${logos.png} ${config.services.forgejo.stateDir}/custom/public/assets/img/favicon.png
ln -sf ${logos.svg-with-background} ${config.services.forgejo.stateDir}/custom/public/assets/img/favicon.svg
ln -sf ${theme}/theme-catppuccin-mocha-sapphire.css ${config.services.forgejo.stateDir}/custom/public/assets/css/
ln -sf ${forgejoCustomCss} ${config.services.forgejo.stateDir}/custom/public/assets/css/iosevkalyte.css
ln -sf ${forgejoCustomHeaderTmpl} ${config.services.forgejo.stateDir}/custom/templates/custom/header.tmpl
ln -sf ${forgejoCustomHomeTmpl} ${config.services.forgejo.stateDir}/custom/templates/home.tmpl
''; '';
}; };

View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1734435836,
"narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4989a246d7a390a859852baddb1013f825435cee",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -3,79 +3,11 @@
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
}; };
outputs = { outputs = inputs: let
self, inherit (import nix/boilerplate.nix inputs) call;
nixpkgs,
...
}: let
inherit (self) outputs;
supportedSystems = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
overlay = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_26;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_16;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
nixpkgsFor = system: ((import nixpkgs {inherit system;}).extend overlay);
in { in {
packages = forAllSystems (system: let overlays = import nix/overlays.nix;
pkgs = nixpkgsFor system; packages = call (import nix/packages.nix);
devShells = call (import nix/shells.nix);
inherit (pkgs) beamPackages;
inherit (beamPackages) mixRelease fetchMixDeps;
version = "0.1.0";
src = ./.;
pname = "api.lyte.dev";
in {
/*
this-package = mixRelease {
inherit pname version src;
mixFodDeps = fetchMixDeps {
inherit version src;
pname = "mix-deps-${pname}";
hash = pkgs.lib.fakeSha256;
};
buildInputs = with pkgs; [sqlite];
HOME = "$(pwd)";
MIX_XDG = "$HOME";
};
default = outputs.packages.${system}.this-package;
*/
});
devShells = forAllSystems (system: let
pkgs = nixpkgsFor system;
in {
default = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
});
}; };
} }

View file

@ -0,0 +1,16 @@
inputs @ {
nixpkgs,
self,
...
}: let
forSelfOverlay =
if builtins.hasAttr "forSelf" self.overlays
then self.overlays.forSelf
else (_: p: p);
in rec {
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
}

View file

@ -0,0 +1,16 @@
{
forrSelf = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_28;
erlang = final.erlangPackages.erlang;
elixir = final.erlangPackages.elixir_1_17;
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
};
}

View file

@ -0,0 +1,24 @@
{
pkgs,
self,
...
}: {
my-package = let
version = "1.0.0";
src = ./.;
pname = "my-package";
in
pkgs.beamPackages.mixRelease {
inherit pname version src;
mixFodDeps = pkgs.beamPackages.fetchMixDeps {
inherit version src;
pname = "mix-deps-${pname}";
hash = pkgs.lib.fakeSha256;
};
# buildInputs = with pkgs; [];
# HOME = "$(pwd)";
# MIX_XDG = "$HOME";
};
default = self.packages.${pkgs.system}.my-package;
}

View file

@ -0,0 +1,15 @@
{
pkgs,
# self,
...
}: {
elixir-dev = pkgs.mkShell {
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
# inputsFrom = [self.packages.${pkgs.system}.my-package];
buildInputs = with pkgs; [
elixir
elixir-ls
inotify-tools
];
};
}

View file

@ -20,16 +20,12 @@
src = ./.; src = ./.;
hooks = { hooks = {
alejandra.enable = true; alejandra.enable = true;
# NOTE: These do not work well with `nix flake check` due to pure environments
# https://github.com/cachix/git-hooks.nix/issues/452
/*
cargo-check.enable = true; cargo-check.enable = true;
clippy = { clippy = {
enable = true; enable = true;
packageOverrides.cargo = pkgs.cargo; packageOverrides.cargo = pkgs.cargo;
packageOverrides.clippy = pkgs.rustPackages.clippy; packageOverrides.clippy = pkgs.rustPackages.clippy;
}; };
*/
rustfmt = { rustfmt = {
enable = true; enable = true;
packageOverrides.rustfmt = pkgs.rustfmt; packageOverrides.rustfmt = pkgs.rustfmt;
@ -40,7 +36,7 @@
packages = genPkgs (pkgs: { packages = genPkgs (pkgs: {
my-package = pkgs.rustPlatform.buildRustPackage { my-package = pkgs.rustPlatform.buildRustPackage {
pname = "kodotag"; pname = "my-package";
version = "0.1.0"; version = "0.1.0";
/* /*