Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 1 addition & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,14 @@ On macOS, non-root Nix store support is made possible by [fakedir](https://githu

## How do I add Nixie to my project?

To "install" Nixie onto your project's Git repository, you need to be running the Nix package manager, preferably with flakes enabled.

<details>

<summary>

### You have flakes enabled
</summary>
To "install" Nixie onto your project's Git repository, you need to be running the Nix package manager, with [flakes](https://wiki.nixos.org/wiki/Flakes#Setup) enabled.

You only need to run one command. Make sure your current directory is this of the project you wish to populate.

```sh
nix run github:nixie-dev/nixie
```

</details>

<details>

<summary>

### You don't use flakes
</summary>

In this case, you need to retrieve Nixie manually, either by cloning this repository or adding it as a Nix channel:

#### As a Nix channel

```sh
nix-channel --add https://github.com/nixie-dev/nixie/archive/master.tar.gz nixie
nix-channel --update
nix-env -iA nixie
```

#### By cloning this repository

```sh
git clone https://github.com/nixie-dev/nixie
nix-shell /path/to/cloned/nixie/shell.nix
```

While it is possible to build Nixie directly from this repository, the resulting binary still requires Nix to be available on setup.

Once you have acquired Nixie, simply run `nixie` to automatically configure the repository you're in.

</details>

## What do the generated files mean?

Running the `nix` script at the root of your repository will automatically determine if you have Nix installed or not. If Nix is installed, it will just redirect the call to your system-wide Nix. It's when it is _not installed_ that the magic happens.
Expand Down
42 changes: 8 additions & 34 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,58 +1,32 @@
{ lib, python3Packages, fetchPypi, nix-index, nix, hatch, amber-lang
, libfaketime, ... }:
, ... }:

let
nixie_ver = "2025.02-a2";
nixie_ver = "2026.03-a1";
pzp = python3Packages.buildPythonPackage rec {
pname = "pzp";
version = "0.0.27";
version = "0.0.28";
pyproject = true;
build-system = with python3Packages; [ setuptools ];

src = fetchPypi {
inherit pname version;
sha256 = "sha256-HwsOJA3spcCUFvIBLFkSpMIPZgcU9r1JkAgt0Cj/oUg=";
sha256 = "sha256-xO3x2v5yT5cxz4pa7Ug/f2sQFkJcMIVSWLfj/Lm70E4=";
};

doCheck = false;
};
hatch-build-scripts = python3Packages.buildPythonPackage rec {
pname = "hatch-build-scripts";
version = "0.0.4";
format = "pyproject";

buildInputs =
[ hatch
];

src = fetchPypi {
inherit version;
pname = "hatch_build_scripts";
sha256 = "sha256-x4UgmGkH5HU48suyT95B7fwsxV9FK1Ni+64Vzk5jRPc=";
};
};

# By default, Amber adds a header with the build time, which can't be disabled.
# This wraps the compiler in faketime to make the timestamp reproducible.
# See amber-lang/amber#672
amber-reproducible = amber-lang.overrideAttrs (self: super: {
postInstall = ''
${super.postInstall}
mv $out/bin/amber $out/bin/.amber-orig
makeWrapper ${libfaketime}/bin/faketime $out/bin/amber \
--add-flags "-f '1970-01-01 01:00:00' $out/bin/.amber-orig"
'';
});
in python3Packages.buildPythonApplication {
pname = "nixie";
version = nixie_ver;

src = ./.;
format = "pyproject";

nativeBuildInputs =
nativeBuildInputs = with python3Packages;
[ hatch
hatch-build-scripts
amber-reproducible
libfaketime
amber-lang
];

propagatedBuildInputs = with python3Packages;
Expand Down
41 changes: 20 additions & 21 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ description = "Put Nix in everything!";

inputs.nixpkgs.url = github:nixos/nixpkgs;
inputs.amber.url = github:thesola10/amber/nameof-function;
inputs.amber.url = github:amber-lang/amber;
inputs.nix.url = github:nixos/nix/2.26.2;
inputs.fakedir =
{ url = github:nixie-dev/fakedir;
Expand Down
Loading