syndicate-flake/README.md

82 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

# Syndicate Nix flake
To add to your local flake registry:
```sh
nix registry add syndicate "git+https://git.syndicate-lang.org/ehmry/syndicate-flake"
```
2022-09-15 14:09:43 +00:00
## Synit
``` nix
{
description = "Personal NixOS configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
syndicate = {
url =
"git+https://git.syndicate-lang.org/ehmry/syndicate-flake?ref=synit";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, syndicate }:
let
inherit (nixpkgs) lib;
overlays = [ syndicate.overlays.default ];
in {
legacyPackages =
lib.attrsets.mapAttrs (system: pkgs: pkgs.appendOverlays overlays)
nixpkgs.legacyPackages;
nixosConfigurations = {
yourhost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# A common bootloader
{
boot.loader = {
efi.canTouchEfiVariables = false;
grub = {
enable = true;
efiSupport = true;
devices = [ "nodev" ];
efiInstallAsRemovable = true;
forceInstall = true;
};
systemd-boot.enable = false; # obviously not
};
}
# A normal NixOS system, the default boot profile.
./your-normal-host-config/default.nix
# A Synit system nested inside and an alternative boot profile.
{
specialisation.synit = {
inheritParentConfig = false; # keep it simple for now
configuration = { config, ... }: {
imports = [
syndicate.nixosModules.synit
./your-normal-host-config/hardware-configuration.nix
];
nixpkgs.pkgs = self.legacyPackages.${config.nixpkgs.system};
};
};
}
];
};
};
};
}
```