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
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,31 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: actions/checkout@v4
- run: sed -i 's@# den.outPath@den.outPath@' templates/noflake/with-inputs.nix
- run: |
cat <<-EOF > templates/noflake/modules/ci-runtime.nix
{
_module.args.CI = true;
}
EOF
git add templates/noflake/modules/ci-runtime.nix
- run: cd templates/noflake && nix-build -A nixosConfigurations.igloo.config.system.build.toplevel
minimal:
needs: [non-draft]
name: minimal
runs-on: ubuntu-latest
steps:
- uses: wimpysworld/nothing-but-nix@main
- uses: cachix/install-nix-action@v31
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: actions/checkout@v4
- run: |
cat <<-EOF > templates/minimal/modules/ci-runtime.nix
{
_module.args.CI = true;
}
EOF
git add templates/minimal/modules/ci-runtime.nix
- run: nix flake check ./templates/minimal --override-input den github:$GITHUB_REPOSITORY/$GITHUB_SHA
template:
needs: [non-draft]
strategy:
Expand Down
9 changes: 9 additions & 0 deletions modules/aspects/provides/ci-noboot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ config, lib, ... }:
{
den.default.includes = lib.optionals (config ? _module.args.CI) [
{
nixos.fileSystems."/".device = lib.mkDefault "/dev/noroot";
nixos.boot.loader.grub.enable = lib.mkDefault false;
}
];
}
11 changes: 11 additions & 0 deletions modules/output.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ inputs, lib, ... }:
if inputs ? flake-parts then
{ }
else
{
# NOTE: Currently Den needs a top-level attribute where to place configurations,
# by default it is the `flake` attribute, even if Den uses no flake-parts at all.
options.flake = lib.mkOption {
type = lib.types.submodule { freeformType = lib.types.anything; };
};
}
2 changes: 1 addition & 1 deletion templates/bogus/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: wimpysworld/nothing-but-nix@main
if: matrix.os == 'ubuntu-latest'
- uses: cachix/install-nix-action@v31
- uses: DeterminateSystems/magic-nix-cache-action@13
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: actions/checkout@v5
- run: nix flake metadata
- run: nix flake check
6 changes: 3 additions & 3 deletions templates/bogus/modules/test-base.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ den, ... }:
{ den, lib, ... }:
{
den.default.nixos.system.stateVersion = "25.11";
den.default.homeManager.home.stateVersion = "25.11";
Expand All @@ -11,7 +11,7 @@
];

den.aspects.no-boot.nixos = {
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/fake";
boot.loader.grub.enable = lib.mkForce false;
fileSystems."/".device = lib.mkForce "/dev/fake";
};
}
20 changes: 0 additions & 20 deletions templates/default/modules/ci.nix

This file was deleted.

21 changes: 0 additions & 21 deletions templates/minimal/flake.lock

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

10 changes: 6 additions & 4 deletions templates/minimal/flake.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
outputs =
inputs:
(inputs.nixpkgs.lib.evalModules {
modules = [ (inputs.import-tree ./modules) ];
specialArgs = { inherit inputs; };
}).config.flake;

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

import-tree.url = "github:vic/import-tree";
flake-aspects.url = "github:vic/flake-aspects";
den.url = "github:vic/den";
Expand Down
16 changes: 14 additions & 2 deletions templates/minimal/modules/den.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{ inputs, den, ... }:
{
systems = builtins.attrNames den.hosts;
# we can import this flakeModule even if we dont have flake-parts as input!
imports = [ inputs.den.flakeModule ];

den.hosts.x86_64-linux.igloo.users.tux = { };
den.aspects.igloo = { };

den.aspects.igloo = {
nixos =
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.hello ];
passthru = { };
};
};

den.aspects.tux = {
includes = [ den.provides.primary-user ];
};
}
11 changes: 0 additions & 11 deletions templates/noflake/modules/compat.nix

This file was deleted.

7 changes: 3 additions & 4 deletions templates/noflake/modules/den.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ inputs, ... }:
{
# we can import this flakeModule even if we dont have flake-parts as input!
imports = [ inputs.den.flakeModule ];

# tux user on igloo host.
den.hosts.x86_64-linux.igloo.users.tux = { };

Expand All @@ -8,11 +11,7 @@
nixos =
{ pkgs, ... }:
{
# remove these for a real bootable host
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/fake";
passthru = { };

environment.systemPackages = [
pkgs.vim
];
Expand Down