Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
uarun committed May 15, 2023
0 parents commit 6e0c1d5
Show file tree
Hide file tree
Showing 8 changed files with 327 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
result
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Nix Configuration

Nix flake based configuration for Darwin/HomeManager

This flake is used to manage the following:

- MacOS system defaults
- Fonts
- System & User packages
- MacOS specific packages (not supported by nixpkgs)
- MacOS specific GUI apps (using casks)
- Various application specific configurations:
- zsh
- git
- bat

## Setup


## References

105 changes: 105 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "Arun's Nix Configuration Flake";

inputs = {
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

#... Declarative configuration of user speficic packages and dotfiles
home-manager.url = "github:nix-community/home-manager/master"; # release-22.11
home-manager.inputs.nixpkgs.follows = "nixpkgs";

#... MacOS system level settings
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = inputs@{ nixpkgs, home-manager, darwin, ... }: {

darwinConfigurations = let
system = "aarch64-darwin"; #... "x86_64-darwin" for intel based Macs
in {
Adelaide = darwin.lib.darwinSystem {
pkgs = import nixpkgs { inherit system; };
modules = [
./modules/darwin/default.nix
home-manager.darwinModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.arun.imports = [ ./modules/home-manager/default.nix ];
};
}
];
};
};
};
}
53 changes: 53 additions & 0 deletions hosts/Adelaide/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{ pkgs, ... }:
{
services.nix-daemon.enable = true; #... Make sure the nix daemon always runs

programs.zsh.enable = true;

environment = {
shells = with pkgs; [ bashInteractive zsh ]
loginShell = pkgs.zsh;
systemPackages = with pkgs; [ cachix ]
systemPath = [ "/opt/homebrew/bin" ]
pathsToLink = [ "/Applications" ]
}

system.stateVersion = 4; #... This is here for backwards compatibility, don't change

system.defaults = {
finder.AppleShowAllExtensions = true;
finder._FXShowPosixPathInTitle = true;

dock.autohide = true;

NSGlobalDomain.AppleShowAllExtensions = true;
NSGlobalDomain.InitialKeyRepeat = 14;
NSGlobalDomain.KeyRepeat = 1;
}

homebrew = {
enable = true; #... nix-darwin to manage installing/updating/uprading Homebrew taps
onActivation = {
autoUpdate = false;
upgrade = false;
cleanup = "zap"; #... "uninstall" or "zap"
};
global.brewfile = true;

#... List of Homebrew formula repositories to tap
taps = [
];

#... List of Homebrew Formulae to install
brews = [
];

#... List of Homebrew Casks to install
casks = [
];

#... List of application to install from the offical Mac App Store (using mas)
masApps = {
};
}
}
56 changes: 56 additions & 0 deletions modules/darwin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ pkgs, ... }:
{
services.nix-daemon.enable = true; #... Make sure the nix daemon always runs & manage the service
nix.extraOptions = ''
experimental-features = nix-command flakes
'';

programs.zsh.enable = true;

environment = {
shells = with pkgs; [ bashInteractive zsh ];
loginShell = pkgs.zsh;
systemPackages = with pkgs; [ cachix ];
systemPath = [ "/opt/homebrew/bin" ];
pathsToLink = [ "/Applications" ];
};

system.stateVersion = 4; #... This is here for backwards compatibility, don't change

system.defaults = {
finder.AppleShowAllExtensions = true;
finder._FXShowPosixPathInTitle = true;

dock.autohide = true;

NSGlobalDomain.AppleShowAllExtensions = true;
NSGlobalDomain.InitialKeyRepeat = 15;
NSGlobalDomain.KeyRepeat = 2;
};

homebrew = {
enable = true; #... nix-darwin to manage installing/updating/uprading Homebrew taps
onActivation = {
autoUpdate = false;
upgrade = false;
cleanup = "zap"; #... "uninstall" or "zap"
};
global.brewfile = true;

#... List of Homebrew formula repositories to tap
taps = [
];

#... List of Homebrew Formulae to install
brews = [
];

#... List of Homebrew Casks to install
casks = [
];

#... List of application to install from the offical Mac App Store (using mas)
masApps = {
};
};
}
42 changes: 42 additions & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ pkgs, ... }:
{
home.stateVersion = "22.11"; #... This is here for backwards compatibility, don't change

home.packages = with pkgs; [
];

home.sessionVariables = {
PAGER = "less";
EDITOR = "vim";
};

home.file.".inputrc".source = ./dotfiles/inputrc;

programs.bat.enable = true;
programs.bat.config.theme = "Solarized (light)";

programs.zsh = {
enable = true;
enableCompletion = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;

history = {
save = 10000; #... Save 10K lines of history
expireDuplicatesFirst = true;
ignoreSpace = true;
};

defaultKeymap = "viins";
};

programs.git = {
enable = true;
userName = "Arun Udayashankar";
userEmail = "[email protected]";

extraConfig = {
github.user = "uarun";
};
};
}
11 changes: 11 additions & 0 deletions modules/home-manager/dotfiles/inputrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set show-all-if-ambigious on
set completion-ignore-case on
set mark-directories on
set mark-symlinked-directories on
set colored-stats on
set visible-stats on


set keymap vi
set editing-mode vi-insert

0 comments on commit 6e0c1d5

Please sign in to comment.