We use flake-comapt to keep compatibility the old Nix.
-{
- nixpkgs ? <nixpkgs>,
- pkgs ? import nixpkgs {},
- otherPerlPackages ? []
-}:
-with pkgs;
-let
- IO-Stty = perlPackages.buildPerlPackage {
- pname = "IO-Stty";
- version = "0.04";
- src = fetchurl {
- url = "mirror://cpan/authors/id/T/TO/TODDR/IO-Stty-0.04.tar.gz";
- sha256 = "1hjicqy50mgbippn310k4zclr9ksz05yyg81za3q4gb9m3qhk5aw";
- };
- };
- perlEnv = (perl.withPackages (p: [ p.Expect IO-Stty ] ++ otherPerlPackages));
-in
-{
- novaboot = stdenv.mkDerivation {
- name = "novaboot";
- src = builtins.fetchGit { url = ./.; };
- buildInputs = [ perlEnv rsync ];
- installPhase = ''
- make install DESTDIR=$out PREFIX=
- '';
- };
- novaboot-server = stdenv.mkDerivation {
- name = "novaboot-server";
- src = builtins.fetchGit { url = ./.; };
- nativeBuildInputs = [ perl ];
- buildInputs = [ rsync ];
- installPhase = ''
- make -C server install DESTDIR=$out PREFIX=
- '';
- };
-}
+(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
+ src = builtins.fetchGit ./.;
+}).defaultNix
--- /dev/null
+{
+ "nodes": {
+ "flake-utils": {
+ "locked": {
+ "lastModified": 1648297722,
+ "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1648632716,
+ "narHash": "sha256-kCmnDeiaMsdhfnNKjxdOzwRh2H6eQb8yWAL+nNabC/Y=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "710fed5a2483f945b14f4a58af2cd3676b42d8c8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
--- /dev/null
+{
+ description = "novaboot";
+
+ inputs = {
+ # The nixpkgs entry in the flake registry.
+ nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ novaboot = (import ./novaboot.nix { inherit self pkgs; });
+ in {
+ # Utilized by `nix build .`
+ defaultPackage = novaboot.novaboot;
+
+ packages.novaboot = novaboot.novaboot;
+ packages.novaboot-server = novaboot.novaboot_server;
+
+ devShell = pkgs.mkShell {
+ inputsFrom = [
+ (import ./novaboot.nix {
+ inherit self pkgs;
+ otherPerlPackages = [ pkgs.perl.pkgs.PodParser ];
+ }).novaboot
+ ];
+ buildInputs = with pkgs; [
+ syslinux
+ cdrkit
+ grub2
+ dhcp
+ ];
+ };
+
+ # Default overlay, for use in dependent flakes
+ overlay = final: prev: { };
+
+ # Default module, for use in dependent flakes
+ #nixosModule = { config, ... }: { options = {}; config = {}; };
+
+ # Same idea as nixosModule but a list or attrset of them.
+ #nixosModules = { exampleModule = self.nixosModule; };
+ });
+}
--- /dev/null
+{
+ self,
+ nixpkgs ? <nixpkgs>,
+ pkgs ? import nixpkgs {},
+ otherPerlPackages ? []
+}:
+with pkgs;
+let
+ IO-Stty = perlPackages.buildPerlPackage {
+ pname = "IO-Stty";
+ version = "0.04";
+ src = fetchurl {
+ url = "mirror://cpan/authors/id/T/TO/TODDR/IO-Stty-0.04.tar.gz";
+ sha256 = "1hjicqy50mgbippn310k4zclr9ksz05yyg81za3q4gb9m3qhk5aw";
+ };
+ };
+ perlEnv = (perl.withPackages (p: [ p.Expect IO-Stty ] ++ otherPerlPackages));
+in
+{
+ novaboot = stdenv.mkDerivation {
+ name = "novaboot";
+ src = self;
+ buildInputs = [ perlEnv rsync ];
+ installPhase = ''
+ make install DESTDIR=$out PREFIX=
+ '';
+ };
+ novaboot-server = stdenv.mkDerivation {
+ name = "novaboot-server";
+ src = self;
+ nativeBuildInputs = [ perl ];
+ buildInputs = [ rsync ];
+ installPhase = ''
+ make -C server install DESTDIR=$out PREFIX=
+ '';
+ };
+}
-{ pkgs ? import <nixpkgs> {} }:
-with pkgs;
-mkShell {
- inputsFrom = [
- (import ./default.nix {
- inherit pkgs;
- otherPerlPackages = [ perl.pkgs.PodParser ];
- }).novaboot
- ];
- buildInputs = with pkgs; [
- syslinux
- cdrkit
- grub2
- dhcp
- ];
-}
+(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
+ src = builtins.fetchGit ./.;
+}).shellNix