mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 15:45:38 +00:00
reorganize files
This commit is contained in:
parent
2a4a8efa48
commit
6353ac188e
@ -72,9 +72,7 @@
|
||||
# Format and install from nothing
|
||||
apps = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
installer = import ./modules/system/installer.nix { inherit pkgs; };
|
||||
});
|
||||
in { installer = import ./apps/installer.nix { inherit pkgs; }; });
|
||||
|
||||
# Used to run commands and edit files in this repo
|
||||
devShells = forAllSystems (system:
|
||||
|
@ -1,6 +1,11 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
|
||||
imports = [ ../modules/shell ../modules/editor ../modules/mail/himalaya.nix ];
|
||||
imports = [
|
||||
../modules/shell
|
||||
../modules/neovim
|
||||
../modules/repositories/notes.nix
|
||||
../modules/repositories/dotfiles.nix
|
||||
];
|
||||
|
||||
options = with lib; {
|
||||
user = mkOption {
|
||||
@ -50,7 +55,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
config = let stateVersion = "22.11";
|
||||
in {
|
||||
|
||||
# Enable features in Nix commands
|
||||
nix.extraOptions = "experimental-features = nix-command flakes";
|
||||
@ -69,10 +75,9 @@
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
|
||||
# Set a variable for dotfiles repo, not necessary but convenient
|
||||
home-manager.users.${config.user} = {
|
||||
home.sessionVariables = { DOTS = config.dotfilesPath; };
|
||||
};
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
home-manager.users.root.home.stateVersion = stateVersion;
|
||||
|
||||
};
|
||||
|
||||
|
@ -27,10 +27,11 @@ nixpkgs.lib.nixosSystem {
|
||||
./hardware-configuration.nix
|
||||
../common.nix
|
||||
../../modules/hardware
|
||||
../../modules/system
|
||||
../../modules/nixos
|
||||
../../modules/graphical
|
||||
../../modules/gaming
|
||||
../../modules/applications
|
||||
../../modules/mail/himalaya.nix
|
||||
../../modules/services/keybase.nix
|
||||
../../modules/services/gnupg.nix
|
||||
../../modules/services/mullvad.nix
|
||||
|
@ -17,6 +17,7 @@ darwin.lib.darwinSystem {
|
||||
../../modules/darwin
|
||||
../../modules/applications/alacritty.nix
|
||||
../../modules/applications/discord.nix
|
||||
../../modules/mail/himalaya.nix
|
||||
../../modules/programming/nix.nix
|
||||
../../modules/programming/terraform.nix
|
||||
../../modules/programming/python.nix
|
||||
|
@ -6,7 +6,6 @@ nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
globals
|
||||
home-manager.nixosModules.home-manager
|
||||
wsl.nixosModules.wsl
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
@ -20,14 +19,15 @@ nixpkgs.lib.nixosSystem {
|
||||
automountPath = "/mnt";
|
||||
defaultUser = globals.user;
|
||||
startMenuLaunchers = true;
|
||||
wslConf.network.generateResolvConf = true; # Turn off if breaking VPN
|
||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||
interop.includePath =
|
||||
false; # Including Windows PATH will slow down Neovim
|
||||
false; # Including Windows PATH will slow down Neovim command mode
|
||||
};
|
||||
}
|
||||
../common.nix
|
||||
../../modules/wsl
|
||||
../../modules/system
|
||||
../../modules/nixos
|
||||
../../modules/mail/himalaya.nix
|
||||
../../modules/programming/nix.nix
|
||||
../../modules/programming/lua.nix
|
||||
];
|
||||
|
@ -18,19 +18,5 @@
|
||||
base0D = "#83a598"; # blue
|
||||
base0E = "#d3869b"; # purple
|
||||
base0F = "#d65d0e"; # brown
|
||||
neovimConfig = ''
|
||||
local M = {}
|
||||
|
||||
M.packer = function(use)
|
||||
use({
|
||||
"lifepillar/vim-gruvbox8",
|
||||
config = function()
|
||||
vim.g.gruvbox_italicize_strings = 0
|
||||
vim.cmd("colorscheme gruvbox8")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
'';
|
||||
neovimConfig = ./neovim.lua;
|
||||
}
|
||||
|
13
modules/colorscheme/gruvbox/neovim.lua
Normal file
13
modules/colorscheme/gruvbox/neovim.lua
Normal file
@ -0,0 +1,13 @@
|
||||
local M = {}
|
||||
|
||||
M.packer = function(use)
|
||||
use({
|
||||
"lifepillar/vim-gruvbox8",
|
||||
config = function()
|
||||
vim.g.gruvbox_italicize_strings = 0
|
||||
vim.cmd("colorscheme gruvbox8")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
@ -12,7 +12,4 @@
|
||||
./utilities.nix
|
||||
];
|
||||
|
||||
home-manager.users.${config.user}.home.stateVersion = "22.11";
|
||||
home-manager.users.root.home.stateVersion = "22.11";
|
||||
|
||||
}
|
||||
|
@ -14,11 +14,16 @@
|
||||
kubectl
|
||||
k9s
|
||||
noti # Create notifications programmatically
|
||||
(pkgs.writeShellScriptBin "ocr"
|
||||
(builtins.readFile ../shell/bash/scripts/ocr.sh))
|
||||
];
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
# Add noti for ghpr in Darwin
|
||||
ghpr = lib.mkForce "gh pr create && sleep 3 && noti gh run watch";
|
||||
|
||||
# Shortcut to edit hosts file
|
||||
hosts = "sudo nvim /etc/hosts";
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -1,5 +0,0 @@
|
||||
{ ... }: {
|
||||
|
||||
imports = [ ./neovim ./notes.nix ./dotfiles.nix ];
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
# Timezone required for Redshift schedule
|
||||
imports = [ ../system/timezone.nix ];
|
||||
imports = [ ../nixos/timezone.nix ];
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
source = ./lua;
|
||||
recursive = true; # Allows adding more files
|
||||
};
|
||||
"nvim/lua/packer/colors.lua".text = config.gui.colorscheme.neovimConfig;
|
||||
"nvim/lua/packer/colors.lua".source = config.gui.colorscheme.neovimConfig;
|
||||
};
|
||||
|
||||
programs.git.extraConfig.core.editor = "nvim";
|
9
modules/nixos/default.nix
Normal file
9
modules/nixos/default.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ config, ... }: {
|
||||
|
||||
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
system.stateVersion =
|
||||
config.home-manager.users.${config.user}.home.stateVersion;
|
||||
|
||||
}
|
@ -16,6 +16,9 @@
|
||||
|
||||
};
|
||||
|
||||
# Set a variable for dotfiles repo, not necessary but convenient
|
||||
home.sessionVariables.DOTS = config.dotfilesPath;
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p tesseract
|
||||
|
||||
# Yoinked from https://github.com/JJGO/dotfiles
|
||||
# Adapted from https://github.com/sdushantha/bin
|
||||
@ -13,18 +14,6 @@ function notify-send() {
|
||||
|
||||
PATH="/usr/local/bin/:$PATH"
|
||||
|
||||
# Check if the needed dependencies are installed
|
||||
dependencies=(tesseract)
|
||||
for dependency in "${dependencies[@]}"; do
|
||||
type -p "$dependency" &>/dev/null || {
|
||||
# The reason why we are sending the error as a notification is because
|
||||
# user is most likely going to run this script by binding it to their
|
||||
# keyboard, therefor they cant see any text that is outputed using echo
|
||||
notify-send "ocr" "Could not find '${dependency}', is it installed?"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
# Take screenshot by selecting the area
|
||||
screencapture -i "$IMAGE_FILE"
|
||||
|
||||
@ -47,7 +36,7 @@ tesseract "$IMAGE_FILE" "${TEXT_FILE//\.txt/}"
|
||||
|
||||
# Check if the text was detected by checking number
|
||||
# of lines in the file
|
||||
LINES=$(wc -l < $TEXT_FILE)
|
||||
LINES=$(wc -l <$TEXT_FILE)
|
||||
if [ "$LINES" -eq 0 ]; then
|
||||
notify-send "ocr" "no text was detected"
|
||||
exit 1
|
||||
@ -55,10 +44,10 @@ fi
|
||||
|
||||
# Copy text to clipboard
|
||||
# xclip -selection clip < "$TEXT_FILE"
|
||||
pbcopy < "$TEXT_FILE"
|
||||
pbcopy <"$TEXT_FILE"
|
||||
|
||||
# Send a notification with the text that was grabbed using OCR
|
||||
# notify-send "ocr" "$(cat $TEXT_FILE)"
|
||||
notify-send "ocr" "$(cat $TEXT_FILE)"
|
||||
|
||||
# Clean up
|
||||
# "Always leave the area better than you found it"
|
@ -46,7 +46,6 @@
|
||||
};
|
||||
|
||||
# Provides "command-not-found" options
|
||||
# Requires activating a manual download
|
||||
programs.nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
@ -54,7 +53,7 @@
|
||||
|
||||
};
|
||||
|
||||
# Set system channels for nix-shell
|
||||
# Set system channels, used for nix-shell commands
|
||||
nix = { nixPath = [ "nixpkgs=${pkgs.path}" ]; };
|
||||
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
{ config, ... }: {
|
||||
|
||||
imports = [ ./user.nix ./timezone.nix ./doas.nix ];
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
system.stateVersion = "22.11";
|
||||
home-manager.users.${config.user}.home.stateVersion = "22.11";
|
||||
home-manager.users.root.home.stateVersion = "22.11";
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
# Systemd doesn't work in WSL so these must be disabled
|
||||
services.geoclue2.enable = lib.mkForce false;
|
||||
location = { provider = lib.mkForce "manual"; };
|
||||
services.localtimed.enable = lib.mkForce false;
|
||||
@ -8,7 +9,8 @@
|
||||
# home-manager.users.${config.user}.home.sessionPath =
|
||||
# [ "/mnt/c/Program Files/win32yank/" ];
|
||||
|
||||
# Replace config directory with our repo
|
||||
# Replace config directory with our repo, since it sources from config on
|
||||
# every launch
|
||||
system.activationScripts.configDir.text = ''
|
||||
rm -rf /etc/nixos
|
||||
ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos
|
||||
|
Loading…
Reference in New Issue
Block a user