Added nix darwin to repo

This commit is contained in:
Random936 2024-05-20 17:31:43 -07:00
parent ccde53af11
commit c68a81c262
9 changed files with 239 additions and 138 deletions

21
flake.lock generated
View File

@ -21,6 +21,26 @@
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1715901937,
"narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1715668745,
@ -40,6 +60,7 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs"
}
}

View File

@ -7,23 +7,45 @@
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... } @ inputs:
let
outputs = { self, nixpkgs, nix-darwin, home-manager, ... } @ inputs: {
nixosConfigurations.randomctf = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
in {
nixosConfigurations.randomctf = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [ ./nixos/configuration.nix ];
};
homeConfigurations.random = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
./home-manager/home.nix
];
};
specialArgs = { inherit inputs; };
modules = [ ./nixos/configuration.nix ];
};
homeConfigurations.random = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
modules = [
./home-manager/nixos-home.nix
];
};
darwinConfigurations."Jadens-MacBook-Air" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = { inherit inputs; };
modules = [
./nixos/darwin-configuration.nix
home-manager.darwinModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.jadenmaxwell = import ./home-manager/darwin-home.nix;
}
];
};
homeConfigurations.jadenmaxwell = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-darwin";
modules = [
./home-manager/darwin-home.nix
];
};
};
}

55
home-manager/common.nix Normal file
View File

@ -0,0 +1,55 @@
{ inputs, config, pkgs, ... }: {
nixpkgs.config.allowUnfree = true;
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
feh
clang
cargo
neofetch
#microsoft-edge
#nextcloud-client
#bitwarden-cli
#bitwarden
#discord
# Emacs
cmake
isync
ispell
mu
# fonts
fira-code
fira-code-symbols
meslo-lgs-nf
];
programs = {
home-manager.enable = true;
zoxide.enable = true;
eza.enable = true;
fzf.enable = true;
git = {
enable = true;
userName = "Random936";
userEmail = "randomdude936@gmail.com";
};
};
home.file = {
".mbsyncrc".source = ../dotfiles/.mbsyncrc;
".functions.zsh".source = ../dotfiles/.functions.zsh;
# Emacs files
".emacs".source = ../dotfiles/.emacs;
".emacs.d/config.org".source = ../dotfiles/.emacs.d/config.org;
".emacs.d/terminal.org".source = ../dotfiles/.emacs.d/terminal.org;
".emacs.d/functions.org".source = ../dotfiles/.emacs.d/functions.org;
".emacs.d/email.org".source = ../dotfiles/.emacs.d/email.org;
".emacs.d/org.org".source = ../dotfiles/.emacs.d/org.org;
".emacs.d/lsp.org".source = ../dotfiles/.emacs.d/lsp.org;
};
}

View File

@ -0,0 +1,16 @@
{ inputs, config, pkgs, ... }: {
home = {
username = "jadenmaxwell";
homeDirectory = "/Users/jadenmaxwell";
};
imports = [
./common.nix
./zsh.nix
];
programs.emacs.package = pkgs.emacs-macport;
home.stateVersion = "23.11";
}

11
home-manager/emacs.nix Normal file
View File

@ -0,0 +1,11 @@
{ inputs, config, pkgs, ... }: {
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
mu4e
vterm
all-the-icons
nerd-icons
];
};
}

View File

