Eww Overlay
Some checks failed
Nix Build / build-nixos (push) Has been cancelled

This commit is contained in:
soraefir 2024-04-13 09:32:22 +02:00
parent e4b93499b9
commit 177c26e41d
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
12 changed files with 171 additions and 28 deletions

View File

@ -0,0 +1,28 @@
name: Nix Build
on:
pull_request:
push:
workflow_run:
workflows: []
types: [completed]
workflow_dispatch:
jobs:
build-nixos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Nix ❄️"
uses: cachix/install-nix-action@v26
- name: "Install Cachix ❄️"
uses: cachix/cachix-action@v14
with:
name: helcel
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: "Build NixOS config ❄️"
run: |
nix build .#nixosConfigurations.ci.config.system.build.toplevel

View File

@ -56,7 +56,11 @@
system = "x86_64-linux";
host = "avalon";
};
ci = gen.generate {
type = "nixos";
system = "x86_64-linux";
host = "ci";
};
};
darwinConfigurations = {
asgard = gen.generate {

View File

@ -94,5 +94,4 @@ in pkgs.stdenv.mkDerivation rec {
runHook postInstall
'';
}

View File

@ -2,6 +2,7 @@
(include "modules/sys.yuck")
(include "modules/net.yuck")
(include "modules/systray.yuck")
(include "modules/clock.yuck")
(include "windows/calendar.yuck")
@ -26,6 +27,7 @@
:valign "end"
(sys-mod)
(net-mod)
(systray-mod)
(clock-mod)))
(defwidget center []

View File

@ -0,0 +1,15 @@
(defwidget systray-mod []
(module
(box
:orientation "v"
(systray
:class "tray"
:space-evenly "true"
:orientation "v"
:icon-size 32
:prepend-new "false"
)
)
)
)

View File

@ -25,13 +25,17 @@
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
substituters =
[ "https://hyprland.cachix.org" "https://cache.nixos.org" ];
substituters = [
"https://hyprland.cachix.org"
"https://cache.nixos.org"
"https://helcel.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helcel.cachix.org-1:95s8D+N2xIHwzmkuu7jMUp9t3rtN4EimafR73jO7GLg="
];
};
};
system.stateVersion = "23.11";
system.stateVersion = "24.05";
}

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
let keyFilePath = "/var/lib/sops-nix/age-key.txt";
in {
let
keyFilePath = "/var/lib/sops-nix/age-key.txt";
isCI = builtins.elem config.hostcfg.hostname [ "ci" ];
sopsSettings = {
sops.defaultSopsFile = ./common.yaml;
sops.age.keyFile = keyFilePath;
sops.age.generateKey = true;
@ -19,8 +21,10 @@ in {
};
sops.secrets."${config.hostcfg.hostname}_wg_priv" = { };
sops.secrets."${config.hostcfg.hostname}_wg_pub" = { };
};
in {
environment.systemPackages = with pkgs; [ sops ];
environment.sessionVariables.OPS_AGE_KEY_FILE = keyFilePath;
inherit (if isCI then { } else sopsSettings) sops;
}

View File

@ -3,5 +3,6 @@
(final: prev: {
openttd-jgrpp = import ./openttd-jgrpp { inherit final prev; };
yarn-berry = import ./yarn-berry { inherit final prev; };
eww = import ./eww { inherit final prev; };
})
]

18
overlays/eww/default.nix Normal file
View File

@ -0,0 +1,18 @@
{ final, prev, ... }:
prev.eww.overrideAttrs (old: rec {
pname = "eww";
version = "ebe5f349d184e79edc33199d064d9ec5f1e4dd9b";
src = prev.fetchFromGitHub {
owner = "elkowar";
repo = "eww";
rev = "${version}";
hash = "sha256-WcAWIvIdGE0tcS7WJ6JlbRlUnKvpvut500NozUmJ6jY=";
};
buildInputs = old.buildInputs ++ [ final.libdbusmenu-gtk3 ];
cargoDeps = old.cargoDeps.overrideAttrs (_: {
name = "${pname}-vendor.tar.gz";
inherit src;
outputHash = "sha256-seq5aS+TCLAV3qnKu6fRYdSXC+w7vI4ae+A7dBdpw14=";
});
})

29
systems/ci/default.nix Normal file
View File

@ -0,0 +1,29 @@
{ config, inputs, ... }: {
imports = [ ./hardware.nix ];
hostcfg = {
hostname = "valinor";
username = "sora";
make = {
gui = true;
cli = true;
virt = true;
power = true;
game = true;
develop = true;
};
net = {
wlp = {
enable = false;
nif = "NA";
};
wg = {
enable = false;
ip4 = "";
ip6 = "";
pk = "";
};
};
};
}

21
systems/ci/hardware.nix Normal file
View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModulePackages = with config.boot.kernelPackages;
[ v4l2loopback.out ];
fileSystems."/" = {
device = "NA";
fsType = "ext4";
};
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

18
systems/ci/home.nix Normal file
View File

@ -0,0 +1,18 @@
{ config, ... }: {
config.homecfg = {
username = "sora";
make = {
gui = true;
cli = true;
game = true;
develop = true;
power = true;
};
git = {
email = "ci@nonet";
username = "CI";
key = "";
};
};
}