summaryrefslogtreecommitdiff
path: root/modules/examples/flake
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2023-06-12 11:01:21 +1000
committerMichael Hoang <enzime@users.noreply.github.com>2023-06-17 22:57:44 +1000
commitf532e43f7efa58a0202956fac19f402893ae0ecd (patch)
tree6b0d143a20892fd484cbf4d11861ffc3134f9f10 /modules/examples/flake
parentfc955520dd26ddbed189f19edc438f7c408e470e (diff)
templates.flake: add contents of simple.nix
Diffstat (limited to 'modules/examples/flake')
-rw-r--r--modules/examples/flake/flake.nix25
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/examples/flake/flake.nix b/modules/examples/flake/flake.nix
index 2c5f90e..0ada852 100644
--- a/modules/examples/flake/flake.nix
+++ b/modules/examples/flake/flake.nix
@@ -10,18 +10,33 @@
outputs = { self, darwin, nixpkgs }:
let
configuration = { pkgs, ... }: {
- nix.package = pkgs.nixVersions.stable;
+ # List packages installed in system profile. To search by name, run:
+ # $ nix-env -qaP | grep wget
+ environment.systemPackages =
+ [ pkgs.vim
+ ];
- # FIXME: for github actions, this shouldn't be in the example.
+ # Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
+ # nix.package = pkgs.nix;
+
+ # Necessary for using flakes on this system.
+ nix.settings.experimental-features = "nix-command flakes";
+
+ # Create /etc/zshrc that loads the nix-darwin environment.
+ programs.zsh.enable = true; # default shell on catalina
+ # programs.fish.enable = true;
+
+ # Used for backwards compatibility, please read the changelog before changing.
+ # $ darwin-rebuild changelog
+ system.stateVersion = 4;
};
in
{
# Build darwin flake using:
- # $ darwin-rebuild build --flake ./modules/examples#simple \
- # --override-input darwin .
+ # $ darwin-rebuild build --flake .#simple
darwinConfigurations."simple" = darwin.lib.darwinSystem {
- modules = [ configuration darwin.darwinModules.simple ];
+ modules = [ configuration ];
system = "x86_64-darwin";
};