mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-26 01:00:44 -06:00
Compare commits
7 commits
830d27389c
...
c3514988d3
Author | SHA1 | Date | |
---|---|---|---|
c3514988d3 | |||
cfd29c576d | |||
9319af8c82 | |||
|
389d07413e | ||
d49e0b044d | |||
435d63b188 | |||
f8754b8105 |
9 changed files with 66 additions and 39 deletions
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
|
@ -58,7 +58,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
hosts:
|
host:
|
||||||
- othalan
|
- othalan
|
||||||
- algiz
|
- algiz
|
||||||
- mannaz
|
- mannaz
|
||||||
|
|
52
flake.lock
52
flake.lock
|
@ -5,11 +5,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720360803,
|
"lastModified": 1721234873,
|
||||||
"narHash": "sha256-dinkhlPUUcPiw8MAujBjE6ee5SYJnYhgup6ovjPahhw=",
|
"narHash": "sha256-7BQ6AkXRfDiyO63fV7Vi9jk0CQE44CzJ5j5olKmCizY=",
|
||||||
"owner": "daylinmorgan",
|
"owner": "daylinmorgan",
|
||||||
"repo": "f1multiviewer-flake",
|
"repo": "f1multiviewer-flake",
|
||||||
"rev": "d5ecfcbffb830f6d1325ea1c1680e61f6363e451",
|
"rev": "b711311e5b431c6794afbfc2d001fed67f00c99d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -305,11 +305,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721157817,
|
"lastModified": 1721248202,
|
||||||
"narHash": "sha256-G93msn9eSKDjkWJlualhXvrOsEL6gQN3hjDEll+H8VE=",
|
"narHash": "sha256-VAhuQQ4EKbw/6z7K2IoR83+gXUdMksLWFQOhJNhSvQE=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "da956c8a979471282db6790f5fa5dcec320ec226",
|
"rev": "300228b503b36e5977b0d58713c5b4cf1f07b8a9",
|
||||||
"revCount": 4928,
|
"revCount": 4930,
|
||||||
"submodules": true,
|
"submodules": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hyprwm/Hyprland/"
|
"url": "https://github.com/hyprwm/Hyprland/"
|
||||||
|
@ -498,11 +498,11 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721094616,
|
"lastModified": 1721314880,
|
||||||
"narHash": "sha256-xeE9I/oGt+Iz7AwnadBlzSJRk8I5y1XKYt2ifV/2eo0=",
|
"narHash": "sha256-39RhKptnozRK63T4l6TcXGKjCXsvcetC4zCMj+0Xthw=",
|
||||||
"rev": "d094dd0396a9ec0b4ce725412cc73c6d9af31021",
|
"rev": "7b1abf81076c93a84becc310722013e44d850002",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/d094dd0396a9ec0b4ce725412cc73c6d9af31021.tar.gz"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/7b1abf81076c93a84becc310722013e44d850002.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
@ -627,11 +627,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721037029,
|
"lastModified": 1721226275,
|
||||||
"narHash": "sha256-wuHiinPG5CzCUBr9I51g+IRhP/69Y9gRVh+QnEtFnyI=",
|
"narHash": "sha256-fwTSeMR1senkBPaKQyOkbkmFu3+8jj3UHoLZ3TcrOfw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "f6db2d325bdf57d39a3ae43376bdf2a020a6aad2",
|
"rev": "8ebede998342477736e0d0acdcc13ddb166a335f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -742,11 +742,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721080040,
|
"lastModified": 1721116560,
|
||||||
"narHash": "sha256-USDsS90/88RJibP3gEcH1AaVt+JpnX4XCUD9bAJP5I4=",
|
"narHash": "sha256-++TYlGMAJM1Q+0nMVaWBSEvEUjRs7ZGiNQOpqbQApCU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b2c1f10bfbb3f617ea8e8669ac13f3f56ceb2ea2",
|
"rev": "9355fa86e6f27422963132c2c9aeedb0fb963d93",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -851,11 +851,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721081452,
|
"lastModified": 1721301142,
|
||||||
"narHash": "sha256-vtpHbfU7BMrHj6Dn/azl7vFwhpIj7+OW9MacF9ac3BI=",
|
"narHash": "sha256-RR/JyDDDapqGu0XgIR2WhwlIuAaTgC3XQkRTM6vmiNI=",
|
||||||
"owner": "roc-lang",
|
"owner": "roc-lang",
|
||||||
"repo": "roc",
|
"repo": "roc",
|
||||||
"rev": "5cf4a4af1f01c7cab4cd21ad0974967bb2a3b9ca",
|
"rev": "70fa3ecdc2c76a8bde74bed2048beb8d02bdbd92",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1129,11 +1129,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718539737,
|
"lastModified": 1721131797,
|
||||||
"narHash": "sha256-hvQ900gSqzGnJWMRQwv65TixciIbC44iX0Nh5ENRwCU=",
|
"narHash": "sha256-v5Nmp+PU4S8jJAJh8tQ+mysag1x6w/CcWjgQNZ/stww=",
|
||||||
"owner": "mitchellh",
|
"owner": "mitchellh",
|
||||||
"repo": "zig-overlay",
|
"repo": "zig-overlay",
|
||||||
"rev": "6eb42ce6f85d247b1aecf854c45d80902821d0ad",
|
"rev": "697b4e864fc728f18b79b71c8c086fda8a6fb7ea",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1150,11 +1150,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721179336,
|
"lastModified": 1721306038,
|
||||||
"narHash": "sha256-PPeGUDP5ZL8pnBRKRCBpBG9mYpun11QyGwmWD2orSIA=",
|
"narHash": "sha256-eK+XZUOjz1864Lo7qf8xfLNIL7aeaFUbug9B0k07o08=",
|
||||||
"owner": "Cloudef",
|
"owner": "Cloudef",
|
||||||
"repo": "zig2nix",
|
"repo": "zig2nix",
|
||||||
"rev": "cf6d6a8d6db80370f61469fb682479bdadfad83f",
|
"rev": "7eefb0631345741feb4b31b94898ab20d67f7594",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -63,6 +63,9 @@ let
|
||||||
(substring 6 2 longDate)
|
(substring 6 2 longDate)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
flakeVer =
|
||||||
|
flake: "${flake.shortRev or flake.dirtyShortRev}-${mkDate (toString flake.lastModifiedDate)}";
|
||||||
|
|
||||||
isNixFile = p: hasSuffix ".nix" p;
|
isNixFile = p: hasSuffix ".nix" p;
|
||||||
isDefaultNixFile = p: hasSuffix "default.nix" p;
|
isDefaultNixFile = p: hasSuffix "default.nix" p;
|
||||||
filterNotDefaultNixFile = paths: filter (p: !(isDefaultNixFile p) && (isNixFile p)) paths;
|
filterNotDefaultNixFile = paths: filter (p: !(isDefaultNixFile p) && (isNixFile p)) paths;
|
||||||
|
@ -81,5 +84,6 @@ in
|
||||||
mkIfIn
|
mkIfIn
|
||||||
isNixFile
|
isNixFile
|
||||||
listNixFilesRecursive
|
listNixFilesRecursive
|
||||||
|
flakeVer
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,24 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkIfIn;
|
inherit (lib) mkIfIn flakeVer;
|
||||||
|
|
||||||
|
version = flakeVer inputs.roc;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
rocPkgs = inputs.roc.packages.${pkgs.system};
|
rocPkgs = inputs.roc.packages.${pkgs.system};
|
||||||
|
# I'm setting the versions so the changes are more apparent as flake is updated
|
||||||
|
roc = rocPkgs.cli.overrideAttrs {
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
};
|
||||||
|
lang-server = rocPkgs.lang-server.overrideAttrs { inherit version; };
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = mkIfIn "roc" cfg {
|
config = mkIfIn "roc" cfg {
|
||||||
environment.systemPackages = with rocPkgs; [
|
environment.systemPackages = [
|
||||||
full # cli + lang_server
|
roc
|
||||||
|
lang-server
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
inputs,
|
inputs,
|
||||||
self,
|
self,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
enabled,
|
enabled,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) makeBinPath;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.nix-index-database.nixosModules.nix-index ];
|
imports = [ inputs.nix-index-database.nixosModules.nix-index ];
|
||||||
|
|
||||||
|
@ -42,7 +46,13 @@
|
||||||
|
|
||||||
system.activationScripts.diff = ''
|
system.activationScripts.diff = ''
|
||||||
if [[ -e /run/current-system ]]; then
|
if [[ -e /run/current-system ]]; then
|
||||||
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
|
PATH=$PATH:${
|
||||||
|
makeBinPath [
|
||||||
|
pkgs.nvd
|
||||||
|
pkgs.nix
|
||||||
|
]
|
||||||
|
}
|
||||||
|
nvd diff /run/current-system "$systemConfig"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ var updateCmd = &cobra.Command{
|
||||||
Short: "update and run nixos rebuild",
|
Short: "update and run nixos rebuild",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
run := github.GetLastUpdateRun()
|
run := github.GetLastUpdateRun()
|
||||||
md, err := github.GetUpateSummary(run.GetID())
|
md, err := github.GetUpateSummary(run.GetID(), oizys.GetHost())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,4 @@ buildGoModule {
|
||||||
--zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh)
|
--zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,10 +60,11 @@ func GetArtifacts(runID int64) (*github.ArtifactList, *github.Response) {
|
||||||
return artifactList, resp
|
return artifactList, resp
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUpdateSummaryArtifact(runID int64) *github.Artifact {
|
func GetUpdateSummaryArtifact(runID int64, host string) *github.Artifact {
|
||||||
|
artifactName := fmt.Sprintf("%s-summary", host)
|
||||||
artifactList, _ := GetArtifacts(runID)
|
artifactList, _ := GetArtifacts(runID)
|
||||||
for _, artifact := range artifactList.Artifacts {
|
for _, artifact := range artifactList.Artifacts {
|
||||||
if artifact.GetName() == "summary" {
|
if artifact.GetName() == artifactName {
|
||||||
return artifact
|
return artifact
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,8 +72,8 @@ func GetUpdateSummaryArtifact(runID int64) *github.Artifact {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUpdateSummaryUrl(runID int64) *url.URL {
|
func GetUpdateSummaryUrl(runID int64, host string) *url.URL {
|
||||||
artifact := GetUpdateSummaryArtifact(runID)
|
artifact := GetUpdateSummaryArtifact(runID, host)
|
||||||
url, resp, err := client.Actions.DownloadArtifact(context.Background(), "daylinmorgan", "oizys", artifact.GetID(), 4)
|
url, resp, err := client.Actions.DownloadArtifact(context.Background(), "daylinmorgan", "oizys", artifact.GetID(), 4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("failed to get update summary URL", "artifact", artifact.GetID(), "resp", resp)
|
log.Fatal("failed to get update summary URL", "artifact", artifact.GetID(), "resp", resp)
|
||||||
|
@ -109,8 +110,8 @@ func GetLastUpdateRun() *github.WorkflowRun {
|
||||||
return run
|
return run
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUpateSummary(runID int64) (string, error) {
|
func GetUpateSummary(runID int64, host string) (string, error) {
|
||||||
url := GetUpdateSummaryUrl(runID)
|
url := GetUpdateSummaryUrl(runID, host)
|
||||||
bytes := GetUpdateSummaryFromUrl(url)
|
bytes := GetUpdateSummaryFromUrl(url)
|
||||||
md, err := ReadMarkdownFromZip(bytes, "summary.md")
|
md, err := ReadMarkdownFromZip(bytes, "summary.md")
|
||||||
return md, err
|
return md, err
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"oizys/internal/git"
|
"oizys/internal/git"
|
||||||
|
|
||||||
// "oizys/internal/github"
|
// "oizys/internal/github"
|
||||||
"oizys/internal/ui"
|
"oizys/internal/ui"
|
||||||
"os"
|
"os"
|
||||||
|
@ -99,6 +100,7 @@ func SetHost(name string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetHost() string { return o.host }
|
||||||
func SetVerbose(v bool) {
|
func SetVerbose(v bool) {
|
||||||
o.verbose = v
|
o.verbose = v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue