Last active
May 31, 2024 10:54
-
-
Save lucperkins/437600b6aaaf0e1e8f91fb22fe421234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "runme application"; | |
inputs = { | |
nixpkgs.url = "nixpkgs"; # Resolves to github:NixOS/nixpkgs | |
# Helpers for system-specific outputs | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, flake-utils }: | |
# Create system-specific outputs for the standard Nix systems | |
# https://github.com/numtide/flake-utils/blob/master/default.nix#L3-L9 | |
flake-utils.lib.eachDefaultSystem (system: | |
let | |
pkgs = import nixpkgs { inherit system; }; | |
in | |
{ | |
# A simple executable package | |
packages.default = pkgs.writeScriptBin "runme" '' | |
echo "I am currently being run!" | |
''; | |
# An app that uses the `runme` package | |
apps.default = { | |
type = "app"; | |
program = "${self.packages.${system}.runme}/bin/runme"; | |
}; | |
}); | |
} |
@lucperkins I was not able to get the above to run as-is but I did make these adjustments and it works
{
description = "runme application";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs"; # Resolves to github:NixOS/nixpkgs
# Helpers for system-specific outputs
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
# Create system-specific outputs for the standard Nix systems
# https://github.com/numtide/flake-utils/blob/master/default.nix#L3-L9
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
# A simple executable package
packages.runme = pkgs.writeScriptBin "runme" ''
#!/usr/bin/env bash
echo "I am currently being run!"
'';
# An app that uses the `runme` package
apps.runme = {
type = "app";
program = "${self.packages.${system}.runme}/bin/runme";
};
});
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
packages.default needs to be packages.runme or otherway around