Compare commits

...

7 commits

Author SHA1 Message Date
0d71113b22
shfmt: Use tabs to indent, to match pre-commit hook 2024-04-16 19:41:25 +02:00
9dc5bbc525
pre-commit-hooks repo URL updated 2024-04-16 19:41:12 +02:00
a6ccb1eaaf
fish: Add tree alias 2024-04-16 19:32:50 +02:00
5eef55d4f7
Add treefmt, run formatter 2024-04-16 19:32:32 +02:00
b142fe2109
Add headscale-ui 2024-04-16 19:30:04 +02:00
0c242f2550
atuin: Use new sync method 2024-04-16 10:34:32 +02:00
f5e956be5c
flake.lock: Update
Flake lock file updates:

• Updated input 'atuin':
    'github:atuinsh/atuin/50a73f055288d72eeeb128233e2a04bc88a5d5e8?narHash=sha256-lPAdHkIQBydROJ2e6t0nFP9X220GQ4sEwb5lFQBGYb0%3D' (2024-04-15)
  → 'github:atuinsh/atuin/a0231a70950fbec9dcc3403e37066d891d1fc833?narHash=sha256-TTQ2XLqng7TMLnRsLDb/50yyHYuMSPZJ4H%2B7CEFWQQ0%3D' (2024-04-15)
• Updated input 'disko':
    'github:nix-community/disko/bb5ba68ebb73b5ca7996b64e1457fe885891e78e?narHash=sha256-k1aV06cotPwWO3FW%2Bho%2BdEoGjxNM303%2BUmhiG2o6XPs%3D' (2024-04-15)
  → 'github:nix-community/disko/d51114dc1bf3cfaba2b6644aabd16ff0c9909af5?narHash=sha256-5yyHYBWFZUKXkJvOccPBeX83hH2iED54NLnWs2eWgS0%3D' (2024-04-15)
• Updated input 'emacs-overlay':
    'github:nix-community/emacs-overlay/1b01966ee01008bcec18702ea5e543b93236ecef?narHash=sha256-7tpbjpUI7YDpxP0ciM9bWBxzAT3jsZP9l8EGWFQVBmU%3D' (2024-04-15)
  → 'github:nix-community/emacs-overlay/cf218237d0d80f1ec8109677ebc82ded2ca84c43?narHash=sha256-6qPfZsYW3BvyJq%2BBahgygLdFd5bdqrFue8QGat4lSQo%3D' (2024-04-15)
• Updated input 'microvm':
    'github:astro/microvm.nix/ee0068ca87bdabbde3cc39b7af807c0302d0304c?narHash=sha256-CNdpLnGOUZfIhBanAFVF7t1xstaQGL4w6sQPrVeLlus%3D' (2024-04-09)
  → 'github:astro/microvm.nix/a1341f7195e34d9bb88c12314cc3b0c4429f9b0a?narHash=sha256-c/yG/AsPmMBMe4RAxn4KOkOaR4rsW5s3AjtfriOQKD8%3D' (2024-04-15)
• Updated input 'sops':
    'github:Mic92/sops-nix/226062b47fe0e2130ba3ee9f4f1c880dc815cf87?narHash=sha256-ZaefFyvt5369XdjzSw43NhfbPM9MN5b9YXhzx4lFIRc%3D' (2024-04-14)
  → 'github:Mic92/sops-nix/cc535d07cbcdd562bcca418e475c7b1959cefa4b?narHash=sha256-APoDs2GtzVrsE%2BZ9w72qpHzEtEDfuinWcNTN7zhwLxg%3D' (2024-04-15)
2024-04-15 20:25:19 +02:00
12 changed files with 262 additions and 179 deletions

View file

@ -54,11 +54,11 @@
]
},
"locked": {
"lastModified": 1713166406,
"narHash": "sha256-lPAdHkIQBydROJ2e6t0nFP9X220GQ4sEwb5lFQBGYb0=",
"lastModified": 1713173848,
"narHash": "sha256-TTQ2XLqng7TMLnRsLDb/50yyHYuMSPZJ4H+7CEFWQQ0=",
"owner": "atuinsh",
"repo": "atuin",
"rev": "50a73f055288d72eeeb128233e2a04bc88a5d5e8",
"rev": "a0231a70950fbec9dcc3403e37066d891d1fc833",
"type": "github"
},
"original": {
@ -192,11 +192,11 @@
]
},
"locked": {
"lastModified": 1713152224,
"narHash": "sha256-k1aV06cotPwWO3FW+ho+dEoGjxNM303+UmhiG2o6XPs=",
"lastModified": 1713204594,
"narHash": "sha256-5yyHYBWFZUKXkJvOccPBeX83hH2iED54NLnWs2eWgS0=",
"owner": "nix-community",
"repo": "disko",
"rev": "bb5ba68ebb73b5ca7996b64e1457fe885891e78e",
"rev": "d51114dc1bf3cfaba2b6644aabd16ff0c9909af5",
"type": "github"
},
"original": {
@ -216,11 +216,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1713154103,
"narHash": "sha256-7tpbjpUI7YDpxP0ciM9bWBxzAT3jsZP9l8EGWFQVBmU=",
"lastModified": 1713200735,
"narHash": "sha256-6qPfZsYW3BvyJq+BahgygLdFd5bdqrFue8QGat4lSQo=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "1b01966ee01008bcec18702ea5e543b93236ecef",
"rev": "cf218237d0d80f1ec8109677ebc82ded2ca84c43",
"type": "github"
},
"original": {
@ -584,11 +584,11 @@
"spectrum": "spectrum"
},
"locked": {
"lastModified": 1712654305,
"narHash": "sha256-CNdpLnGOUZfIhBanAFVF7t1xstaQGL4w6sQPrVeLlus=",
"lastModified": 1713189110,
"narHash": "sha256-c/yG/AsPmMBMe4RAxn4KOkOaR4rsW5s3AjtfriOQKD8=",
"owner": "astro",
"repo": "microvm.nix",
"rev": "ee0068ca87bdabbde3cc39b7af807c0302d0304c",
"rev": "a1341f7195e34d9bb88c12314cc3b0c4429f9b0a",
"type": "github"
},
"original": {
@ -838,13 +838,13 @@
"lastModified": 1712897695,
"narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"repo": "git-hooks.nix",
"rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"repo": "git-hooks.nix",
"type": "github"
}
},
@ -873,7 +873,8 @@
"pre-commit-hooks": "pre-commit-hooks",
"rust-overlay": "rust-overlay_2",
"sops": "sops",
"sunshine": "sunshine"
"sunshine": "sunshine",
"treefmt-nix": "treefmt-nix"
}
},
"rust-overlay": {
@ -932,11 +933,11 @@
"nixpkgs-stable": "nixpkgs-stable_4"
},
"locked": {
"lastModified": 1713066950,
"narHash": "sha256-ZaefFyvt5369XdjzSw43NhfbPM9MN5b9YXhzx4lFIRc=",
"lastModified": 1713174909,
"narHash": "sha256-APoDs2GtzVrsE+Z9w72qpHzEtEDfuinWcNTN7zhwLxg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "226062b47fe0e2130ba3ee9f4f1c880dc815cf87",
"rev": "cc535d07cbcdd562bcca418e475c7b1959cefa4b",
"type": "github"
},
"original": {
@ -1030,6 +1031,26 @@
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1711963903,
"narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View file

@ -18,13 +18,18 @@
nixos-hardware.url = "github:NixOS/nixos-hardware";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
url = "github:cachix/git-hooks.nix";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
@ -173,7 +178,10 @@
"aarch64-linux"
];
imports = [ inputs.pre-commit-hooks.flakeModule ];
imports = [
inputs.pre-commit-hooks.flakeModule
inputs.treefmt-nix.flakeModule
];
flake = {
lib = import ./lib inputs;
@ -251,9 +259,28 @@
};
};
treefmt = {
projectRootFile = "flake.lock";
programs = {
black.enable = true;
deadnix.enable = true;
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
shellcheck.enable = true;
shfmt = {
enable = true;
indent_size = 0;
};
};
};
packages = {
git-repo-go = pkgs.callPackage ./pkgs/git-repo-go { };
gitu = pkgs.callPackage ./pkgs/gitu { };
headscale-ui = pkgs.callPackage ./pkgs/headscale-ui { };
incus-ui = pkgs.callPackage ./pkgs/incus-ui { };
openfga = pkgs.callPackage ./pkgs/openfga { };
zed = pkgs.callPackage ./pkgs/zed { };
@ -312,8 +339,6 @@
name = "install";
packages = [ inputs'.disko.packages.disko ];
};
formatter = pkgs.nixfmt-rfc-style;
};
};
}

View file

@ -15,6 +15,10 @@ in
settings = {
dialect = "uk";
sync = {
records = true;
};
};
};
};

View file

@ -40,6 +40,7 @@ in
shellAliases = {
ls = "${pkgs.eza}/bin/eza --long --git --git-repos --header --classify --binary";
tree = "${pkgs.eza}/bin/eza --tree --icons";
vimdiff = mkIf config.eboskma.programs.neovim.enable "nvim -d";
vim = mkIf config.eboskma.programs.neovim.enable "nvim";

View file

@ -217,20 +217,16 @@ in
workspaceAutoBackAndForth = true;
workspaceOutputAssign = builtins.concatLists (
builtins.attrValues (
builtins.mapAttrs
(
name: workspaces:
let
output = if name == "right" then "DP-0" else "DP-4";
in
builtins.map
(ws: {
inherit output;
workspace = toString ws;
})
workspaces
)
workspacePartition
builtins.mapAttrs (
name: workspaces:
let
output = if name == "right" then "DP-0" else "DP-4";
in
builtins.map (ws: {
inherit output;
workspace = toString ws;
}) workspaces
) workspacePartition
)
);
# [

View file

@ -17,17 +17,15 @@ in
programs.nnn = {
enable = true;
package =
(pkgs.nnn.overrideAttrs (
_prevAttrs: {
version = "unstable-2023-10-08";
src = pkgs.fetchFromGitHub {
owner = "jarun";
repo = "nnn";
rev = "7f63bef4d6c9f70b99a4c98435c9c0a68e05be44";
sha256 = "B9WRQW4wbs3+lJ9ACFheTaO+0+G/r67yJZJJPMDIQXI=";
};
}
)).override
(pkgs.nnn.overrideAttrs (_prevAttrs: {
version = "unstable-2023-10-08";
src = pkgs.fetchFromGitHub {
owner = "jarun";
repo = "nnn";
rev = "7f63bef4d6c9f70b99a4c98435c9c0a68e05be44";
sha256 = "B9WRQW4wbs3+lJ9ACFheTaO+0+G/r67yJZJJPMDIQXI=";
};
})).override
{
withNerdIcons = true;
extraMakeFlags = [

View file

@ -19,13 +19,11 @@ let
rcloneRemote =
with types;
attrsOf (
oneOf [
str
int
bool
]
);
attrsOf (oneOf [
str
int
bool
]);
rcloneMount =
with types;
@ -61,39 +59,37 @@ in
home.packages = [ pkgs.rclone ];
systemd.user.services = builtins.listToAttrs (
builtins.map
(
mount:
let
localPath = toString mount.local;
unitName = builtins.replaceStrings [ "/" ] [ "-" ] (
builtins.substring 1 (builtins.stringLength localPath) localPath
);
in
{
name = "rclone-${unitName}";
value = {
Unit = {
Description = "rclone mount ${unitName}";
After = [ "network.target" ];
AssertPathIsDirectory = toString mount.local;
};
Service = {
Environment = [ "PATH=/run/wrappers/bin:$PATH" ];
ExecStart = "${pkgs.rclone}/bin/rclone mount --vfs-cache-mode full --vfs-cache-poll-interval 5s --poll-interval 5s --dir-cache-time 10s --umask 022 --allow-other ${rcloneConnectionString mount} ${mount.local}";
ExecStop = "/run/wrappers/bin/fusermount -zu ${mount.local}";
Restart = "on-failure";
RestartSec = 10;
};
Install = {
WantedBy = [ "default.target" ];
};
builtins.map (
mount:
let
localPath = toString mount.local;
unitName = builtins.replaceStrings [ "/" ] [ "-" ] (
builtins.substring 1 (builtins.stringLength localPath) localPath
);
in
{
name = "rclone-${unitName}";
value = {
Unit = {
Description = "rclone mount ${unitName}";
After = [ "network.target" ];
AssertPathIsDirectory = toString mount.local;
};
}
)
cfg.mounts
Service = {
Environment = [ "PATH=/run/wrappers/bin:$PATH" ];
ExecStart = "${pkgs.rclone}/bin/rclone mount --vfs-cache-mode full --vfs-cache-poll-interval 5s --poll-interval 5s --dir-cache-time 10s --umask 022 --allow-other ${rcloneConnectionString mount} ${mount.local}";
ExecStop = "/run/wrappers/bin/fusermount -zu ${mount.local}";
Restart = "on-failure";
RestartSec = 10;
};
Install = {
WantedBy = [ "default.target" ];
};
};
}
) cfg.mounts
);
};
}

View file

@ -13,16 +13,14 @@ let
"${pkgs.nitrogen}/bin/nitrogen --set-color=${cfg.backgroundColor} --set-tiled ${cfg.images}"
else
builtins.concatStringsSep "\n" (
map
(
{ fst, snd }:
let
image = fst;
monitor = toString snd;
in
"${pkgs.nitrogen}/bin/nitrogen --head=${monitor} --set-color=${cfg.backgroundColor} --set-tiled ${image}"
)
(zipLists cfg.images (builtins.genList (x: x) (builtins.length cfg.images)))
map (
{ fst, snd }:
let
image = fst;
monitor = toString snd;
in
"${pkgs.nitrogen}/bin/nitrogen --head=${monitor} --set-color=${cfg.backgroundColor} --set-tiled ${image}"
) (zipLists cfg.images (builtins.genList (x: x) (builtins.length cfg.images)))
)
);

View file

@ -20,14 +20,11 @@ in
};
imports = [
(mkRemovedOptionModule
[
"eboskma"
"nix-common"
"disable-cache"
]
"The option `disable-cache` is no longer used"
)
(mkRemovedOptionModule [
"eboskma"
"nix-common"
"disable-cache"
] "The option `disable-cache` is no longer used")
];
config = mkIf cfg.enable {

View file

@ -87,19 +87,13 @@ in
listenPort = cfg.port;
privateKeyFile = cfg.privateKeyFile;
postSetup =
concatMapStringsSep "\n"
(range: ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s ${range} -o ${cfg.externalInterface} -j MASQUERADE
'')
cfg.internalIPs;
postSetup = concatMapStringsSep "\n" (range: ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s ${range} -o ${cfg.externalInterface} -j MASQUERADE
'') cfg.internalIPs;
postShutdown =
concatMapStringsSep "\n"
(range: ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s ${range} -o ${cfg.externalInterface} -j MASQUERADE
'')
cfg.internalIPs;
postShutdown = concatMapStringsSep "\n" (range: ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s ${range} -o ${cfg.externalInterface} -j MASQUERADE
'') cfg.internalIPs;
peers = cfg.peers;
};

View file

@ -0,0 +1,55 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
writeText,
}:
let
version = "2024.02.24-beta1";
# Got to love those hand crafted, artisinal patches 😁
insertVersionPatch = writeText "0001-headscale-ui-insert-version" ''
--- a/src/routes/settings.html/+page.svelte
+++ b/src/routes/settings.html/+page.svelte
@@ -26,7 +26,7 @@
<ThemeSettings />
<div class="p-4" />
<h1 class="text-2xl bold text-primary mb-4">Version</h1>
- <b>insert-version</b>
+ <b>${version}</b>
<div class ="p-4"></div>
<DevSettings></DevSettings>
</div>
'';
in
buildNpmPackage {
pname = "headscale-ui";
inherit version;
src = fetchFromGitHub {
owner = "gurucomputing";
repo = "headscale-ui";
rev = version;
hash = "sha256-jbyy8W/qAso2yb/hNsmVHiT0mJXInpEIejU+3IB9wJY=";
};
npmDepsHash = "sha256-SHcsTfX2AnHR8fNCE2+JYV33DtZFQOqN7LSoV+fUu5A=";
npmPackFlags = [ "--ignore-scripts" ];
makeCacheWritable = true;
patches = [ insertVersionPatch ];
installPhase = ''
cp -a build $out
'';
meta = with lib; {
description = "A web frontend for the headscale Tailscale-compatible coordination server";
homepage = "https://github.com/gurucomputing/headscale-ui";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
mainProgram = "headscale-ui";
platforms = platforms.all;
};
}

View file

@ -10,81 +10,79 @@
rsync,
}:
stdenv.mkDerivation (
finalAttrs: {
pname = "incus-ui";
version = "0.6";
stdenv.mkDerivation (finalAttrs: {
pname = "incus-ui";
version = "0.6";
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd-ui";
rev = finalAttrs.version;
# hash = "sha256-52MRf7bk8Un9wqz00+JjDmuJgPKYhgAhIbMbcAuf8W8=";
hash = "sha256-3Ts6lKyzpMDVATCKD1fFIGTskWzWpQUT9S8cPFnlEOs=";
};
src = fetchFromGitHub {
owner = "canonical";
repo = "lxd-ui";
rev = finalAttrs.version;
# hash = "sha256-52MRf7bk8Un9wqz00+JjDmuJgPKYhgAhIbMbcAuf8W8=";
hash = "sha256-3Ts6lKyzpMDVATCKD1fFIGTskWzWpQUT9S8cPFnlEOs=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-0pyxwMGGqogEe1w3sail8NUDHtxLQZU9Wg8E6rQNy4o=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${finalAttrs.src}/yarn.lock";
hash = "sha256-0pyxwMGGqogEe1w3sail8NUDHtxLQZU9Wg8E6rQNy4o=";
};
patches = [
./ui-canonical-0001-Branding.patch
./ui-canonical-0002-Update-navigation.patch
./ui-canonical-0003-Update-certificate-generation.patch
./ui-canonical-0004-Remove-external-links.patch
./ui-canonical-0005-Remove-Canonical-image-servers.patch
./ui-canonical-0006-Remove-version-check.patch
];
patches = [
./ui-canonical-0001-Branding.patch
./ui-canonical-0002-Update-navigation.patch
./ui-canonical-0003-Update-certificate-generation.patch
./ui-canonical-0004-Remove-external-links.patch
./ui-canonical-0005-Remove-Canonical-image-servers.patch
./ui-canonical-0006-Remove-version-check.patch
];
nativeBuildInputs = [
nodejs
prefetch-yarn-deps
yarn
];
nativeBuildInputs = [
nodejs
prefetch-yarn-deps
yarn
];
configurePhase = ''
runHook preConfigure
configurePhase = ''
runHook preConfigure
${gnused}/bin/sed -i "s/LXD/Incus/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/devlxd/guestapi/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/dev\/lxd/dev\/incus/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/lxd_/incus_/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/\"lxd\"/\"incus\"/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/LXD/Incus/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/devlxd/guestapi/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/dev\/lxd/dev\/incus/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/lxd_/incus_/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
${gnused}/bin/sed -i "s/\"lxd\"/\"incus\"/g" src/*/*.ts* src/*/*/*.ts* src/*/*/*/*.ts*
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
cp ${./favicon-32x32.png} public/assets/img/favicon-32x32.png
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
patchShebangs node_modules
cp ${./favicon-32x32.png} public/assets/img/favicon-32x32.png
runHook postConfigure
'';
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
buildPhase = ''
runHook preBuild
yarn --offline build
yarn --offline build
runHook postBuild
'';
runHook postBuild
'';
installPhase = ''
runHook preInstall
installPhase = ''
runHook preInstall
mkdir -p $out
${rsync}/bin/rsync -a build/ui/ $out/
mkdir -p $out
${rsync}/bin/rsync -a build/ui/ $out/
runHook postInstall
'';
runHook postInstall
'';
meta = with lib; {
description = "Easy and accessible container and virtual machine management. A browser interface for LXD";
homepage = "https://github.com/canonical/lxd-ui";
license = licenses.gpl3;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
}
)
meta = with lib; {
description = "Easy and accessible container and virtual machine management. A browser interface for LXD";
homepage = "https://github.com/canonical/lxd-ui";
license = licenses.gpl3;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
})