Initial commit
This commit is contained in:
commit
cfcc57a8bd
353 changed files with 18756 additions and 0 deletions
27
flake/den/templates/default/.github/workflows/test.yml
vendored
Normal file
27
flake/den/templates/default/.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
on:
|
||||
pull_request:
|
||||
push:
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
flake-check:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
name: Nix flake check ${{matrix.os}}
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: wimpysworld/nothing-but-nix@main
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- uses: actions/checkout@v5
|
||||
- run: nix flake metadata
|
||||
- run: |
|
||||
cat <<-EOF > modules/ci-runtime.nix
|
||||
{
|
||||
_module.args.CI = true;
|
||||
}
|
||||
EOF
|
||||
- run: nix flake check
|
||||
35
flake/den/templates/default/README.md
Normal file
35
flake/den/templates/default/README.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# Getting Started Guide
|
||||
|
||||
Steps you can follow after cloning this template:
|
||||
|
||||
- Be sure to read the [den documentation](https://vic.github.io/den)
|
||||
|
||||
- Update den input.
|
||||
|
||||
```console
|
||||
nix flake update den
|
||||
```
|
||||
|
||||
- Run checks to test everything works.
|
||||
|
||||
```console
|
||||
nix flake check
|
||||
```
|
||||
|
||||
- Read [modules/den.nix](modules/den.nix) where hosts and homes definitions are for this example.
|
||||
|
||||
- Read [modules/namespace.nix](modules/namespace.nix) where a new `eg` (an example) aspects namespace is created.
|
||||
|
||||
- Read [modules/aspects/igloo.nix](modules/aspects/igloo.nix) where the `igloo` host is configured.
|
||||
|
||||
- Read [modules/aspects/alice.nix](modules/aspects/alice.nix) where the `alice` user is configured.
|
||||
|
||||
- Run the VM.
|
||||
|
||||
```console
|
||||
nix run .#vm
|
||||
```
|
||||
|
||||
- Edit and run VM loop.
|
||||
|
||||
Feel free to add more aspects, organize things to your liking.
|
||||
173
flake/den/templates/default/flake.lock
generated
Normal file
173
flake/den/templates/default/flake.lock
generated
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
{
|
||||
"nodes": {
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1762627886,
|
||||
"narHash": "sha256-/QLk1bzmbcqJt9sU43+y/3tHtXhAy0l8Ck0MoO2+evQ=",
|
||||
"owner": "nix-darwin",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "5125a3cd414dc98bbe2c528227aa6b62ee61f733",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-darwin",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"den": {
|
||||
"locked": {
|
||||
"lastModified": 1763285091,
|
||||
"narHash": "sha256-F2OsALSm86dfNA2grd5MVRPpAWZf4ZuuCzpYG7H0P9g=",
|
||||
"owner": "vic",
|
||||
"repo": "den",
|
||||
"rev": "227451c9a99fb084bc6b66878c7f6f3e75f625d2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vic",
|
||||
"repo": "den",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-aspects": {
|
||||
"locked": {
|
||||
"lastModified": 1763284357,
|
||||
"narHash": "sha256-mPMHkhpOIsj2lg+KIcapFd4uj2N/9mZZ6RZBo/p5O1c=",
|
||||
"owner": "vic",
|
||||
"repo": "flake-aspects",
|
||||
"rev": "6a6d47f531ad57ac854cee689e84f2e28861ec49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vic",
|
||||
"repo": "flake-aspects",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-file": {
|
||||
"locked": {
|
||||
"lastModified": 1762732765,
|
||||
"narHash": "sha256-sVxN4q4V8jhIAF44aPSMULIJMJ5eG5HtzcQgbr2UEBg=",
|
||||
"owner": "vic",
|
||||
"repo": "flake-file",
|
||||
"rev": "7b037ae446102d3ccc5e23d3c52d5ada8e0fc4f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vic",
|
||||
"repo": "flake-file",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs-lib"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1762810396,
|
||||
"narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1762787259,
|
||||
"narHash": "sha256-t2U/GLLXHa2+kJkwnFNRVc2fEJ/lUfyZXBE5iKzJdcs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "37a3d97f2873e0f68711117c34d04b7c7ead8f4e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"import-tree": {
|
||||
"locked": {
|
||||
"lastModified": 1762327901,
|
||||
"narHash": "sha256-AJ96FNj50DU0bTyIzAPkPOjCZTHqjURVjok8qoXvmqM=",
|
||||
"owner": "vic",
|
||||
"repo": "import-tree",
|
||||
"rev": "90fa129798be99cde036b78658e89475710966a1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "vic",
|
||||
"repo": "import-tree",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1762482733,
|
||||
"narHash": "sha256-g/da4FzvckvbiZT075Sb1/YDNDr+tGQgh4N8i5ceYMg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e1ebeec86b771e9d387dd02d82ffdc77ac753abc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"darwin": "darwin",
|
||||
"den": "den",
|
||||
"flake-aspects": "flake-aspects",
|
||||
"flake-file": "flake-file",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager",
|
||||
"import-tree": "import-tree",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
55
flake/den/templates/default/flake.nix
Normal file
55
flake/den/templates/default/flake.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file.
|
||||
# Use `nix run .#write-flake` to regenerate it.
|
||||
{
|
||||
|
||||
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
||||
|
||||
inputs = {
|
||||
darwin = {
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
url = "github:nix-darwin/nix-darwin";
|
||||
};
|
||||
den = {
|
||||
url = "github:vic/den";
|
||||
};
|
||||
flake-aspects = {
|
||||
url = "github:vic/flake-aspects";
|
||||
};
|
||||
flake-file = {
|
||||
url = "github:vic/flake-file";
|
||||
};
|
||||
flake-parts = {
|
||||
inputs = {
|
||||
nixpkgs-lib = {
|
||||
follows = "nixpkgs-lib";
|
||||
};
|
||||
};
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
home-manager = {
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
url = "github:nix-community/home-manager";
|
||||
};
|
||||
import-tree = {
|
||||
url = "github:vic/import-tree";
|
||||
};
|
||||
nixpkgs = {
|
||||
url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
nixpkgs-lib = {
|
||||
follows = "nixpkgs";
|
||||
};
|
||||
systems = {
|
||||
url = "github:nix-systems/default";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
70
flake/den/templates/default/modules/aspects/alice.nix
Normal file
70
flake/den/templates/default/modules/aspects/alice.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{ den, eg, ... }:
|
||||
{
|
||||
den.aspects.alice = {
|
||||
|
||||
# Alice can include other aspects.
|
||||
# For small, private one-shot aspects, use let-bindings like here.
|
||||
# for more complex or re-usable ones, define on their own modules,
|
||||
# as part of any aspect-subtree.
|
||||
includes =
|
||||
let
|
||||
# deadnix: skip # not required, showcasing angle-brackets syntax.
|
||||
inherit (den.lib) __findFile;
|
||||
|
||||
customEmacs.homeManager =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.emacs.enable = true;
|
||||
programs.emacs.package = pkgs.emacs30-nox;
|
||||
};
|
||||
in
|
||||
[
|
||||
# from local bindings.
|
||||
customEmacs
|
||||
# from the aspect tree, cooper example is defined bellow
|
||||
den.aspects.cooper
|
||||
den.aspects.setHost
|
||||
# from the `eg` namespace.
|
||||
eg.autologin
|
||||
# den included batteries that provide common configs.
|
||||
<den/primary-user> # alice is admin always.
|
||||
(<den/user-shell> "fish") # default user shell
|
||||
];
|
||||
|
||||
# Alice configures NixOS hosts it lives on.
|
||||
nixos =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
users.users.alice.packages = [ pkgs.vim ];
|
||||
};
|
||||
|
||||
# Alice home-manager.
|
||||
homeManager =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.htop ];
|
||||
};
|
||||
|
||||
# <user>.provides.<host>, via eg/routes.nix
|
||||
provides.igloo =
|
||||
{ host, ... }:
|
||||
{
|
||||
nixos.programs.nh.enable = host.name == "igloo";
|
||||
};
|
||||
};
|
||||
|
||||
# This is a context-aware aspect, that emits configurations
|
||||
# **anytime** at least the `user` data is in context.
|
||||
# read more at https://vic.github.io/den/context-aware.html
|
||||
den.aspects.cooper =
|
||||
{ user, ... }:
|
||||
{
|
||||
nixos.users.users.${user.userName}.description = "Alice Cooper";
|
||||
};
|
||||
|
||||
den.aspects.setHost =
|
||||
{ host, ... }:
|
||||
{
|
||||
networking.hostName = host.hostName;
|
||||
};
|
||||
}
|
||||
48
flake/den/templates/default/modules/aspects/defaults.nix
Normal file
48
flake/den/templates/default/modules/aspects/defaults.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
# deadnix: skip # enable <den/brackets> syntax for demo.
|
||||
__findFile ? __findFile,
|
||||
den,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Lets also configure some defaults using aspects.
|
||||
# These are global static settings.
|
||||
den.default = {
|
||||
darwin.system.stateVersion = 6;
|
||||
nixos.system.stateVersion = "25.05";
|
||||
homeManager.home.stateVersion = "25.05";
|
||||
};
|
||||
|
||||
# These are functions that produce configs
|
||||
den.default.includes = [
|
||||
# ${user}.provides.${host} and ${host}.provides.${user}
|
||||
<eg/routes>
|
||||
|
||||
# Enable home-manager on all hosts.
|
||||
<den/home-manager>
|
||||
|
||||
# Automatically create the user on host.
|
||||
<den/define-user>
|
||||
|
||||
# Disable booting when running on CI on all NixOS hosts.
|
||||
(if config ? _module.args.CI then <eg/ci-no-boot> else { })
|
||||
|
||||
# NOTE: be cautious when adding fully parametric functions to defaults.
|
||||
# defaults are included on EVERY host/user/home, and IF you are not careful
|
||||
# you could be duplicating config values. For example:
|
||||
#
|
||||
# # This will append 42 into foo option for the {host} and for EVERY {host,user}
|
||||
# ({ host, ... }: { nixos.foo = [ 42 ]; }) # DO-NOT-DO-THIS.
|
||||
#
|
||||
# # Instead try to be explicit if a function is intended for ONLY { host }.
|
||||
(den.lib.take.exactly (
|
||||
# deadnix: skip
|
||||
{ OS, host }:
|
||||
{
|
||||
nixos.networking.hostName = host.hostName;
|
||||
}
|
||||
))
|
||||
|
||||
];
|
||||
}
|
||||
15
flake/den/templates/default/modules/aspects/eg/autologin.nix
Normal file
15
flake/den/templates/default/modules/aspects/eg/autologin.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
# autologin is context-aware, parametric aspect.
|
||||
# it applies only if the context has at least { user }
|
||||
# meaning that has access to user data
|
||||
eg.autologin =
|
||||
{ user, ... }:
|
||||
{
|
||||
nixos =
|
||||
{ config, lib, ... }:
|
||||
lib.mkIf config.services.displayManager.enable {
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
services.displayManager.autoLogin.user = user.userName;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
eg.ci-no-boot = {
|
||||
description = "Disables booting during CI";
|
||||
nixos = {
|
||||
boot.loader.grub.enable = false;
|
||||
fileSystems."/".device = "/dev/null";
|
||||
};
|
||||
};
|
||||
}
|
||||
37
flake/den/templates/default/modules/aspects/eg/routes.nix
Normal file
37
flake/den/templates/default/modules/aspects/eg/routes.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# This example implements an aspect "routing" pattern.
|
||||
#
|
||||
# Unlike `den.default` which is `parametric.atLeast`
|
||||
# we use `parametric.fixedTo` here, which help us
|
||||
# propagate an already computed context to all includes.
|
||||
#
|
||||
# This aspect, when installed in a `parametric.atLeast`
|
||||
# will just forward the same context.
|
||||
# The `mutual` helper returns an static configuration which
|
||||
# is ignored by parametric aspects, thus allowing
|
||||
# non-existing aspects to be just ignored.
|
||||
#
|
||||
# Be sure to read: https://vic.github.io/den/dependencies.html
|
||||
# See usage at: defaults.nix, alice.nix, igloo.nix
|
||||
#
|
||||
{ den, eg, ... }:
|
||||
{
|
||||
# Usage: `den.default.includes [ eg.routes ]`
|
||||
eg.routes =
|
||||
let
|
||||
inherit (den.lib) parametric;
|
||||
|
||||
# eg, `<user>._.<host>` and `<host>._.<user>`
|
||||
mutual = from: to: den.aspects.${from.aspect}._.${to.aspect} or { };
|
||||
|
||||
routes =
|
||||
{ host, user, ... }@ctx:
|
||||
{
|
||||
__functor = parametric.fixedTo ctx;
|
||||
includes = [
|
||||
(mutual user host)
|
||||
(mutual host user)
|
||||
];
|
||||
};
|
||||
in
|
||||
routes;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
let
|
||||
installer = variant: {
|
||||
nixos =
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-${variant}.nix") ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# make USB/VM installers.
|
||||
eg.vm-bootable.provides = {
|
||||
tui = installer "minimal";
|
||||
gui = installer "graphical-base";
|
||||
};
|
||||
}
|
||||
15
flake/den/templates/default/modules/aspects/eg/vm.nix
Normal file
15
flake/den/templates/default/modules/aspects/eg/vm.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ eg, ... }:
|
||||
{
|
||||
eg.vm.provides = {
|
||||
gui.includes = [
|
||||
eg.vm
|
||||
eg.vm-bootable._.gui
|
||||
eg.xfce-desktop
|
||||
];
|
||||
|
||||
tui.includes = [
|
||||
eg.vm
|
||||
eg.vm-bootable._.tui
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
eg.xfce-desktop.nixos =
|
||||
{ lib, ... }:
|
||||
{
|
||||
# https://gist.github.com/nat-418/1101881371c9a7b419ba5f944a7118b0
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager = {
|
||||
xterm.enable = false;
|
||||
xfce.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.displayManager = {
|
||||
defaultSession = lib.mkDefault "xfce";
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
20
flake/den/templates/default/modules/aspects/igloo.nix
Normal file
20
flake/den/templates/default/modules/aspects/igloo.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
den.aspects.igloo = {
|
||||
# igloo host provides some home-manager defaults to its users.
|
||||
homeManager.programs.direnv.enable = true;
|
||||
|
||||
# NixOS configuration for igloo.
|
||||
nixos =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.hello ];
|
||||
};
|
||||
|
||||
# <host>.provides.<user>, via eg/routes.nix
|
||||
provides.alice =
|
||||
{ user, ... }:
|
||||
{
|
||||
homeManager.programs.helix.enable = user.name == "alice";
|
||||
};
|
||||
};
|
||||
}
|
||||
5
flake/den/templates/default/modules/den.nix
Normal file
5
flake/den/templates/default/modules/den.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
den.hosts.x86_64-linux.igloo.users.alice = { };
|
||||
den.hosts.aarch64-darwin.apple.users.alice = { };
|
||||
den.homes.x86_64-linux.alice = { };
|
||||
}
|
||||
6
flake/den/templates/default/modules/dendritic.nix
Normal file
6
flake/den/templates/default/modules/dendritic.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.flake-file.flakeModules.dendritic
|
||||
];
|
||||
}
|
||||
37
flake/den/templates/default/modules/inputs.nix
Normal file
37
flake/den/templates/default/modules/inputs.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# This repo was generated with github:vic/flake-file#dendritic template.
|
||||
# Run `nix run .#write-flake` after changing any input.
|
||||
#
|
||||
# Inputs can be placed in any module, the best practice is to have them
|
||||
# as close as possible to their actual usage.
|
||||
# See: https://vic.github.io/dendrix/Dendritic.html#minimal-and-focused-flakenix
|
||||
#
|
||||
# For our template, we enable home-manager and nix-darwin by default, but
|
||||
# you are free to remove them if not being used by you.
|
||||
{ inputs, ... }:
|
||||
{
|
||||
|
||||
flake-file.inputs = {
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
darwin = {
|
||||
url = "github:nix-darwin/nix-darwin";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
## these stable inputs are for wsl
|
||||
#nixpkgs-stable.url = "github:nixos/nixpkgs/release-25.05";
|
||||
#home-manager-stable.url = "github:nix-community/home-manager/release-25.05";
|
||||
#home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||
|
||||
#nixos-wsl = {
|
||||
# url = "github:nix-community/nixos-wsl";
|
||||
# inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||
# inputs.flake-compat.follows = "";
|
||||
#};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
14
flake/den/templates/default/modules/namespace.nix
Normal file
14
flake/den/templates/default/modules/namespace.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ inputs, den, ... }:
|
||||
{
|
||||
# create an `eg` (example!) namespace.
|
||||
imports = [ (inputs.den.namespace "eg" false) ];
|
||||
|
||||
# you can have more than one namespace, create yours.
|
||||
# imports = [ (inputs.den.namespace "yours" true) ];
|
||||
|
||||
# you can also import namespaces from remote flakes.
|
||||
# imports = [ (inputs.den.namespace "ours" inputs.theirs) ];
|
||||
|
||||
# this line enables den angle brackets syntax in modules.
|
||||
_module.args.__findFile = den.lib.__findFile;
|
||||
}
|
||||
34
flake/den/templates/default/modules/tests.nix
Normal file
34
flake/den/templates/default/modules/tests.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Some CI checks to ensure this template always works.
|
||||
# Feel free to adapt or remove when this repo is yours.
|
||||
{ inputs, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{
|
||||
pkgs,
|
||||
self',
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
checkCond = name: cond: pkgs.runCommandLocal name { } (if cond then "touch $out" else "");
|
||||
apple = inputs.self.darwinConfigurations.apple.config;
|
||||
igloo = inputs.self.nixosConfigurations.igloo.config;
|
||||
alice-at-igloo = igloo.home-manager.users.alice;
|
||||
vmBuilds = !pkgs.stdenvNoCC.isLinux || builtins.pathExists (self'.packages.vm + "/bin/vm");
|
||||
iglooBuilds = !pkgs.stdenvNoCC.isLinux || builtins.pathExists (igloo.system.build.toplevel);
|
||||
appleBuilds = !pkgs.stdenvNoCC.isDarwin || builtins.pathExists (apple.system.build.toplevel);
|
||||
in
|
||||
{
|
||||
checks."igloo builds" = checkCond "igloo-builds" iglooBuilds;
|
||||
checks."apple builds" = checkCond "apple-builds" appleBuilds;
|
||||
checks."vm builds" = checkCond "vm-builds" vmBuilds;
|
||||
|
||||
checks."alice enabled igloo nh" = checkCond "alice.provides.igloo" igloo.programs.nh.enable;
|
||||
checks."igloo enabled alice helix" =
|
||||
checkCond "igloo.provides.alice" alice-at-igloo.programs.helix.enable;
|
||||
|
||||
checks."alice-custom-emacs" = checkCond "hm.programs.emacs.package" (
|
||||
"emacs-nox" == lib.getName alice-at-igloo.programs.emacs.package
|
||||
);
|
||||
};
|
||||
}
|
||||
22
flake/den/templates/default/modules/vm.nix
Normal file
22
flake/den/templates/default/modules/vm.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# enables `nix run .#vm`. it is very useful to have a VM
|
||||
# you can edit your config an launch the VM to test stuff
|
||||
# instead of having to reboot each time.
|
||||
{ inputs, eg, ... }:
|
||||
{
|
||||
|
||||
den.aspects.igloo.includes = [
|
||||
eg.vm._.gui
|
||||
# eg.vm._.tui
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
packages.vm = pkgs.writeShellApplication {
|
||||
name = "vm";
|
||||
text = ''
|
||||
${inputs.self.nixosConfigurations.igloo.config.system.build.vm}/bin/run-igloo-vm "$@"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue