Skip to content

Expose flake-file.apps as flake apps, not packages#92

Merged
vic merged 1 commit intovic:mainfrom
Adda0:flake-apps
Mar 28, 2026
Merged

Expose flake-file.apps as flake apps, not packages#92
vic merged 1 commit intovic:mainfrom
Adda0:flake-apps

Conversation

@Adda0
Copy link
Copy Markdown
Contributor

@Adda0 Adda0 commented Mar 27, 2026

I was cleaning up my flake outputs and noticed that write-flake, write-lock, write-inputs, and others are exposed as flake outputs packages instead of flake outputs apps.

$ nix flake init --template github:vic/flake-file#dendritic
$ nix flake show
path: <path/to/new/flake>
├───apps
│   └───x86_64-linux
└───packages
    └───x86_64-linux
        ├───write-flake: package
        ├───write-inputs: package
        └───write-lock: package

Since packages are supposed to be build artefacts and/or something installable, and these are, unless I misunderstood the intention, all just quick and small scripts only useful for the current configuration directory and are not expected to be installed and available on PATH for general use in other directories, I think having them as apps would be more appropriate.

Now:

$ nix flake init --template github:vic/flake-file#dendritic
$ nix flake show
path: <path/to/new/flake>
├───apps
│   └───x86_64-linux
│       ├───write-flake: package
│       ├───write-inputs: package
│       └───write-lock: package
└───packages
    └───x86_64-linux

The change is applied only when setting the perSystem flake outputs, so hopefully it should not break anything in flake-ile, as all references use the unmodified flake-file.apps.

Feel free to close the PR if exposing the scripts as packages was intentional or something.

I think the same can be done to https://github.com/vic/den/blob/b7f910ab47260c91a0ae8d55fa72cd2178ba2458/templates/default/modules/nh.nix#L7.

@Adda0 Adda0 changed the title Expose flake-file.apps as flake apps, not packages Expose flake-file.apps as flake apps, not packages Mar 27, 2026
@vic
Copy link
Copy Markdown
Owner

vic commented Mar 28, 2026

Hey @Adda0,

I had no particular reason using packages instead of apps, other than I've never used apps. haha. If I'm understanding correctly, packages is for things that can be consumed downstream (by your flake consumers). Your change makes sense in that regard, feel free to also send a patch for Den

@vic vic merged commit 953d01f into vic:main Mar 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants