Init flake
This commit is contained in:
commit
c77f30372e
6 changed files with 205 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
result
|
5
Justfile
Normal file
5
Justfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
default: build system
|
||||
system:
|
||||
sudo ./result/sw/bin/darwin-rebuild switch --flake .
|
||||
build:
|
||||
nix build .#darwinConfigurations.Ethans-MacBook-Air.system
|
69
flake.lock
generated
Normal file
69
flake.lock
generated
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1750973805,
|
||||
"narHash": "sha256-BZXgag7I0rnL/HMHAsBz3tQrfKAibpY2vovexl2lS+Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "080e8b48b0318b38143d5865de9334f46d51fce3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1750618568,
|
||||
"narHash": "sha256-w9EG5FOXrjXGfbqCcQg9x1lMnTwzNDW5BMXp8ddy15E=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "1dd19f19e4b53a1fd2e8e738a08dd5fe635ec7e5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lnl7",
|
||||
"ref": "master",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1751083014,
|
||||
"narHash": "sha256-JXvmXZfENnpo6U6wR7/0Wd7v411E2ugCFXYRREii4Pw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "499e024bffc54a2e180f7958ba1bb3771af58ce8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
42
flake.nix
Normal file
42
flake.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
description = "Nix configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
|
||||
nix-darwin.url = "github:lnl7/nix-darwin/master";
|
||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs @ { self, ... }: let
|
||||
nixpkgsConfig = {
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
darwinConfigurations = let
|
||||
inherit (inputs.nix-darwin.lib) darwinSystem;
|
||||
in {
|
||||
Ethans-MacBook-Air = darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
|
||||
specialArgs = { inherit inputs; };
|
||||
|
||||
modules = [
|
||||
./hosts/Ethans-MacBook-Air/configuration.nix
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
{
|
||||
nixpkgs = nixpkgsConfig;
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.ethanreece = import ./home/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
60
home/home.nix
Normal file
60
home/home.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home = {
|
||||
stateVersion = "23.11";
|
||||
packages = with pkgs; [
|
||||
htop
|
||||
curl
|
||||
coreutils
|
||||
appcleaner
|
||||
nil
|
||||
grandperspective
|
||||
iterm2
|
||||
];
|
||||
shell = {
|
||||
enableNushellIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
helix = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
nushell = {
|
||||
enable = true;
|
||||
|
||||
};
|
||||
starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
delta = {
|
||||
enable = true;
|
||||
};
|
||||
signing = {
|
||||
format = "openpgp";
|
||||
signByDefault = true;
|
||||
};
|
||||
userEmail = "git@ethanreece.com";
|
||||
userName = "Ethan Reece";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
28
hosts/Ethans-MacBook-Air/configuration.nix
Normal file
28
hosts/Ethans-MacBook-Air/configuration.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }:
|
||||
# _:
|
||||
|
||||
{
|
||||
system = {
|
||||
stateVersion = 6;
|
||||
primaryUser = "ethanreece";
|
||||
};
|
||||
|
||||
users.users.ethanreece = {
|
||||
name = "ethanreece";
|
||||
home = "/Users/ethanreece";
|
||||
shell = pkgs.nushell;
|
||||
};
|
||||
|
||||
nix.extraOptions = ''
|
||||
auto-optimise-store = true
|
||||
experimental-features = nix-command flakes
|
||||
extra-platforms = x86_64-darwin aarch64-darwin
|
||||
'';
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
home-manager.backupFileExtension = "backup";
|
||||
}
|
Loading…
Add table
Reference in a new issue