From 9e1669337b10d667e3b85eebbe0ddb80e90750cc Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Fri, 7 Feb 2025 12:16:44 -0800 Subject: [PATCH] cringe --- nix-darwin/configuration.nix | 25 +++++++++++++++++++++++ nix-darwin/flake.lock | 39 +++++++++++++++++++++++++++--------- nix-darwin/flake.nix | 36 +++++++++++++++++++-------------- nix-darwin/flake.nix.old | 18 +++++++++++++++++ nix-darwin/nix.conf | 1 + 5 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 nix-darwin/configuration.nix create mode 100644 nix-darwin/flake.nix.old create mode 100644 nix-darwin/nix.conf diff --git a/nix-darwin/configuration.nix b/nix-darwin/configuration.nix new file mode 100644 index 0000000..8532b6f --- /dev/null +++ b/nix-darwin/configuration.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: + +{ + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = + [ pkgs.vim + ]; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + + # Enable alternative shell support in nix-darwin. + # programs.fish.enable = true; + + # Set Git commit hash for darwin-version. + system.configurationRevision = self.rev or self.dirtyRev or null; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/nix-darwin/flake.lock b/nix-darwin/flake.lock index 8cd0734..16175b1 100644 --- a/nix-darwin/flake.lock +++ b/nix-darwin/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738743987, + "narHash": "sha256-O3bnAfsObto6l2tQOmQlrO6Z2kD6yKwOWfs7pA0CpOc=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "ae406c04577ff9a64087018c79b4fdc02468c87c", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -7,11 +27,11 @@ ] }, "locked": { - "lastModified": 1732420764, - "narHash": "sha256-u6JOOVlnGe8fMekW0BgaHuuZwbJp4ixQaMA5BEvRoDA=", + "lastModified": 1738878603, + "narHash": "sha256-fmhq8B3MvQLawLbMO+LWLcdC2ftLMmwSk+P29icJ3tE=", "owner": "nix-community", "repo": "home-manager", - "rev": "67cd4814a247fd0fe97171acb90659f7e304bcb8", + "rev": "433799271274c9f2ab520a49527ebfe2992dcfbd", "type": "github" }, "original": { @@ -22,22 +42,23 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", - "owner": "nixos", + "lastModified": 1738797219, + "narHash": "sha256-KRwX9Z1XavpgeSDVM/THdFd6uH8rNm/6R+7kIbGa+2s=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "1da52dd49a127ad74486b135898da2cef8c62665", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", + "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { + "darwin": "darwin", "home-manager": "home-manager", "nixpkgs": "nixpkgs" } diff --git a/nix-darwin/flake.nix b/nix-darwin/flake.nix index 01111e5..4b5d99d 100644 --- a/nix-darwin/flake.nix +++ b/nix-darwin/flake.nix @@ -1,23 +1,29 @@ { - description = "Home Manager configuration"; + description = "Epsilons darwin configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + darwin.url = "github:LnL7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { nixpkgs, home-manager, ... }: - let - system = "aarch64-darwin"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - homeConfigurations.elal = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - modules = [ ./home.nix ]; + outputs = inputs: { + darwinConfigurations = { + "exa" = inputs.darwin.lib.darwinSystem { + system = "aarch64-darwin"; # or "x86_64-darwin" for Intel Macs + modules = [ + ./configuration.nix + # This module integrates Home Manager: + inputs.home-manager.darwinModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.elal = import ./home.nix; + } + ]; }; }; + }; } + diff --git a/nix-darwin/flake.nix.old b/nix-darwin/flake.nix.old new file mode 100644 index 0000000..be66600 --- /dev/null +++ b/nix-darwin/flake.nix.old @@ -0,0 +1,18 @@ +{ + description = "Home Manager configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager }: { + homeConfigurations."elal" = home-manager.lib.homeConfiguration { + pkgs = nixpkgs.legacyPackages.aarch64-darwin; + modules = [ ./home.nix ]; + }; + }; +} diff --git a/nix-darwin/nix.conf b/nix-darwin/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/nix-darwin/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes