Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodachi94 committed Apr 6, 2024
1 parent dfd46f0 commit ff70e16
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 120 deletions.
45 changes: 24 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,23 @@

zsh-craftos-select = {
url = "git+https://gist.github.com/tomodachi94/aaae79f7cb4e7b2087727fbbfe05eb12";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { nixpkgs, nixos-hardware, home-manager, nur, tomodachi94, mac-app-util, nix-craftos-pc, zsh-craftos-select, ... }:
outputs = { nixpkgs, nixos-hardware, home-manager, tomodachi94, mac-app-util, zsh-craftos-select, ... }:
let
tomolib = import ./lib { inherit nixpkgs home-manager; };
tomolib = import ./lib { inherit nixpkgs home-manager; };

vars = import ./lib/vars.nix;
vars = import ./lib/vars.nix;

commonInputs = { inherit vars tomodachi94; };
commonInputs = { inherit vars tomodachi94; };

homeCommonInputs = commonInputs // { inherit zsh-craftos-select; };
homeLinuxInputs = homeCommonInputs // { inherit nix-craftos-pc; };
homeDarwinInputs = homeCommonInputs // { inherit mac-app-util; };
homeCommonInputs = commonInputs // { inherit zsh-craftos-select; };
homeDarwinInputs = homeCommonInputs // { inherit mac-app-util; };

systemCommonInputs = commonInputs // { };
systemLinuxInputs = systemCommonInputs // { nixos-hardware = nixos-hardware.nixosModules; homeInputs = homeCommonInputs; };
systemDarwinInputs = systemCommonInputs // { };
systemCommonInputs = commonInputs // { };
systemLinuxInputs = systemCommonInputs // { nixos-hardware = nixos-hardware.nixosModules; homeInputs = homeCommonInputs; };

in
{
Expand All @@ -61,15 +59,20 @@
homeConfigurations.linux-aarch64 = tomolib.mkHMConfig { systemType = "linux"; systemArch = "aarch64"; args = homeDarwinInputs; };
homeConfigurations.linux-x86_64 = tomolib.mkHMConfig { systemType = "linux"; systemArch = "x86_64"; args = homeDarwinInputs; };

nixosConfigurations.hp-laptop-df0023 = tomolib.mkNixosConfig { hostname = "hp-laptop-df0023"; systemArch = "x86_64"; args = systemLinuxInputs; extraModules = let hw = nixos-hardware.nixosModules; in [
hw.common-cpu-intel
hw.common-cpu-intel-sandy-bridge
hw.common-pc
hw.common-pc-laptop
# Note: This laptop had its HDD replaced with an SSD
hw.common-pc-laptop-ssd
]; };
nixosConfigurations.hp-laptop-df0023 = tomolib.mkNixosConfig {
hostname = "hp-laptop-df0023";
systemArch = "x86_64";
args = systemLinuxInputs;
extraModules = let hw = nixos-hardware.nixosModules; in [
hw.common-cpu-intel
hw.common-cpu-intel-sandy-bridge
hw.common-pc
hw.common-pc-laptop
# Note: This laptop had its HDD replaced with an SSD
hw.common-pc-laptop-ssd
];
};

devShells = tomolib.forAllSystems (pkgs: import ./lib/shells.nix { inherit pkgs home-manager; } );
devShells = tomolib.forAllSystems (pkgs: import ./lib/shells.nix { inherit pkgs home-manager; });
};
}
2 changes: 1 addition & 1 deletion home/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
./desktop-standalone-packages
./dircolors
./direnv
./eza
./eza
./fonts
./git
./helix
Expand Down
2 changes: 1 addition & 1 deletion home/common/desktop-standalone-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
home.packages = [
pkgs.discord
pkgs.obsidian
pkgs.spotube
pkgs.spotube
];
}
8 changes: 4 additions & 4 deletions home/common/direnv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
enable = true;
nix-direnv.enable = true;
enableZshIntegration = true;
config = {
config = {
global = {
hide_env_diff = true;
warn_timeout = "1m";
};
};
warn_timeout = "1m";
};
};
};
}
2 changes: 1 addition & 1 deletion home/common/eza/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{
programs.eza = {
enable = true;
enableZshIntegration = pkgs.lib.mkForce false; # Has some aliases that I do not want
enableZshIntegration = pkgs.lib.mkForce false; # Has some aliases that I do not want
};
}
58 changes: 29 additions & 29 deletions home/common/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
aliases = {
s = "status";
unadd = "reset HEAD --";
nvim = "!${pkgs.lib.getExe pkgs.neovim} +:G +':bd 1'"; # Open vim-fugitive
nvim = "!${pkgs.lib.getExe pkgs.neovim} +:G +':bd 1'"; # Open vim-fugitive
c = "commit";
last = "log -1 HEAD";
xdg-open = "!${pkgs.git}/bin/git remote show origin | ${pkgs.gnugrep}/bin/grep https:// | ${pkgs.gnused}/bin/sed 's/Fetch URL: //g' | ${pkgs.gnused}/bin/sed 's/Push URL: //g' | ${pkgs.coreutils}/bin/uniq | ${pkgs.findutils}/bin/xargs -n 1 ${pkgs.xdg-utils}/bin/xdg-open"; # Open Git remote 'origin' in default web browser"
Expand All @@ -26,52 +26,52 @@
color = {
ui = "auto";
};
diff = {
diff = {
algorithm = "histogram";
tool = "${pkgs.lib.getExe pkgs.neovim} -d";
};
# Guesses what I mean when I make a mistake
};
# Guesses what I mean when I make a mistake
help = {
autocorrect = "prompt";
};
# Reduce mistakes
# Reduce mistakes
url = {
"https://github.com/" = {
insteadOf = "git://github.com";
};
};
# Show full diff when running `git commit`
commit = {
# Show full diff when running `git commit`
commit = {
verbose = true;
};
# Push to branch origin/whatever_my_current_branch_is if no upstream branch is set
push = {
};
# Push to branch origin/whatever_my_current_branch_is if no upstream branch is set
push = {
default = "current";
};
# Always `git pull --rebase`.
pull = {
};
# Always `git pull --rebase`.
pull = {
rebase = true;
};
# Better diff style
merge = {
};
# Better diff style
merge = {
conflictstyle = "zdiff3";
};
# Helpful for rebases
rebase = {
};
# Helpful for rebases
rebase = {
autosquash = true;
autostash = true;
};
# Run some validation on Git objects to prevent weirdness from occuring
transfer = {
fsckobjects = true;
autostash = true;
};
# Run some validation on Git objects to prevent weirdness from occuring
transfer = {
fsckobjects = true;
};
fetch = {
fsckobjects = true;
};
fsckobjects = true;
};
receive = {
fsckObjects = true;
};
# Cache git logins
fsckObjects = true;
};
# Cache git logins
credential = {
helper = [ "cache --timeout 14440" ];
};
Expand Down
2 changes: 1 addition & 1 deletion home/common/zsh/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in
ls = "${eza}";
tree = "${eza} --tree";
lsdot = "${eza} -ad .?* 2>/dev/null"; # Source: https://github.com/Nekohime/dotfiles/blob/main/.aliases
c = "clear";
c = "clear";

