Added nix darwin to repo
This commit is contained in:
parent
ccde53af11
commit
c68a81c262
21
flake.lock
generated
21
flake.lock
generated
@ -21,6 +21,26 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715668745,
|
"lastModified": 1715668745,
|
||||||
@ -40,6 +60,7 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
36
flake.nix
36
flake.nix
@ -7,22 +7,44 @@
|
|||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nix-darwin = {
|
||||||
|
url = "github:LnL7/nix-darwin";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, ... } @ inputs:
|
outputs = { self, nixpkgs, nix-darwin, home-manager, ... } @ inputs: {
|
||||||
let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
in {
|
|
||||||
nixosConfigurations.randomctf = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.randomctf = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [ ./nixos/configuration.nix ];
|
modules = [ ./nixos/configuration.nix ];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations.random = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations.random = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./home-manager/home.nix
|
./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
55
home-manager/common.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
16
home-manager/darwin-home.nix
Normal file
16
home-manager/darwin-home.nix
Normal 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
11
home-manager/emacs.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ inputs, config, pkgs, ... }: {
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = epkgs: with epkgs; [
|
||||||
|
mu4e
|
||||||
|
vterm
|
||||||
|
all-the-icons
|
||||||
|
nerd-icons
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -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";
|
|
||||||
}
|
|
40
home-manager/nixos-home.nix
Normal file
40
home-manager/nixos-home.nix
Normal 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
36
home-manager/zsh.nix
Normal 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 ]; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
23
nixos/darwin-configuration.nix
Normal file
23
nixos/darwin-configuration.nix
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user