mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-26 21:50:44 -06:00
Compare commits
7 commits
77045fc4d2
...
128ddc47a9
Author | SHA1 | Date | |
---|---|---|---|
128ddc47a9 | |||
a2d7340ae8 | |||
35c93707de | |||
c84ef6a384 | |||
d1cd4900b4 | |||
5004ce8353 | |||
a4d27c83c1 |
10 changed files with 132 additions and 83 deletions
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
|
@ -20,7 +20,6 @@ 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
|
||||||
|
@ -34,7 +33,10 @@ jobs:
|
||||||
|
|
||||||
- uses: ./.github/actions/clean-disk
|
- uses: ./.github/actions/clean-disk
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@v12
|
||||||
|
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
|
||||||
|
@ -51,5 +53,6 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
for host in ${{ inputs.host }}; do
|
for host in ${{ inputs.host }}; do
|
||||||
nix run . --accept-flake-config -- cache --host "$host" --flake .
|
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 .
|
||||||
done
|
done
|
||||||
|
|
12
.github/workflows/checks.yml
vendored
12
.github/workflows/checks.yml
vendored
|
@ -8,12 +8,8 @@ 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:
|
||||||
build:
|
checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -23,6 +19,9 @@ 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
|
||||||
|
@ -38,4 +37,5 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cachix watch-exec daylin -- nix build --accept-flake-config '.#checks.x86_64-linux.makePackages'
|
set -euo pipefail
|
||||||
|
cachix watch-exec daylin -- nix build '.#checks.x86_64-linux.makePackages'
|
||||||
|
|
12
.github/workflows/push.yml
vendored
12
.github/workflows/push.yml
vendored
|
@ -8,13 +8,17 @@ 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:
|
||||||
|
|
62
flake.lock
62
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716316901,
|
"lastModified": 1718728970,
|
||||||
"narHash": "sha256-AWzUBSlgPVszYMk611mHgoHCA/hXjzos50KvKJfHCs8=",
|
"narHash": "sha256-R8FjmfsIrTUXMPtmjCNKeTR6cBMCY75WMnH5PfGXHFQ=",
|
||||||
"owner": "daylinmorgan",
|
"owner": "daylinmorgan",
|
||||||
"repo": "f1multiviewer-flake",
|
"repo": "f1multiviewer-flake",
|
||||||
"rev": "89653c7aa046dd23fd61b2ddae6c55725857b224",
|
"rev": "a04a548c5e88933a2aed21544d18812860f14212",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -305,11 +305,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718633685,
|
"lastModified": 1718723174,
|
||||||
"narHash": "sha256-dAuZ6mIIVQraN1PnCe12Qwdcs/Nvfe/zfSy45ED5aso=",
|
"narHash": "sha256-cPIOblG2H8Z934FPeuU0I6kI1Ke8ZbF330Nq/hTJ2uU=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "a9c7a0830fd9a8b9fc4065f1cd654efd1326691a",
|
"rev": "236150b3c5227bbfbe46d2610c739a386afdca1f",
|
||||||
"revCount": 4856,
|
"revCount": 4859,
|
||||||
"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": 1718470009,
|
"lastModified": 1718710563,
|
||||||
"narHash": "sha256-VBeDG3we0bkbFWMyZy+wjUkmeDN58pGFzw1dQCTeDV8=",
|
"narHash": "sha256-O4rrM0Bkh3IRe8D600iniQ52QTmlnuTSp2KyXV7C2jE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "e0a970cbb8c3af05c80ef48a336ad91efd9b2bf6",
|
"rev": "2fb93bea657ad99a7005ef601c67cb2820560a41",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -645,11 +645,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712163089,
|
"lastModified": 1718530797,
|
||||||
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
|
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
|
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -682,11 +682,11 @@
|
||||||
"nixpkgs": "nixpkgs_8"
|
"nixpkgs": "nixpkgs_8"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718630464,
|
"lastModified": 1718727726,
|
||||||
"narHash": "sha256-GXuN6MmzNomxT9VOEFu4iwP1kRTJ7F3/HdOzeDGPE1c=",
|
"narHash": "sha256-WIoMGbYpJMc9TTPeJeoGXRw5KaUkqDVMmtQp412ThOk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "4a3b27cc9526208686896d0ef01c7bb67a47b91f",
|
"rev": "7a80040b517fdfcf8a97749b58afc47bbea4b8c8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -745,11 +745,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1717696253,
|
"lastModified": 1718437845,
|
||||||
"narHash": "sha256-1+ua0ggXlYYPLTmMl3YeYYsBXDSCqT+Gw3u6l4gvMhA=",
|
"narHash": "sha256-ZT7Oc1g4I4pHVGGjQFnewFVDRLH5cIZhEzODLz9YXeY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b5328b7f761a7bbdc0e332ac4cf076a3eedb89b",
|
"rev": "752c634c09ceb50c45e751f8791cb45cb3d46c9e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -761,11 +761,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718428119,
|
"lastModified": 1718606988,
|
||||||
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
|
"narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
|
"rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -793,11 +793,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_8": {
|
"nixpkgs_8": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718318537,
|
"lastModified": 1718530797,
|
||||||
"narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=",
|
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420",
|
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1169,11 +1169,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718624172,
|
"lastModified": 1718673535,
|
||||||
"narHash": "sha256-ZWrhjpNX6WSdjnSV8/JTaSLLqY4VqRp9ql16DldcGYk=",
|
"narHash": "sha256-KCHMePFrijSscQt6A4rtRJxciOaQXgHyGpqi9dzdy8E=",
|
||||||
"owner": "Cloudef",
|
"owner": "Cloudef",
|
||||||
"repo": "zig2nix",
|
"repo": "zig2nix",
|
||||||
"rev": "26b1364329ffb4c910da43c53f6be27b140723de",
|
"rev": "60a6e8d97759da986a488528d86548f611c89edb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1193,11 +1193,11 @@
|
||||||
"zig-overlay": "zig-overlay"
|
"zig-overlay": "zig-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718570415,
|
"lastModified": 1718724404,
|
||||||
"narHash": "sha256-VT5dPbvU/R90kU53OTa8gjynGU98o/QxGHzoP03g0IU=",
|
"narHash": "sha256-BnXu0u0H74cyVOEneESQoCqMCf9zgSrkSx2QVuYztVY=",
|
||||||
"owner": "zigtools",
|
"owner": "zigtools",
|
||||||
"repo": "zls",
|
"repo": "zls",
|
||||||
"rev": "2f7343e37e7647c7d44dfce83c2339861ab810c3",
|
"rev": "cfea2d55798418cccdf27b1b1bde0f70bff1b8f2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -17,9 +17,11 @@ 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
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ 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
|
||||||
|
@ -53,9 +54,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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,18 +6,11 @@
|
||||||
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";
|
||||||
|
|
|
@ -14,6 +14,8 @@ 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")
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ var (
|
||||||
cacheName string
|
cacheName string
|
||||||
verbose bool
|
verbose bool
|
||||||
nom bool
|
nom bool
|
||||||
|
systemPath bool
|
||||||
)
|
)
|
||||||
|
|
||||||
var oizys = o.NewOizys()
|
var oizys = o.NewOizys()
|
||||||
|
@ -40,7 +41,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)
|
oizys.Set(flake, host, cacheName, verbose, systemPath)
|
||||||
oizys.CheckFlake()
|
oizys.CheckFlake()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ type Oizys struct {
|
||||||
host string
|
host string
|
||||||
cache string
|
cache string
|
||||||
verbose bool
|
verbose bool
|
||||||
|
systemPath bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOizys() *Oizys {
|
func NewOizys() *Oizys {
|
||||||
|
@ -42,7 +43,44 @@ func NewOizys() *Oizys {
|
||||||
return &Oizys{flake: flake, host: hostname, cache: "daylin"}
|
return &Oizys{flake: flake, host: hostname, cache: "daylin"}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Oizys) Output() string {
|
type Derivation struct {
|
||||||
|
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,
|
||||||
|
@ -50,9 +88,17 @@ func (o *Oizys) Output() 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 bool,
|
verbose, systemPath bool,
|
||||||
) {
|
) {
|
||||||
if host != "" {
|
if host != "" {
|
||||||
o.host = host
|
o.host = host
|
||||||
|
@ -64,6 +110,7 @@ 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) {
|
||||||
|
@ -153,7 +200,11 @@ func (o *Oizys) git(rest ...string) *exec.Cmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
func showFailedOutput(buf []byte) {
|
func showFailedOutput(buf []byte) {
|
||||||
arrow := lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("9")).Render("->")
|
arrow := lipgloss.
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
|
@ -208,7 +259,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.Output(), "--dry-run",
|
"build", o.nixosConfigAttr(), "--dry-run",
|
||||||
}
|
}
|
||||||
args = append(args, rest...)
|
args = append(args, rest...)
|
||||||
cmd := exec.Command("nix", args...)
|
cmd := exec.Command("nix", args...)
|
||||||
|
@ -302,7 +353,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.Output(), "--print-build-logs",
|
"build", o.nixosConfigAttr(), "--print-build-logs",
|
||||||
"--accept-flake-config",
|
"--accept-flake-config",
|
||||||
}
|
}
|
||||||
args = append(args, rest...)
|
args = append(args, rest...)
|
||||||
|
@ -325,14 +376,6 @@ 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),
|
||||||
|
|
Loading…
Reference in a new issue