# Common typos
sl = "${eza}";
Expand Down
14 changes: 7 additions & 7 deletions home/common/zsh/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
sha256 = "sha256-A0XxC8/DNb2GuIxPVUiWNsfaq+UysVRYHG8fl/Iyaaw=";
};
}
{
{
name = "craftos-select";
src = "${zsh-craftos-select.packages.${pkgs.system}.default}";
}
{
src = ./functions;
name = "init.zsh";
}
src = "${zsh-craftos-select.packages.${pkgs.system}.default}";
}
{
src = ./functions;
name = "init.zsh";
}
];
home.packages = [
# TODO: Patch the craftos-select plugin to properly set its dependencies
Expand Down
2 changes: 1 addition & 1 deletion home/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
./i3status
./kitty
./neofetch
./network-manager-applet
./network-manager-applet
# ./vivaldi
./xdg
./xorg
Expand Down
4 changes: 2 additions & 2 deletions hosts/hp-laptop-df0023/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ vars, homeInputs, ... }:
{ homeInputs, ... }:
{
imports = [
./hardware-configuration.nix
../../nixos
];

home-manager.users.me = { pkgs, vars, ... }: {
home-manager.users.me = { ... }: {
imports = [ ../../home/common ../../home/linux ];
};

Expand Down
4 changes: 1 addition & 3 deletions lib/colors.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{

}
{ }
34 changes: 17 additions & 17 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ rec {
"x86_64-darwin"
"aarch64-darwin"
]
(system: function nixpkgs.legacyPackages.${system});
(system: function nixpkgs.legacyPackages.${system});

mkHMConfig = { systemType, systemArch, args }: home-manager.lib.homeManagerConfiguration {
pkgs = mkNixpkgs { inherit systemType systemArch; };
mkHMConfig = { systemType, systemArch, args }: home-manager.lib.homeManagerConfiguration {
pkgs = mkNixpkgs { inherit systemType systemArch; };

# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = mkHMImports systemType;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = mkHMImports systemType;

# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = args;
};
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
extraSpecialArgs = args;
};

mkNixosConfig = { systemArch, hostname, extraModules, args }: nixpkgs.lib.nixosSystem {
specialArgs = args;
modules = [
(../hosts + "/${hostname}")
home-manager.nixosModules.home-manager
] ++ extraModules;
};
mkNixosConfig = { hostname, extraModules, args }: nixpkgs.lib.nixosSystem {
specialArgs = args;
modules = [
(../hosts + "/${hostname}")
home-manager.nixosModules.home-manager
] ++ extraModules;
};

}
37 changes: 19 additions & 18 deletions lib/shells.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{ pkgs, home-manager, ... }:
{

default = pkgs.mkShell {
packages = with pkgs; [
nixos-rebuild
just
stylua
deadnix
nixpkgs-fmt
selene
home-manager.packages.${system}.default
];
};
ci = pkgs.mkShell {
packages = with pkgs; [
just
nixos-rebuild
jq
];
};
default = pkgs.mkShell {
packages = with pkgs; [
nixos-rebuild
just
stylua
deadnix
nixpkgs-fmt
selene
statix
home-manager.packages.${system}.default
];
};
ci = pkgs.mkShell {
packages = with pkgs; [
just
nixos-rebuild
jq
];
};
}
28 changes: 14 additions & 14 deletions nixos/nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
trusted-substituters = [
"https://tomodachi94.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"tomodachi94.cachix.org-1:E1WFk+SYPtq3FFO+NvDgsyciIHg8nHxB/z7qNfojxpI="
];
};
gc = {
automatic = true;
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"tomodachi94.cachix.org-1:E1WFk+SYPtq3FFO+NvDgsyciIHg8nHxB/z7qNfojxpI="
];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-old --delete-older-than 14d";
};
options = "--delete-old --delete-older-than 14d";
};
};
}

0 comments on commit ff70e16

Please sign in to comment.