diff --git a/nix/.gitignore b/nix/.gitignore new file mode 100644 index 0000000..957bad0 --- /dev/null +++ b/nix/.gitignore @@ -0,0 +1,3 @@ +example/ +result +result/ diff --git a/nix/darwin-configuration.nix b/nix/darwin-configuration.nix.bak similarity index 100% rename from nix/darwin-configuration.nix rename to nix/darwin-configuration.nix.bak diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..ba479bb --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,69 @@ +{ + "nodes": { + "darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1686210161, + "narHash": "sha256-cgP8P2Gk4WtOzd/Y7nEmweLpPOtMKVvHCIcq9zm9qMk=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "40e4b85baac86969f94d6dba893aeae015c562c1", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1686265152, + "narHash": "sha256-ArdPMx2G2rWlnGlqfIV+efTKXcN7F3W0/b5XKYq7n8E=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2bbfc3a78afb4ea60345a5660d8d4173da66c884", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1686087926, + "narHash": "sha256-mXzfJpCCT7Vup2sC3rZPB/AbEW+uBjwT027XWm7R6rA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9ea6dd599d2781168e36486745b5d17e826ab015", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..16e84cb --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,20 @@ +{ + description = "flake of the lyxer..."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + # nix will normally use the nixpkgs defined in home-managers inputs, we only want one copy of nixpkgs though + darwin.url = "github:lnl7/nix-darwin"; + darwin.inputs.nixpkgs.follows = "nixpkgs"; # ... + }; + + # add the inputs declared above to the argument attribute set + outputs = { self, nixpkgs, home-manager, darwin }: { + darwinConfigurations."alymac" = darwin.lib.darwinSystem { + system = "x86_64-darwin"; + modules = [ ./hosts/alymac/default.nix ]; + }; + }; +} diff --git a/nix/hosts/alymac/default.nix b/nix/hosts/alymac/default.nix new file mode 100644 index 0000000..e6fe9cf --- /dev/null +++ b/nix/hosts/alymac/default.nix @@ -0,0 +1,24 @@ +# hosts/YourHostName/default.nix +{ pkgs, ... }: +{ + # Make sure the nix daemon always runs + services.nix-daemon.enable = true; + # Installs a version of nix, that dosen't need "experimental-features = nix-command flakes" in /etc/nix/nix.conf + # services.nix-daemon.package = pkgs.nixFlakes; + + # if you use zsh (the default on new macOS installations), + # you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes + programs.zsh.enable = true; + # bash is enabled by default + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + upgrade = true; + }; + casks = [ + "discord" + ]; + }; +}