Nix flake containing Preserves and Syndicate packages.
Go to file
Emery Hemingway 3cf46ea6e1 synit: add ssh 2022-09-18 11:16:36 -05:00
nixos synit: add ssh 2022-09-18 11:16:36 -05:00
packages synit-daemons: init at unstable-2022-07-25 2022-09-16 23:12:27 -05:00
.gitignore Add lib.generators.toPreserves 2021-09-02 22:12:54 +02:00
README.md Add Synit config to README 2022-09-15 09:12:48 -05:00
flake.lock Pin nixpkgs input to NixOS release-22.05 2022-09-14 12:29:37 -05:00
flake.nix synit-daemons: init at unstable-2022-07-25 2022-09-16 23:12:27 -05:00
lib.nix Improve lib.generators.toPreserves 2022-03-16 22:24:42 -05:00

README.md

Syndicate Nix flake

To add to your local flake registry:

nix registry add syndicate "git+https://git.syndicate-lang.org/ehmry/syndicate-flake"

Synit

{
  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};
                };
              };
            }

          ];
        };

      };
    };
}