Skip to content

Commit

Permalink
Now it should work?
Browse files Browse the repository at this point in the history
  • Loading branch information
kugland committed Jan 9, 2025
1 parent e05862d commit 1185598
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 42 deletions.
34 changes: 21 additions & 13 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url = lock.nodes.${nodeName}.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
{ pkgs ? null, fenix ? null }: (args: let
pkgs = if (builtins.tryEval args.pkgs).success && args.pkgs != null
then args.pkgs
else import (import ./flake-compat.nix).inputs.nixpkgs { };
fenix = if (builtins.tryEval args.fenix).success && args.fenix != null
then args.fenix
else import (import ./flake-compat.nix).inputs.fenix { };
in rec {
# The `lib`, `modules`, and `overlays` names are special
lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays

auditok = pkgs.callPackage ./pkgs/auditok { };
bip39 = pkgs.callPackage ./pkgs/bip39 { };
ffsubsync = pkgs.callPackage ./pkgs/ffsubsync { inherit auditok pysubs2; };
my-bookmarks-pl = pkgs.callPackage ./pkgs/my-bookmarks-pl { };
neocities-deploy = pkgs.callPackage ./pkgs/neocities-deploy { inherit fenix; };
pysubs2 = pkgs.callPackage ./pkgs/pysubs2 { };
subtitlecomposer = pkgs.callPackage ./pkgs/subtitlecomposer { };
}) { inherit pkgs fenix; }
13 changes: 13 additions & 0 deletions flake-compat.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url = lock.nodes.${nodeName}.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
19 changes: 10 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 5 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self
Expand All @@ -26,24 +28,10 @@
modules = import ./modules;

legacyPackages = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in rec {
# The `lib`, `modules`, and `overlays` names are special
lib = import ./lib { inherit pkgs; }; # functions
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays

auditok = pkgs.callPackage ./pkgs/auditok { };
bip39 = pkgs.callPackage ./pkgs/bip39 { };
ffsubsync = pkgs.callPackage ./pkgs/ffsubsync { inherit auditok pysubs2; };
my-bookmarks-pl = pkgs.callPackage ./pkgs/my-bookmarks-pl { };
neocities-deploy = pkgs.callPackage ./pkgs/neocities-deploy {
import ./default.nix {
pkgs = import nixpkgs { inherit system; };
fenix = fenix.outputs.packages.${system};
};
pysubs2 = pkgs.callPackage ./pkgs/pysubs2 { };
subtitlecomposer = pkgs.callPackage ./pkgs/subtitlecomposer { };
});
});
packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system});
};
}
6 changes: 6 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
format:
just --unstable --fmt
nix-shell -p alejandra --run "alejandra ."

flake-build pkg:
nix build .#"{{ pkg }}"

normal-build pkg:
nix-build . -A {{ pkg }}
5 changes: 2 additions & 3 deletions pkgs/neocities-deploy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
, fenix
,
}:

let
toolchain = fenix.minimal.toolchain;
buildRustPackage = (pkgs.makeRustPlatform {
Expand All @@ -22,12 +21,12 @@ in
rev = "v${version}";
hash = "sha256-Ax1xmNyt+Gymk28p9lXh+CV17rWjMBKIZtc+nthic+8=";
};
cargoHash = "sha256-R6TTB+TXA44vp+7454fu9/5bscgNao0wuskdgpA2BwY=";
cargoHash = "sha256-wdO46fRqzrWZNSoNAA5FHBckUxLtsxmc72UVtmGhJYU=";
doCheck = false;
meta = with lib; {
description = "A command-line tool for deploying your Neocities site";
homepage = "https://github.com/kugland/neocities-deploy";
license = licenses.gpl3;
maintainers = [ pkgs.maintainers.kugland ];
maintainers = with pkgs.maintainers; [ kugland ];
};
}

0 comments on commit 1185598

Please sign in to comment.