Compare commits

..

No commits in common. "128ddc47a97cd7aec3678c627551cffc819b533c" and "77045fc4d2671bb27e72dd814bae6bc6d6590603" have entirely different histories.

10 changed files with 83 additions and 132 deletions

View file

@ -20,6 +20,7 @@ on:
default: 'othalan aligz' default: 'othalan aligz'
type: string type: string
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }} group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true cancel-in-progress: true
@ -33,10 +34,7 @@ jobs:
- uses: ./.github/actions/clean-disk - uses: ./.github/actions/clean-disk
- uses: DeterminateSystems/nix-installer-action@v12 - uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7 - uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v15
@ -53,6 +51,5 @@ jobs:
- name: Build - name: Build
run: | run: |
for host in ${{ inputs.host }}; do for host in ${{ inputs.host }}; do
cachix watch-exec daylin -- nix build --print-build-logs "$(nix run . -- output --system-path --host "$host" --flake .)^*" nix run . --accept-flake-config -- cache --host "$host" --flake .
# nix run . --accept-flake-config -- cache --host "$host" --flake .
done done

View file

@ -8,8 +8,12 @@ on:
description: 'flake.lock file' description: 'flake.lock file'
type: string type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true
jobs: jobs:
checks: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -19,9 +23,6 @@ jobs:
purge-packages: false purge-packages: false
- uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
- uses: DeterminateSystems/magic-nix-cache-action@v7 - uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v15
@ -37,5 +38,4 @@ jobs:
- name: Build - name: Build
run: | run: |
set -euo pipefail cachix watch-exec daylin -- nix build --accept-flake-config '.#checks.x86_64-linux.makePackages'
cachix watch-exec daylin -- nix build '.#checks.x86_64-linux.makePackages'

View file

@ -8,17 +8,13 @@ on:
branches: branches:
- main - main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
cancel-in-progress: true
jobs: jobs:
# checks: checks:
# uses: ./.github/workflows/checks.yml uses: ./.github/workflows/checks.yml
# secrets: inherit secrets: inherit
build: build:
# needs: checks needs: checks
strategy: strategy:
max-parallel: 1 max-parallel: 1
matrix: matrix:

View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1718728970, "lastModified": 1716316901,
"narHash": "sha256-R8FjmfsIrTUXMPtmjCNKeTR6cBMCY75WMnH5PfGXHFQ=", "narHash": "sha256-AWzUBSlgPVszYMk611mHgoHCA/hXjzos50KvKJfHCs8=",
"owner": "daylinmorgan", "owner": "daylinmorgan",
"repo": "f1multiviewer-flake", "repo": "f1multiviewer-flake",
"rev": "a04a548c5e88933a2aed21544d18812860f14212", "rev": "89653c7aa046dd23fd61b2ddae6c55725857b224",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -305,11 +305,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1718723174, "lastModified": 1718633685,
"narHash": "sha256-cPIOblG2H8Z934FPeuU0I6kI1Ke8ZbF330Nq/hTJ2uU=", "narHash": "sha256-dAuZ6mIIVQraN1PnCe12Qwdcs/Nvfe/zfSy45ED5aso=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "236150b3c5227bbfbe46d2610c739a386afdca1f", "rev": "a9c7a0830fd9a8b9fc4065f1cd654efd1326691a",
"revCount": 4859, "revCount": 4856,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland/" "url": "https://github.com/hyprwm/Hyprland/"
@ -630,11 +630,11 @@
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1718710563, "lastModified": 1718470009,
"narHash": "sha256-O4rrM0Bkh3IRe8D600iniQ52QTmlnuTSp2KyXV7C2jE=", "narHash": "sha256-VBeDG3we0bkbFWMyZy+wjUkmeDN58pGFzw1dQCTeDV8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "2fb93bea657ad99a7005ef601c67cb2820560a41", "rev": "e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -645,11 +645,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1718530797, "lastModified": 1712163089,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -682,11 +682,11 @@
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1718727726, "lastModified": 1718630464,
"narHash": "sha256-WIoMGbYpJMc9TTPeJeoGXRw5KaUkqDVMmtQp412ThOk=", "narHash": "sha256-GXuN6MmzNomxT9VOEFu4iwP1kRTJ7F3/HdOzeDGPE1c=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "7a80040b517fdfcf8a97749b58afc47bbea4b8c8", "rev": "4a3b27cc9526208686896d0ef01c7bb67a47b91f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -745,11 +745,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1718437845, "lastModified": 1717696253,
"narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=", "narHash": "sha256-1+ua0ggXlYYPLTmMl3YeYYsBXDSCqT+Gw3u6l4gvMhA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e", "rev": "9b5328b7f761a7bbdc0e332ac4cf076a3eedb89b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -761,11 +761,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1718606988, "lastModified": 1718428119,
"narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=", "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f", "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -793,11 +793,11 @@
}, },
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1718530797, "lastModified": 1718318537,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1169,11 +1169,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718673535, "lastModified": 1718624172,
"narHash": "sha256-KCHMePFrijSscQt6A4rtRJxciOaQXgHyGpqi9dzdy8E=", "narHash": "sha256-ZWrhjpNX6WSdjnSV8/JTaSLLqY4VqRp9ql16DldcGYk=",
"owner": "Cloudef", "owner": "Cloudef",
"repo": "zig2nix", "repo": "zig2nix",
"rev": "60a6e8d97759da986a488528d86548f611c89edb", "rev": "26b1364329ffb4c910da43c53f6be27b140723de",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1193,11 +1193,11 @@
"zig-overlay": "zig-overlay" "zig-overlay": "zig-overlay"
}, },
"locked": { "locked": {
"lastModified": 1718724404, "lastModified": 1718570415,
"narHash": "sha256-BnXu0u0H74cyVOEneESQoCqMCf9zgSrkSx2QVuYztVY=", "narHash": "sha256-VT5dPbvU/R90kU53OTa8gjynGU98o/QxGHzoP03g0IU=",
"owner": "zigtools", "owner": "zigtools",
"repo": "zls", "repo": "zls",
"rev": "cfea2d55798418cccdf27b1b1bde0f70bff1b8f2", "rev": "2f7343e37e7647c7d44dfce83c2339861ab810c3",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -17,11 +17,9 @@ in
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.pixi pkgs.pixi
pkgs.swww pkgs.swww
pkgs.xdg-desktop-portal-hyprland
pkgs.nixVersions.stable pkgs.nixVersions.stable
inputs.hyprland.packages.${pkgs.system}.default
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
inputs.tsm.packages.${pkgs.system}.default inputs.tsm.packages.${pkgs.system}.default
inputs.hyprman.packages.${pkgs.system}.default inputs.hyprman.packages.${pkgs.system}.default

View file

@ -33,7 +33,6 @@ let
../modules/oizys.nix ../modules/oizys.nix
../overlays ../overlays
inputs.lix-module.nixosModules.default inputs.lix-module.nixosModules.default
inputs.hyprland.nixosModules.default
] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}")); ] ++ filter isNixFile (listFilesRecursive (../. + "/hosts/${hostName}"));
specialArgs = { specialArgs = {
inherit inherit
@ -54,9 +53,9 @@ in
nixosModules = listToAttrs (findModulesList ../modules); nixosModules = listToAttrs (findModulesList ../modules);
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts); nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
packages = forAllSystems (pkgs: rec { packages = forAllSystems (pkgs: rec {
# oizys-zig = pkgs.callPackage ../pkgs/oizys/oizys-zig { inherit zig2nix; }; oizys-zig = pkgs.callPackage ../pkgs/oizys/oizys-zig { inherit zig2nix; };
# oizys-nim = pkgs.callPackage ../pkgs/oizys/oizys-nim { }; oizys-nim = pkgs.callPackage ../pkgs/oizys/oizys-nim { };
# oizys-rs = pkgs.callPackage ../pkgs/oizys/oizys-rs { }; oizys-rs = pkgs.callPackage ../pkgs/oizys/oizys-rs { };
oizys-go = pkgs.callPackage ../pkgs/oizys/oizys-go { inherit self lib; }; oizys-go = pkgs.callPackage ../pkgs/oizys/oizys-go { inherit self lib; };
default = oizys-go; default = oizys-go;
}); });

View file

@ -6,11 +6,18 @@
enabled, enabled,
... ...
}: }:
# let
# lock = pkgs.writeShellApplication {
# name = "lock";
# runtimeInputs = with pkgs; [swaylock];
# text = ''
# swaylock -c 1e1e2e
# '';
# };
mkOizysModule config "hyprland" { mkOizysModule config "hyprland" {
programs.hyprland = enabled; #// { programs.hyprland = enabled // {
# package = inputs.hyprland.packages.${pkgs.system}.default; package = inputs.hyprland.packages.${pkgs.system}.default;
# }; };
security.pam.services.swaylock = { }; security.pam.services.swaylock = { };
# Optional, hint electron apps to use wayland: # Optional, hint electron apps to use wayland:
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";

View file

@ -14,8 +14,6 @@ var outputCmd = &cobra.Command{
}, },
} }
func init() { func init() {
rootCmd.AddCommand(outputCmd) rootCmd.AddCommand(outputCmd)
outputCmd.Flags().BoolVar(&systemPath, "system-path", false, "show system-path drv")
} }

View file

@ -27,12 +27,11 @@ func Execute() {
} }
var ( var (
flake string flake string
host string host string
cacheName string cacheName string
verbose bool verbose bool
nom bool nom bool
systemPath bool
) )
var oizys = o.NewOizys() var oizys = o.NewOizys()
@ -41,7 +40,7 @@ var rootCmd = &cobra.Command{
Use: "oizys", Use: "oizys",
Short: "nix begat oizys", Short: "nix begat oizys",
PersistentPreRun: func(cmd *cobra.Command, args []string) { PersistentPreRun: func(cmd *cobra.Command, args []string) {
oizys.Set(flake, host, cacheName, verbose, systemPath) oizys.Set(flake, host, cacheName, verbose)
oizys.CheckFlake() oizys.CheckFlake()
}, },
} }

