Commit bab0fcf1705e

Vincent Demeester <vincent@sbr.pm>
2020-07-01 18:56:13
Revert "nix-darwin: experimenting with it…"
This reverts commit f6852d81ea2b1f70226c411deb267876af506499.
1 parent 51dace4
nix/default.nix
@@ -12,5 +12,4 @@ rec {
   gitignore = import sources.gitignore;
   nixos-hardware = import sources.nixos-hardware;
   nur = import sources.NUR;
-  nix-darwin = import sources.nix-darwin;
 }
nix/sources.json
@@ -59,18 +59,6 @@
         "url": "https://github.com/nmattia/niv/archive/f73bf8d584148677b01859677a63191c31911eae.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
-    "nix-darwin": {
-        "branch": "master",
-        "description": "nix modules for darwin",
-        "homepage": "",
-        "owner": "LnL7",
-        "repo": "nix-darwin",
-        "rev": "47fe6db9c9cd22c4ba57df3281f98f454880bea7",
-        "sha256": "198lxy1q7z6cmlyxd0rigrabjab4i49w2dk3xqm3bs4y0s0qimwy",
-        "type": "tarball",
-        "url": "https://github.com/LnL7/nix-darwin/archive/47fe6db9c9cd22c4ba57df3281f98f454880bea7.tar.gz",
-        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
-    },
     "nixos": {
         "branch": "nixos-20.03",
         "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
systems/honshu.nix
@@ -1,10 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-  environment.systemPackages = with pkgs; [
-    htop
-    vim
-  ];
-
-  programs.zsh.enable = true;
-}
default.nix
@@ -2,7 +2,6 @@
 , lib ? sources.lib
 , pkgs ? sources.pkgs { }
 , pkgs-unstable ? sources.pkgs-unstable { }
-, pkgs-darwin ? sources.nix-darwin
 , nixpkgs ? sources.nixpkgs { }
 }:
 with builtins; with lib;
@@ -11,21 +10,20 @@ let
   mkNixOS: make a nixos system build with the given name and cfg.
 
   cfg is an attributeSet:
-  - arch is architecture (darwin is a special one)
-  - channel is the "channel" to use (nixos stable, nixos unstable, …)
-  - vm is whether it is a vm, or not
+  - arch is architecture
+  - type is weither we want to use nixos (stable) or nixos-unstable
 
   Example:
     hokkaido = { arch = "x86_64-linux"; };
-    naruhodo = { arch = "x86_64-linux"; channel = "unstable"; };
+    honshu = { arch = "x86_64-linux"; type = "unstable"; };
   */
   mkNixOS = name: cfg:
     let
       configuration = ./systems + "/${name}.nix";
       system = cfg.arch;
-      # If channel == unstable, use nixos-unstable (pkgs-unstable) otherwise use nixos (pkgs)
+      # If type == unstable, use nixos-unstable (pkgs-unstable) otherwise use nixos (pkgs)
       p =
-        if cfg ? channel && cfg.channel == "unstable"
+        if cfg ? type && cfg.type == "unstable"
         then pkgs-unstable
         else pkgs;
       # If vm == true, build a VM, otherwise build the system
@@ -33,15 +31,9 @@ let
       main =
         if cfg ? vm && cfg.vm
         then nixos.vm
-        else
-          if system == "x86_64-darwin"
-          then (import (pkgs.darwin.path) { inherit nixpkgs configuration; }).system
-          else nixos.config.system.build;
+        else nixos.config.system.build;
     in
     main;
-  /*
-  mkSystem: make a system build with the given name and cfg.
-  */
   mkSystem = name: cfg:
     if cfg ? vm && cfg.vm
     then (mkNixOS name cfg)
hosts.nix
@@ -1,11 +1,10 @@
 {
-  hokkaido = { arch = "x86_64-linux"; channel = "unstable"; };
-  wakasu = { arch = "x86_64-linux"; channel = "unstable"; };
+  hokkaido = { arch = "x86_64-linux"; type = "unstable"; };
+  wakasu = { arch = "x86_64-linux"; type = "unstable"; };
   kerkouane = { arch = "x86_64-linux"; };
   okinawa = { arch = "x86_64-linux"; };
   sakhalin = { arch = "x86_64-linux"; };
-  honshu = { arch = "x86_64-darwin"; channel = "unstable"; };
   # Test VM
-  foo = { arch = "x86_64-linux"; channel = "unstable"; vm = true; };
+  foo = { arch = "x86_64-linux"; type = "unstable"; vm = true; };
   # mypi = { arch = "aarch64-linux" };
 }