Skip to content

Commit

Permalink
Merge branch 'nixos-unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmway committed Sep 2, 2024
2 parents 0ef9477 + 4cc4be6 commit f998498
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 37 deletions.
1 change: 1 addition & 0 deletions programs/cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
environment.systemPackages = with pkgs; [
nixd # nix lsp
waydroid-script
# rnix-lsp # this too
# nil # this too
oha # http load generator
Expand Down
26 changes: 26 additions & 0 deletions programs/extra/waydroid-script.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ self, super, ... }:
self.stdenv.mkDerivation {
name = "waydroid-script";

buildInputs = [
(self.python3.withPackages(ps: with ps; [ tqdm requests inquirerpy ]))
];

src = self.fetchFromGitHub {
owner = "casualsnek";
repo = "waydroid_script";
rev = "1a2d3ad643206ad5f040e0155bb7ab86c0430365";
hash = "sha256-OiZO62cvsFyCUPGpWjhxVm8fZlulhccKylOCX/nEyJU=";
};

postPatch = ''
patchShebangs main.py
'';

installPhase = ''
mkdir -p $out/libexec
cp -r . $out/libexec/waydroid_script
mkdir -p $out/bin
ln -s $out/libexec/waydroid_script/main.py $out/bin/waydroid-script
'';
}
23 changes: 12 additions & 11 deletions programs/gui/appimage.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{ pkgs, ... }: let
inherit (pkgs)
fetchurl
;
# { pkgs, ... }:
let
# inherit (pkgs)
# fetchurl
# ;
in {
enable = true;
packages = {
zen-browser = rec {
version = "1.0.0-a.28";
src = fetchurl {
url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen-specific.AppImage";
hash = "sha256-S49M3QVpjQ36+f4xeC13XXn11IlzHmTvfIZkTS/YOF4=";
};
};
# zen-browser = rec {
# version = "1.0.0-a.28";
# src = fetchurl {
# url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen-specific.AppImage";
# hash = "sha256-S49M3QVpjQ36+f4xeC13XXn11IlzHmTvfIZkTS/YOF4=";
# };
# };
};
}
2 changes: 1 addition & 1 deletion programs/vm-container.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
guest.enable = true;
};

# waydroid.enable = true;
waydroid.enable = true;
};
}
2 changes: 2 additions & 0 deletions systems/networking.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Enable networking
networkmanager.enable = true;
networkmanager.wifi.powersave = true;

# /etc/hosts
hosts = {
Expand All @@ -18,6 +19,7 @@
"gitea.local"
"cgi.local.com"
"nyoba.com"
"hydra.local"
# "download.mikrotik.com"
];
};
Expand Down
31 changes: 9 additions & 22 deletions systems/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,15 @@
auto-optimise-store = true;
};

registry = let
inherit (builtins)
foldl'
hasAttr
;
toRegistry = arr: foldl' (final: registry: {
"${registry}".flake =
if ! (hasAttr registry inputs) then
throw "registry ${registry} not found"
else inputs.${registry};
} // final) {} arr;
in {
nixos.flake = inputs.self;
} // (toRegistry [
"nixpkgs"
"nixpkgs-24_05"
"nixpkgs-23_11"
"fmpkgs"
"nixpkgs-extra"
"disko"
"microvm"
]);
registry =
builtins.listToAttrs (map (x: {
name =
if x == "self" then
"nixos"
else
x;
value.flake = inputs.${x};
}) (builtins.attrNames inputs));

gc = {
automatic = true;
Expand Down
4 changes: 2 additions & 2 deletions systems/services/caddy/__domains/gitea.local.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, ... }: let
inherit (config.services) certs;
inherit (config.services) certs gitea;
in {
type = "https";
extraConfig = ''
Expand All @@ -8,6 +8,6 @@ in {
format console
output stdout
}
reverse_proxy localhost:3000
reverse_proxy localhost:${toString gitea.settings.server.HTTP_PORT}
'';
}
14 changes: 14 additions & 0 deletions systems/services/caddy/__domains/hydra.local.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ config, ... }: let
inherit (config.services) certs hydra;
in {
type = "https";
enable = hydra.enable;
extraConfig = ''
tls ${certs.hydra.cert} ${certs.hydra.key}
log {
format console
output stdout
}
reverse_proxy localhost:${toString hydra.port}
'';
}
6 changes: 5 additions & 1 deletion systems/services/caddy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ in {
enable = true;
virtualHosts = listToAttrs (map (x: let
v = domains.${x};
enable =
if v ? enable && ! v.enable then
false
else true;
in {
name =
if v ? type && v.type == "https" then
"https://${x}"
else if v ? type && v.type == "http" then
"http://${x}"
else x;
value = excludeItems [ "type" ] v;
value = lib.mkIf enable (excludeItems [ "type" "enable" ] v);
}) (attrNames domains));
}
4 changes: 4 additions & 0 deletions systems/services/certs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
cname = "cgi.local.com";
alt = [ "DNS:cgi.local.com" ];
};
hydra = {
cname = "hydra.local";
alt = [ "DNS:hydra.local" ];
};
}
10 changes: 10 additions & 0 deletions systems/services/hydra.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
enable = false;
port = 9898;
hydraURL = "https://hydra.local"; # externally visible URL
notificationSender = "[email protected]"; # e-mail of Hydra service
# a standalone Hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines
buildMachinesFiles = [];
# you will probably also want, otherwise *everything* will be built from scratch
useSubstitutes = true;
}

0 comments on commit f998498

Please sign in to comment.