View file

@ -19,11 +19,10 @@ import (
// verbose vs debug? // verbose vs debug?
type Oizys struct { type Oizys struct {
flake string flake string
host string host string
cache string cache string
verbose bool verbose bool
systemPath bool
} }
func NewOizys() *Oizys { func NewOizys() *Oizys {
@ -43,44 +42,7 @@ func NewOizys() *Oizys {
return &Oizys{flake: flake, host: hostname, cache: "daylin"} return &Oizys{flake: flake, host: hostname, cache: "daylin"}
} }
type Derivation struct { func (o *Oizys) Output() string {
InputDrvs map[string]interface{}
}
func parseSystemPath(derivation map[string]Derivation) (string, error) {
for _, nixosDrv := range derivation {
for drv := range nixosDrv.InputDrvs {
if strings.HasSuffix(drv, "system-path.drv") {
return drv, nil
}
}
}
return "", errors.New("failed to find path for system-path.drv")
}
// recreating this command
// nix derivation show `oizys output` | jq -r '.[].inputDrvs | with_entries(select(.key|match("system-path";"i"))) | keys | .[]'
func (o *Oizys) getSystemPath() string {
cmd := exec.Command("nix", "derivation", "show", o.nixosConfigAttr())
log.Println("evaluating to get system-path")
cmd.Stderr = os.Stderr
out, err := cmd.Output()
if err != nil {
log.Fatal(err)
}
var derivation map[string]Derivation
if err := json.Unmarshal(out, &derivation); err != nil {
log.Fatal(err)
}
systemPath, err := parseSystemPath(derivation)
if err != nil {
log.Fatal(err)
}
return systemPath
}
func (o *Oizys) nixosConfigAttr() string {
return fmt.Sprintf( return fmt.Sprintf(
"%s#nixosConfigurations.%s.config.system.build.toplevel", "%s#nixosConfigurations.%s.config.system.build.toplevel",
o.flake, o.flake,
@ -88,17 +50,9 @@ func (o *Oizys) nixosConfigAttr() string {
) )
} }
func (o *Oizys) Output() string {
if o.systemPath {
return o.getSystemPath()
} else {
return o.nixosConfigAttr()
}
}
func (o *Oizys) Set( func (o *Oizys) Set(
flake, host, cache string, flake, host, cache string,
verbose, systemPath bool, verbose bool,
) { ) {
if host != "" { if host != "" {
o.host = host o.host = host
@ -110,7 +64,6 @@ func (o *Oizys) Set(
o.cache = cache o.cache = cache
} }
o.verbose = verbose o.verbose = verbose
o.systemPath = systemPath
} }
func terminalSize() (int, int) { func terminalSize() (int, int) {
@ -200,11 +153,7 @@ func (o *Oizys) git(rest ...string) *exec.Cmd {
} }
func showFailedOutput(buf []byte) { func showFailedOutput(buf []byte) {
arrow := lipgloss. arrow := lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("9")).Render("->")
NewStyle().
Bold(true).
Foreground(lipgloss.Color("9")).
Render("->")
for _, line := range strings.Split(strings.TrimSpace(string(buf)), "\n") { for _, line := range strings.Split(strings.TrimSpace(string(buf)), "\n") {
fmt.Println(arrow, line) fmt.Println(arrow, line)
} }
@ -259,7 +208,7 @@ func showDryRunResult(nixOutput string, verbose bool) {
func (o *Oizys) NixDryRun(verbose bool, rest ...string) { func (o *Oizys) NixDryRun(verbose bool, rest ...string) {
args := []string{ args := []string{
"build", o.nixosConfigAttr(), "--dry-run", "build", o.Output(), "--dry-run",
} }
args = append(args, rest...) args = append(args, rest...)
cmd := exec.Command("nix", args...) cmd := exec.Command("nix", args...)
@ -353,7 +302,7 @@ func (o *Oizys) Checks(nom bool, rest ...string) {
func (o *Oizys) CacheBuild(rest ...string) { func (o *Oizys) CacheBuild(rest ...string) {
args := []string{ args := []string{
"watch-exec", o.cache, "--", "nix", "watch-exec", o.cache, "--", "nix",
"build", o.nixosConfigAttr(), "--print-build-logs", "build", o.Output(), "--print-build-logs",
"--accept-flake-config", "--accept-flake-config",
} }
args = append(args, rest...) args = append(args, rest...)
@ -376,6 +325,14 @@ func (o *Oizys) CI(rest ...string) {
runCommand(cmd) runCommand(cmd)
} }
func Output(flake string, host string) string {
return fmt.Sprintf(
"%s#nixosConfigurations.%s.config.system.build.toplevel",
flake,
host,
)
}
func nixSpinner(host string) *spinner.Spinner { func nixSpinner(host string) *spinner.Spinner {
msg := fmt.Sprintf("%s %s", " evaluating derivation for:", msg := fmt.Sprintf("%s %s", " evaluating derivation for:",
lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("6")).Render(host), lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("6")).Render(host),