mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 03:37:18 +00:00
use nix-darwin and add more packages
This commit is contained in:
parent
0452ac1eb2
commit
bd35608bba
10 changed files with 120 additions and 40 deletions
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./emacs.nix
|
|
||||||
./git.nix
|
|
||||||
./gpg.nix
|
|
||||||
./zsh.nix
|
|
||||||
];
|
|
||||||
}
|
|
48
darwin-configuration.nix
Normal file
48
darwin-configuration.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{ config, pkgs, lib, currentSystem, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
user = builtins.getEnv "USER";
|
||||||
|
unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ <home-manager/nix-darwin> ];
|
||||||
|
|
||||||
|
# List of packages to be installed in the system profile.
|
||||||
|
environment.systemPackages = [];
|
||||||
|
|
||||||
|
# $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
|
||||||
|
environment.darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix";
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
services.nix-daemon.enable = true;
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nixUnstable;
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
unstable = import unstableTarball {
|
||||||
|
config = config.nixpkgs.config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
|
# $ darwin-rebuild changelog
|
||||||
|
system.stateVersion = 4;
|
||||||
|
|
||||||
|
users.users.${user} = {
|
||||||
|
home = "/Users/${user}";
|
||||||
|
name = "${user}";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.emacs.enable = true;
|
||||||
|
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.users.${user} = import ./home.nix { inherit lib config pkgs currentSystem; };
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
signing = {
|
signing = {
|
||||||
gpgPath = "/opt/homebrew/bin/gpg";
|
# gpgPath = "${pkgs.gpg.outPath}";
|
||||||
key = "C3DE5DF6198DACBD";
|
key = "C3DE5DF6198DACBD";
|
||||||
signByDefault = true;
|
signByDefault = true;
|
||||||
};
|
};
|
41
home.nix
41
home.nix
|
@ -1,34 +1,15 @@
|
||||||
{ config, pkgs, ... }:
|
{ pkgs, config, lib, currentSystem, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
./configs/main.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
|
||||||
# configuration is compatible with. This helps avoid breakage
|
|
||||||
# when a new Home Manager release introduces backwards
|
|
||||||
# incompatible changes.
|
|
||||||
#
|
|
||||||
# You can update Home Manager without changing this value. See
|
|
||||||
# the Home Manager release notes for a list of state version
|
|
||||||
# changes in each release.
|
|
||||||
home.stateVersion = "22.05";
|
home.stateVersion = "22.05";
|
||||||
|
home.packages = import ./packages.nix { inherit lib config pkgs isDarwin; };
|
||||||
home.username = "willem";
|
imports = [
|
||||||
home.homeDirectory = "/Users/willem";
|
./emacs.nix
|
||||||
|
./git.nix
|
||||||
# Let Home Manager install and manage itself.
|
./gpg.nix
|
||||||
programs.home-manager.enable = true;
|
./zsh.nix
|
||||||
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nix;
|
|
||||||
settings.experimental-features = [ "nix-command" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
htop
|
|
||||||
wget
|
|
||||||
texlive.combined.scheme-full
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
53
packages.nix
Normal file
53
packages.nix
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{ config, lib, pkgs, isDarwin, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
darwinPackages = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
gnused
|
||||||
|
spoof-mac
|
||||||
|
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
|
||||||
|
automake
|
||||||
|
autoconf
|
||||||
|
cmake
|
||||||
|
bash
|
||||||
|
rustup
|
||||||
|
curl
|
||||||
|
pv
|
||||||
|
wget
|
||||||
|
htop
|
||||||
|
tree
|
||||||
|
bat
|
||||||
|
fd
|
||||||
|
ripgrep
|
||||||
|
jq
|
||||||
|
nmap
|
||||||
|
unzip
|
||||||
|
yt-dlp
|
||||||
|
rsync
|
||||||
|
openssh
|
||||||
|
tldr
|
||||||
|
#(import ./python-packages.nix { inherit pkgs; })
|
||||||
|
];
|
||||||
|
in
|
||||||
|
sharedPackages
|
||||||
|
++ (lib.optionals isDarwin darwinPackages)
|
||||||
|
++ editingPackages
|
||||||
|
++ nodePackages
|
||||||
|
++ dockerPackages
|
6
python-packages.nix
Normal file
6
python-packages.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
pkgs.python310.withPackages(p: with p; [
|
||||||
|
matplotlib
|
||||||
|
latexify-py
|
||||||
|
])
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
Loading…
Add table
Reference in a new issue