From 7b7609011c1a7fb58d5f200f3ba2f0463cfa9628 Mon Sep 17 00:00:00 2001 From: willemml Date: Sun, 4 Dec 2022 23:43:16 -0800 Subject: [PATCH] enable comma and direnv --- #home.nix# | 21 +++++++++++++++++++++ .#home.nix | 1 + brew.nix | 14 ++++++++++++++ darwin-configuration.nix | 17 +++++++++++++---- packages.nix | 12 ++++++++++++ programs.nix | 7 +++++++ 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 #home.nix# create mode 120000 .#home.nix create mode 100644 brew.nix diff --git a/#home.nix# b/#home.nix# new file mode 100644 index 0000000..eddbcc6 --- /dev/null +++ b/#home.nix# @@ -0,0 +1,21 @@ +{ pkgs, config, lib, ... }: + +let + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; +in +rec { + home.stateVersion = "22.05"; + + home.packages = import ./packages.nix { inherit lib config pkgs isDarwin; }; + + programs = import ./programs.nix { inherit lib config pkgs isDarwin; }; + + home.file."${programs.gpg.homedir}/gpg-agent.conf" = { + source = pkgs.writeTextFile { + name = "gpg-agent-conf"; + text = '' + pinentry-program ${pkgs.pinentry_mac.out}/${pkgs.pinentry_mac.binaryPath} + ''; + }; + }; +} diff --git a/.#home.nix b/.#home.nix new file mode 120000 index 0000000..21ed879 --- /dev/null +++ b/.#home.nix @@ -0,0 +1 @@ +willem@zeus.61424 \ No newline at end of file diff --git a/brew.nix b/brew.nix new file mode 100644 index 0000000..8a309cc --- /dev/null +++ b/brew.nix @@ -0,0 +1,14 @@ +{ pkgs, config, lib, ... }: + +{ + casks = [ + "nordvpn" + "blobsaver" + "firefox" + "vlc" + "steam" + "iterm2" + "discord" + "arduino" + ]; +} diff --git a/darwin-configuration.nix b/darwin-configuration.nix index f162f65..5a1e9a0 100644 --- a/darwin-configuration.nix +++ b/darwin-configuration.nix @@ -3,12 +3,17 @@ let user = builtins.getEnv "USER"; unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz; + cask2nixTarball = fetchTarball https://github.com/matthewbauer/cask2nix/archive/v0.1.tar.gz; + nurTarball = fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz"; in { imports = [ ]; # List of packages to be installed in the system profile. - environment.systemPackages = []; + environment.systemPackages = [ + pkgs.iterm2 + pkgs.discord + ]; # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix environment.darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix"; @@ -23,9 +28,13 @@ in ''; }; - nixpkgs.config.packageOverrides = pkgs: { - unstable = import unstableTarball { - config = config.nixpkgs.config; + nixpkgs.config = { + allowUnfree = true; + packageOverrides = pkgs: { + unstable = import unstableTarball { + config = config.nixpkgs.config; + }; + nur = import nurTarball { inherit pkgs; }; }; }; diff --git a/packages.nix b/packages.nix index 41b4c0c..77e38c3 100644 --- a/packages.nix +++ b/packages.nix @@ -1,6 +1,13 @@ { config, lib, pkgs, isDarwin, ... }: let + comma = (import (pkgs.fetchFromGitHub { + owner = "nix-community"; + repo = "comma"; + rev = "v1.4.0"; + sha256 = "02zh0zn0yibbgn26r0idcsv8nl7pxlnq545qas0fzj5l70hdgyhh"; + })).default; + darwinPackages = with pkgs; [ coreutils gnused @@ -8,21 +15,26 @@ let colima pinentry_mac ]; + dockerPackages = with pkgs; [ unstable.docker docker-compose ]; + editingPackages = with pkgs; [ black shellcheck plantuml texlive.combined.scheme-full ]; + nodePackages = with pkgs.nodePackages; [ bash-language-server ]; + sharedPackages = with pkgs; [ zsh-powerlevel10k + comma automake autoconf cmake diff --git a/programs.nix b/programs.nix index 33d9efe..b63316f 100644 --- a/programs.nix +++ b/programs.nix @@ -1,6 +1,13 @@ { lib, config, pkgs, isDarwin, ... }: { + direnv = { + enable = true; + nix-direnv = { + enable = true; + }; + }; + gpg = { enable = true; homedir = "${config.users.users.willem.home}/.gnupg";