@ -1,123 +0,0 @@
{ inputs, config, pkgs, ... }: {
home = {
username = "random";
homeDirectory = "/home/random";
};
gtk = {
enable = true;
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
};
nixpkgs.config.allowUnfree = true;
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
feh
clang
cargo
neofetch
microsoft-edge
nextcloud-client
bitwarden-cli
bitwarden
discord
# Emacs
cmake
isync
ispell
mu
# fonts
fira-code
fira-code-symbols
meslo-lgs-nf
];
programs = {
home-manager.enable = true;
command-not-found.enable = true;
zoxide.enable = true;
eza.enable = true;
fzf.enable = true;
emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
mu4e
vterm
all-the-icons
nerd-icons
];
};
git = {
enable = true;
userName = "Random936";
userEmail = "randomdude936@gmail.com";
};
zsh = {
enable = true;
enableCompletion = true;
enableAutosuggestions = true;
syntaxHighlighting.enable = true;
history.size = 100000000;
shellAliases = {
update-system = "sudo nixos-rebuild switch --flake ~/dotfiles";
update-user = "home-manager switch --flake ~/dotfiles";
update-all = "update-system && update-user";
};
plugins = [
{
name = "custom-functions";
src = ../dotfiles;
file = ".functions.zsh";
}
{
name = "powerlevel10k-config";
src = ../dotfiles;
file = ".p10k.zsh";
}
];
zplug = {
enable = true;
plugins = [
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
];
};
};
};
home.file = {
".mbsyncrc".source = ../dotfiles/.mbsyncrc;
".Xresources".source = ../dotfiles/.Xresources;
".functions.zsh".source = ../dotfiles/.functions.zsh;
".scripts/brightness.sh".source = ../dotfiles/.scripts/brightness.sh;
".scripts/autostart_desktop.sh".source = ../dotfiles/.scripts/autostart_desktop.sh;
".screenlayout/launch.sh".source = ../dotfiles/.screenlayout/launch.sh;
".screenlayout/wallpapers.sh".source = ../dotfiles/.screenlayout/wallpapers.sh;
".config/i3/config".source = ../dotfiles/.config/i3/config;
".config/rofi/config.rasi".source = ../dotfiles/.config/rofi/config.rasi;
".config/polybar/config.ini".source = ../dotfiles/.config/polybar/config.ini;
# Emacs files
".emacs".source = ../dotfiles/.emacs;
".emacs.d/config.org".source = ../dotfiles/.emacs.d/config.org;
".emacs.d/terminal.org".source = ../dotfiles/.emacs.d/terminal.org;
".emacs.d/functions.org".source = ../dotfiles/.emacs.d/functions.org;
".emacs.d/email.org".source = ../dotfiles/.emacs.d/email.org;
".emacs.d/org.org".source = ../dotfiles/.emacs.d/org.org;
".emacs.d/lsp.org".source = ../dotfiles/.emacs.d/lsp.org;
};
home.stateVersion = "23.05";
}

View File

@ -0,0 +1,40 @@
{ inputs, config, pkgs, ... }: {
home = {
username = "random";
homeDirectory = "/home/random";
};
imports = [
./common.nix
./emacs.nix
./zsh.nix
];
gtk = {
enable = true;
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
};
programs = {
command-not-found.enable = true;
};
home.file = {
".Xresources".source = ../dotfiles/.Xresources;
".scripts/brightness.sh".source = ../dotfiles/.scripts/brightness.sh;
".scripts/autostart_desktop.sh".source = ../dotfiles/.scripts/autostart_desktop.sh;
".screenlayout/launch.sh".source = ../dotfiles/.screenlayout/launch.sh;
".screenlayout/wallpapers.sh".source = ../dotfiles/.screenlayout/wallpapers.sh;
".config/i3/config".source = ../dotfiles/.config/i3/config;
".config/rofi/config.rasi".source = ../dotfiles/.config/rofi/config.rasi;
".config/polybar/config.ini".source = ../dotfiles/.config/polybar/config.ini;
};
home.stateVersion = "23.11";
}

36
home-manager/zsh.nix Normal file
View File

@ -0,0 +1,36 @@
{ inputs, config, pkgs, ... }: {
programs.zsh = {
enable = true;
enableCompletion = true;
enableAutosuggestions = true;
syntaxHighlighting.enable = true;
history.size = 100000000;
shellAliases = {
update-system = "sudo nixos-rebuild switch --flake ~/dotfiles";
update-user = "home-manager switch --flake ~/dotfiles";
update-all = "update-system && update-user";
};
plugins = [
{
name = "custom-functions";
src = ../dotfiles;
file = ".functions.zsh";
}
{
name = "powerlevel10k-config";
src = ../dotfiles;
file = ".p10k.zsh";
}
];
zplug = {
enable = true;
plugins = [
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
];
};
};
}

View File

@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true;
users.users.jadenmaxwell = {
name = "jadenmaxwell";
home = "/Users/jadenmaxwell";
};
# Used for backwards compatibility.
system.stateVersion = 4;
}