From 3a6564ea0315a2d01b2fe95cbe23a4285cbf4451 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 18 Dec 2021 16:39:54 -0500 Subject: [PATCH] it works --- Makefile | 11 ++++++----- README.md | 18 ++++++++++++++++-- flake.lock | 30 ++++++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 633d5f3..3e8b2b8 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,16 @@ +OS := $(shell uname) + all: - @if [ -d "/etc/nixos" ]; then \ - make nixos;\ - else \ - make h;\ - fi + echo "fuck you shell scripting" nixos: sudo nixos-rebuild switch -j auto # systemctl restart --user emanote +macos: + $$(nix build --extra-experimental-features "flakes nix-command" .#darwinConfigurations.air.system --no-link --json | jq -r '.[].outputs.out')/sw/bin/darwin-rebuild switch --flake . + # Not sure why this doesn't reliably work h0: nix build ".#homeConfigurations."`hostname`".activationPackage" diff --git a/README.md b/README.md index c757bcd..8169801 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,26 @@ This repository contains the Nix / NixOS configuration for all of my systems. Start from `flakes.nix` (see [Flakes](https://nixos.wiki/wiki/Flakes)) if you are looking for NixOS configuration. Start from `home.nix` if you are looking for non-NixOS Nix configuration (eg: on macOS). - `home.nix`: Only install things that are needed in all platforms (VMs, VPS, WSL2, etc.) - - TODO: macOS M1 => https://github.com/srid/m1-mac-nix - `flake.nix`: Install things I need natively on NixOS desktop & laptop computers VSCode note: Ctrl+Shift+B will run effectuate the new configuration (by running `make`). -## Non-NixOS + +## Platforms + +### NixOS + +``` +make nixos +``` + +### macOS + +``` +make darwin +``` + +### Other Linux distro (home-manager) TODO: This section needs an update. diff --git a/flake.lock b/flake.lock index 07759fc..b4cb3eb 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,27 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1634994402, + "narHash": "sha256-xmlCVVOYGpZoxgOqsDOVF0B0ASrnbNGVAEzID9qh2xo=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "44da835ac40dab5fd231298b59d83487382d2fab", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "doom-emacs": { "flake": false, "locked": { @@ -740,17 +761,17 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1639525045, - "narHash": "sha256-z4GXFNzO+5V4CAUm2DDMAryLOWUKEbQif2ifvv1Ypg4=", + "lastModified": 1639699734, + "narHash": "sha256-tlX6WebGmiHb2Hmniff+ltYp+7dRfdsBxw9YczLsP60=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a2e281f5770247855b85d70c43454ba5bff34613", + "rev": "03ec468b14067729a285c2c7cfa7b9434a04816c", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "a2e281f5770247855b85d70c43454ba5bff34613", + "rev": "03ec468b14067729a285c2c7cfa7b9434a04816c", "type": "github" } }, @@ -884,6 +905,7 @@ }, "root": { "inputs": { + "darwin": "darwin", "emacs-overlay": "emacs-overlay", "emanote": "emanote", "hercules-ci-agent": "hercules-ci-agent",