Compare commits

..

1 commit

Author SHA1 Message Date
c052754f93 flake.lock: Update
Flake lock file updates:

• Updated input 'lix':
    'e03cd8b3a6.tar.gz?narHash=sha256-WRt4kYvg6cpnatF5zUCIUeurU67M7b4dk3oYdZ0cu9M%3D' (2024-08-08)
  → '3b902683e9.tar.gz?narHash=sha256-FIXisGWmQpPjPcEKy/Xa6YvnUYg9KysfLsFq0biMIug%3D' (2024-08-08)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/b412353cee03010813974408d5ae63f7422b176d' (2024-08-08)
  → 'github:nix-community/nixpkgs-wayland/e28b410ad60004cca039fc6de2dd65f485779833' (2024-08-08)
2024-08-09 00:35:15 +00:00
7 changed files with 53 additions and 96 deletions

View file

@ -341,11 +341,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1723224800, "lastModified": 1723143710,
"narHash": "sha256-2b+cECwR+3FL/ikuZnXE94H8bXdlnYUbhmi1KNpD/tc=", "narHash": "sha256-qbjodK+UgnQ2YdtKmuI1XEG84SZlid39rQo6Ap9NTqI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "8b37e81374928856d8fd859b95a62c8bf4211901", "rev": "4b4971c06fb02df00a2bd20b6b47b5d0e7d799a7",
"revCount": 5073, "revCount": 5071,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland/" "url": "https://github.com/hyprwm/Hyprland/"
@ -534,11 +534,11 @@
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1723213513, "lastModified": 1723158731,
"narHash": "sha256-XbtSx3sxE6rf/D31fBX9d28CuXnokkbHW6tzOEMVfxw=", "narHash": "sha256-FIXisGWmQpPjPcEKy/Xa6YvnUYg9KysfLsFq0biMIug=",
"rev": "346e340cbfe450df3709cf5d51e26ba247a2c1ad", "rev": "3b902683e93ad21be3537ef77f3e5200fbbed900",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/346e340cbfe450df3709cf5d51e26ba247a2c1ad.tar.gz" "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/3b902683e93ad21be3537ef77f3e5200fbbed900.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@ -715,11 +715,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1723206805, "lastModified": 1723151834,
"narHash": "sha256-C75q+dsWnjObUKukRsFj2VKNRtULvZw/XszfGu97PyY=", "narHash": "sha256-KjUcXpdLx5QzkT0x3qctGm1AM9U8g8pSFy24fE2MFeM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "f9b6659b7a856ad5c470ce224a0d69696c6f8c73", "rev": "e28b410ad60004cca039fc6de2dd65f485779833",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -762,11 +762,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1723151389, "lastModified": 1723019560,
"narHash": "sha256-9AVY0ReCmSGXHrlx78+1RrqcDgVSRhHUKDVV1LLBy28=", "narHash": "sha256-O/kxmybNecC3Efr6ITOdtCzFv90/B2Iiedavj5aRWt0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "13fe00cb6c75461901f072ae62b5805baef9f8b2", "rev": "f5129fb42b9c262318130a97b47516946da3e7d7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -816,11 +816,11 @@
"pixi-source": "pixi-source" "pixi-source": "pixi-source"
}, },
"locked": { "locked": {
"lastModified": 1723219928, "lastModified": 1723049033,
"narHash": "sha256-QtO96opBSkBNNOdyWhBVIu447rkUqOZAwrYoOy/Jczw=", "narHash": "sha256-JMVvLQX+oJ5Gfck419poXJCIKOxWsZGRC23ize6hT6Y=",
"owner": "daylinmorgan", "owner": "daylinmorgan",
"repo": "pixi-flake", "repo": "pixi-flake",
"rev": "df14d187eb1cb453f0d6b83c9cdf8441017b9c20", "rev": "7a3e2a90d0f35170c1a95cc194a3ba81acd5b63d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -832,16 +832,16 @@
"pixi-source": { "pixi-source": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1723208538, "lastModified": 1723023748,
"narHash": "sha256-37zVmPKAWCw58xA5lUb+WVAW8rRwPF7DZVXUZ8bwP5E=", "narHash": "sha256-m1qlDxZBEDUMNV+gRX2bbEdvBRp4lJv7C2ZZlEUA5Dg=",
"owner": "prefix-dev", "owner": "prefix-dev",
"repo": "pixi", "repo": "pixi",
"rev": "55741aede8e87f176fd6d99eb26bfd3d026c2b7e", "rev": "608a65d977b9d87bae71c747f77989ad01c76ada",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "prefix-dev", "owner": "prefix-dev",
"ref": "v0.27.1", "ref": "v0.27.0",
"repo": "pixi", "repo": "pixi",
"type": "github" "type": "github"
} }
@ -1156,11 +1156,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723166646, "lastModified": 1723080195,
"narHash": "sha256-brh8KVKQOcwyc9v+nG/QixMuH+yra2+GLvzd3aKhkGo=", "narHash": "sha256-0g2ljOHZZtEZZG9GKusKiNx1+VKm+MEKzCOL2KdkLRg=",
"owner": "Cloudef", "owner": "Cloudef",
"repo": "zig2nix", "repo": "zig2nix",
"rev": "8d9b9e0134659665937b60ece972cc8108960e3c", "rev": "7320da37a4d45afb0aa94d22861a0fe07152c038",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -2,10 +2,10 @@
inputs, inputs,
system, system,
lib, lib,
self,
}: }:
let let
inherit (lib) flakeFromSystem attrValues; inherit (builtins) map;
inherit (lib) flakeFromSystem;
flake = flakeFromSystem system; flake = flakeFromSystem system;
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
@ -16,23 +16,25 @@ let
(flake.overlay "nixpkgs-wayland") (flake.overlay "nixpkgs-wayland")
]; ];
}; };
myPackages = map [
"tsm"
"hyprman"
"zls"
] flake.pkg;
hyprPackages = with (flake.pkgs "hyprland"); [ hyprPackages = with (flake.pkgs "hyprland"); [
default default
xdg-desktop-portal-hyprland xdg-desktop-portal-hyprland
]; ];
selfPackages = (attrValues self.packages.${pkgs.system});
in in
# selfPackages = self.packages.${pkgs.system} |> attrValues;
{ {
makePackages = makePackages =
pkgs.runCommandLocal "build-third-party" pkgs.runCommandLocal "build-third-party"
{ {
src = ./.; src = ./.;
nativeBuildInputs = nativeBuildInputs =
# packages from overlays
(with pkgs; [ (with pkgs; [
pixi
swww swww
nixVersions.stable nixVersions.stable
]) ])
@ -40,8 +42,9 @@ in
(flake.pkgs "roc").full (flake.pkgs "roc").full
(flake.pkgs "zig2nix").zig.master.bin (flake.pkgs "zig2nix").zig.master.bin
] ]
++ hyprPackages ++ myPackages
++ selfPackages; ++ hyprPackages;
} }
'' ''
mkdir "$out" mkdir "$out"

View file

@ -3,40 +3,22 @@ let
lib = nixpkgs.lib.extend (import ./extended.nix inputs); lib = nixpkgs.lib.extend (import ./extended.nix inputs);
inherit (builtins) mapAttrs readDir listToAttrs; inherit (builtins) mapAttrs readDir listToAttrs;
inherit (lib) genAttrs pkgFromSystem pkgsFromSystem; inherit (lib) genAttrs;
inherit (import ./find-modules.nix { inherit lib; }) findModulesList; inherit (import ./find-modules.nix { inherit lib; }) findModulesList;
inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem; inherit (import ./generators.nix { inherit lib self inputs; }) mkIso mkSystem;
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; #supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; })); forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
inheritFlakePkgs =
pkgs: flakes:
listToAttrs (
map (name: {
inherit name;
value = pkgFromSystem pkgs.system name;
}) flakes
);
oizysFlake = { oizysFlake = {
nixosModules = listToAttrs (findModulesList ../modules); nixosModules = listToAttrs (findModulesList ../modules);
nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts); nixosConfigurations = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
packages = forAllSystems ( packages = forAllSystems (pkgs: rec {
pkgs: iso = mkIso.config.system.build.isoImage;
rec { oizys-go = pkgs.callPackage ../pkgs/oizys { };
default = oizys-cli; default = oizys-go;
oizys-cli = pkgs.callPackage ../pkgs/oizys { }; });
iso = mkIso.config.system.build.isoImage;
roc = (pkgsFromSystem pkgs.system "roc").full;
}
// (inheritFlakePkgs pkgs [
"pixi"
"f1multiviewer"
"tsm"
])
);
devShells = forAllSystems (pkgs: { devShells = forAllSystems (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
@ -48,7 +30,7 @@ let
checks = forAllSystems ( checks = forAllSystems (
pkgs: pkgs:
import ./checks.nix { import ./checks.nix {
inherit inputs lib self; inherit inputs lib;
system = pkgs.system; system = pkgs.system;
} }
); );

View file

@ -9,5 +9,9 @@ let
cfg = config.oizys.languages; cfg = config.oizys.languages;
in in
{ {
config = mkIfIn "nushell" cfg { environment.systemPackages = with pkgs; [ nushell ]; }; config = mkIfIn "nushell" cfg {
environment.systemPackages = with pkgs; [
nushell
];
};
} }

View file

@ -16,7 +16,7 @@ in
# nix.package = pkgs.nixVersions.latest; # nix.package = pkgs.nixVersions.latest;
nix = { nix = {
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes pipe-operator experimental-features = nix-command flakes
use-xdg-base-directories = true use-xdg-base-directories = true
''; '';

View file

@ -24,7 +24,5 @@ buildGoModule {
installShellCompletion --cmd oizys \ installShellCompletion --cmd oizys \
--zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh) --zsh <(OIZYS_SKIP_CHECK=true $out/bin/oizys completion zsh)
''; '';
meta = {
description = "nix begat oizys";
};
} }

View file

@ -56,10 +56,7 @@ func New() *Oizys {
o.flake = oizysDir o.flake = oizysDir
} }
o.githubSummary = os.Getenv("GITHUB_STEP_SUMMARY") o.githubSummary = os.Getenv("GITHUB_STEP_SUMMARY")
if o.githubSummary != "" { o.inCI = o.githubSummary != ""
o.inCI = true
log.Debug("running oizys in CI mode")
}
o.githubToken = os.Getenv("GITHUB_TOKEN") o.githubToken = os.Getenv("GITHUB_TOKEN")
o.repo = git.NewRepo(o.flake) o.repo = git.NewRepo(o.flake)
return o return o
@ -247,35 +244,6 @@ func NixosRebuild(subcmd string, rest ...string) {
e.ExitWithCommand(cmd) e.ExitWithCommand(cmd)
} }
func splitDrv(drv string) (string, string) {
s := strings.SplitN(drv, "-", 2)
ss := strings.Split(s[0], "/")
hash := ss[len(ss)-1]
drvName := strings.Replace(s[1], ".drv^*", "", 1)
return drvName, hash
}
func writeDervationsToStepSummary(drvs []string) {
tableRows := make([]string, len(drvs))
for i, drv := range drvs {
name, hash := splitDrv(drv)
tableRows[i] = fmt.Sprintf(
"| %s | %s |",
name, hash,
)
}
o.writeToGithubStepSummary(
fmt.Sprintf(`# Building Derivations:
| derivation | hash |
|---|---|
%s
`,
strings.Join(tableRows, "\n"),
),
)
}
func NixBuild(minimal bool, rest ...string) { func NixBuild(minimal bool, rest ...string) {
cmd := exec.Command("nix", "build") cmd := exec.Command("nix", "build")
if o.resetCache { if o.resetCache {
@ -289,7 +257,9 @@ func NixBuild(minimal bool, rest ...string) {
os.Exit(0) os.Exit(0)
} }
if o.inCI { if o.inCI {
writeDervationsToStepSummary(drvs) o.writeToGithubStepSummary("# Building Derivations:\n")
// TODO: write as a markdown table with hash + name (without .drv)
o.writeToGithubStepSummary(strings.Join(drvs, "\n"))
} }
cmd.Args = append(cmd.Args, append(drvs, "--no-link")...) cmd.Args = append(cmd.Args, append(drvs, "--no-link")...)
} }