mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 21:50:14 +00:00
Compare commits
15 Commits
59bd3590a4
...
unfree-pre
Author | SHA1 | Date | |
---|---|---|---|
8ab86428ec | |||
d4fa322fb1 | |||
3d73f8cab4 | |||
0df8af607d | |||
61d9b103b0 | |||
71d0d3ca14 | |||
d5b0405b99 | |||
3cad3d2fb0 | |||
2acd9b3478 | |||
bf4be11718 | |||
4d38d1094f | |||
183babd2f0 | |||
12682a57e1 | |||
31170a616f | |||
4502c5ff62 |
24
flake.lock
generated
24
flake.lock
generated
@ -94,11 +94,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1675471726,
|
||||
"narHash": "sha256-526iHwidfdtZZ7aAU9od1/zbyfSFBEailBTet+Gvfqg=",
|
||||
"lastModified": 1676854489,
|
||||
"narHash": "sha256-hWmx3JFLNPGMtflyjgEn5GZydbLW3msjXvarS1NsBDM=",
|
||||
"owner": "bandithedoge",
|
||||
"repo": "nixpkgs-firefox-darwin",
|
||||
"rev": "813d55a3e3b3c0423eb5d1fcb4bf82197c9f7796",
|
||||
"rev": "6a5cca0ea8dfab4718e1e43e243c80ba110c2364",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -176,11 +176,11 @@
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1675935446,
|
||||
"narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=",
|
||||
"lastModified": 1678271387,
|
||||
"narHash": "sha256-H2dv/i1LRlunRtrESirELzfPWdlG/6ElDB1ksO529H4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2dce7f1a55e785a22d61668516df62899278c9e4",
|
||||
"rev": "36999b8d19eb6eebb41983ef017d7e0095316af2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -301,11 +301,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1676973346,
|
||||
"narHash": "sha256-rft8oGMocTAhUVqG3LW6I8K/Fo9ICGmNjRqaWTJwav0=",
|
||||
"lastModified": 1676885936,
|
||||
"narHash": "sha256-ZRKb6zBfTvdCOXI7nGC1L9UWSU5ay2ltxg+f5UIzBOU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d0d55259081f0b97c828f38559cad899d351cad1",
|
||||
"rev": "b69883faca9542d135fa6bab7928ff1b233c167f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -510,11 +510,11 @@
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -44,6 +44,7 @@ darwin.lib.darwinSystem {
|
||||
lua.enable = true;
|
||||
kubernetes.enable = true;
|
||||
_1password.enable = true;
|
||||
slack.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ nixpkgs.lib.nixosSystem {
|
||||
# mullvad.enable = true;
|
||||
nixlang.enable = true;
|
||||
dotfiles.enable = true;
|
||||
yt-dlp.enable = true;
|
||||
|
||||
gaming = {
|
||||
enable = true;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
config = lib.mkIf
|
||||
(config.gui.enable && config._1password.enable && pkgs.stdenv.isLinux) {
|
||||
unfreePackages = [ "1password" "_1password-gui" ];
|
||||
unfreePackages = with pkgs; [ _1password _1password-gui ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ _1password-gui ];
|
||||
};
|
||||
|
@ -7,9 +7,11 @@
|
||||
./firefox.nix
|
||||
./kitty.nix
|
||||
./media.nix
|
||||
./nautilus.nix
|
||||
./obsidian.nix
|
||||
./qbittorrent.nix
|
||||
./nautilus.nix
|
||||
./slack.nix
|
||||
./yt-dlp.nix
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||
unfreePackages = [ "discord" ];
|
||||
unfreePackages = [ pkgs.discord ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ discord ];
|
||||
xdg.configFile."discord/settings.json".text = ''
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||
|
||||
unfreePackages = [
|
||||
(lib.mkIf config._1password.enable "onepassword-password-manager")
|
||||
"okta-browser-plugin"
|
||||
unfreePackages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||
okta-browser-plugin
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
@ -19,9 +19,17 @@
|
||||
];
|
||||
|
||||
# Set default for opening PDFs
|
||||
xdg.mimeApps.defaultApplications."application/pdf" =
|
||||
[ "zathura.desktop" ];
|
||||
xdg.mimeApps.defaultApplications."image/*" = [ "sxiv.desktop" ];
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/*" = [ "sxiv.desktop" ];
|
||||
};
|
||||
associations.removed = { "application/pdf" = [ "mupdf.desktop" ]; };
|
||||
defaultApplications = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/*" = [ "sxiv.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||
unfreePackages = [ "obsidian" ];
|
||||
unfreePackages = [ pkgs.obsidian ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
|
19
modules/common/applications/slack.nix
Normal file
19
modules/common/applications/slack.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
slack = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Slack.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.slack.enable) {
|
||||
unfreePackages = [ pkgs.slack ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ slack ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
35
modules/common/applications/yt-dlp.nix
Normal file
35
modules/common/applications/yt-dlp.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
yt-dlp = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable YouTube downloader.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.yt-dlp.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
programs.yt-dlp = {
|
||||
enable = true;
|
||||
extraConfig = "";
|
||||
settings = {
|
||||
no-continue = true; # Always re-download each fragment
|
||||
no-overwrites = true; # Don't overwrite existing files
|
||||
download-archive = "archive.log"; # Log of archives
|
||||
embed-metadata = true;
|
||||
embed-thumbnail = true;
|
||||
embed-subs = true;
|
||||
sub-langs = "en.*";
|
||||
concurrent-fragments = 4; # Parallel download chunks
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -68,7 +68,7 @@
|
||||
description = "Link to dotfiles repository.";
|
||||
};
|
||||
unfreePackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
type = lib.types.listOf lib.types.package;
|
||||
description = "List of unfree packages to allow.";
|
||||
default = [ ];
|
||||
};
|
||||
@ -88,8 +88,9 @@
|
||||
settings = {
|
||||
|
||||
# Add community Cachix to binary cache
|
||||
substituters = [ "https://nix-community.cachix.org" ];
|
||||
trusted-public-keys = [
|
||||
substituters = lib.mkIf (!pkgs.stdenv.isDarwin)
|
||||
[ "https://nix-community.cachix.org" ];
|
||||
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
|
||||
@ -112,8 +113,10 @@
|
||||
|
||||
# Allow specified unfree packages (identified elsewhere)
|
||||
# Retrieves package object based on string name
|
||||
# Idea: https://discourse.nixos.org/t/how-to-use-packages-directly-in-allowunfreepredicate/22455/6
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
builtins.elem (pkg.name or (builtins.parseDrvName pkg.pname).name)
|
||||
(map lib.getName config.unfreePackages);
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
|
9
modules/common/neovim/config/align.nix
Normal file
9
modules/common/neovim/config/align.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }: {
|
||||
plugins = [ pkgs.vimPlugins.tabular ];
|
||||
lua = ''
|
||||
-- Align
|
||||
vim.keymap.set("", "<Leader>ta", ":Tabularize /")
|
||||
vim.keymap.set("", "<Leader>t#", ":Tabularize /#<CR>")
|
||||
vim.keymap.set("", "<Leader>tl", ":Tabularize /---<CR>")
|
||||
'';
|
||||
}
|
@ -34,6 +34,14 @@ in {
|
||||
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
||||
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||
|
||||
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
||||
name = "Neovim wrapper";
|
||||
exec = "kitty nvim %F";
|
||||
};
|
||||
xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux {
|
||||
defaultApplications."text/markdown" = [ "nvim.desktop" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# # Used for icons in Vim
|
||||
|
@ -31,6 +31,7 @@
|
||||
pkgs.neovimBuilder {
|
||||
package = pkgs.neovim-unwrapped;
|
||||
imports = [
|
||||
../config/align.nix
|
||||
../config/bufferline.nix
|
||||
../config/completion.nix
|
||||
../config/gitsigns.nix
|
||||
|
@ -6,4 +6,10 @@
|
||||
config = { whitelist = { prefix = [ config.dotfilesPath ]; }; };
|
||||
};
|
||||
|
||||
# Prevent garbage collection
|
||||
nix.extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
||||
discord = "${pkgs.discord}/Applications/Discord.app";
|
||||
kitty = "${pkgs.kitty}/Applications/kitty.app";
|
||||
slack = "${pkgs.slack}/Applications/Slack.app";
|
||||
};
|
||||
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source =
|
||||
./hammerspoon/Spoons/MoveWindow.spoon;
|
||||
|
@ -8,44 +8,44 @@ obj.name = "Launcher"
|
||||
obj.version = "0.1"
|
||||
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||
|
||||
function DrawSwitcher()
|
||||
-- Drawing
|
||||
local width = hs.screen.mainScreen():fullFrame().w
|
||||
local switcherWidth = 500
|
||||
local canv = hs.canvas.new({
|
||||
obj.canvas = hs.canvas.new({
|
||||
x = width / 2 - switcherWidth / 2,
|
||||
y = 1,
|
||||
h = 3,
|
||||
w = switcherWidth,
|
||||
})
|
||||
canv[#canv + 1] = {
|
||||
-- Draw switcher
|
||||
obj.canvas[#obj.canvas + 1] = {
|
||||
action = "build",
|
||||
type = "rectangle",
|
||||
}
|
||||
canv[#canv + 1] = {
|
||||
obj.canvas[#obj.canvas + 1] = {
|
||||
type = "rectangle",
|
||||
fillColor = { alpha = 1, red = 0.8, green = 0.6, blue = 0.3 },
|
||||
action = "fill",
|
||||
}
|
||||
return canv:show()
|
||||
end
|
||||
|
||||
function obj:init()
|
||||
-- Begin launcher mode
|
||||
if self.launcher == nil then
|
||||
self.launcher = hs.hotkey.modal.new("ctrl", "space")
|
||||
|
||||
print(self.canvas)
|
||||
print(obj.canvas)
|
||||
end
|
||||
|
||||
-- Behaviors on enter
|
||||
function self.launcher:entered()
|
||||
-- hs.alert("Entered mode")
|
||||
self.canv = DrawSwitcher()
|
||||
obj.canvas:show()
|
||||
end
|
||||
|
||||
-- Behaviors on exit
|
||||
function self.launcher:exited()
|
||||
-- hs.alert("Exited mode")
|
||||
self.canv:hide()
|
||||
obj.canvas:hide()
|
||||
end
|
||||
|
||||
-- Use escape to exit launcher mode
|
||||
@ -54,7 +54,8 @@ function obj:init()
|
||||
end)
|
||||
|
||||
-- Launcher shortcuts
|
||||
self.launcher:bind("ctrl", "space", function() end)
|
||||
self.launcher:bind("ctrl", "space", function()
|
||||
end)
|
||||
self.launcher:bind("", "return", function()
|
||||
self:switch("@kitty@")
|
||||
end)
|
||||
@ -92,7 +93,7 @@ function obj:init()
|
||||
hs.reload()
|
||||
end)
|
||||
self.launcher:bind("", "S", function()
|
||||
self:switch("Slack.app")
|
||||
self:switch("@slack@")
|
||||
end)
|
||||
self.launcher:bind("", "Z", function()
|
||||
self:switch("zoom.us.app")
|
||||
|
@ -166,7 +166,7 @@
|
||||
echo "Choose and order dock icons"
|
||||
defaults write com.apple.dock persistent-apps -array \
|
||||
"$(__dock_item /Applications/1Password.app)" \
|
||||
"$(__dock_item /Applications/Slack.app)" \
|
||||
"$(__dock_item ${pkgs.slack}/Applications/Slack.app)" \
|
||||
"$(__dock_item /System/Applications/Calendar.app)" \
|
||||
"$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
|
||||
"$(__dock_item /System/Applications/Messages.app)" \
|
||||
|
@ -14,7 +14,7 @@ in {
|
||||
|
||||
config = lib.mkIf config.gaming.minecraft-server.enable {
|
||||
|
||||
unfreePackages = [ "minecraft-server" ];
|
||||
unfreePackages = [ pkgs.minecraft-server ];
|
||||
|
||||
services.minecraft-server = {
|
||||
enable = true;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
config = lib.mkIf (config.gaming.steam.enable && pkgs.stdenv.isLinux) {
|
||||
hardware.steam-hardware.enable = true;
|
||||
unfreePackages = [ "steam" "steam-original" "steamcmd" "steam-run" ];
|
||||
unfreePackages = with pkgs; [ steam steamcmd steam-run ];
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
|
@ -13,6 +13,9 @@
|
||||
# Attempt to display GRUB on widescreen monitor
|
||||
gfxmodeEfi = "1920x1080";
|
||||
|
||||
# Limit the total number of configurations to rollback
|
||||
configurationLimit = 25;
|
||||
|
||||
# Install GRUB onto the boot disk
|
||||
# device = config.fileSystems."/boot".device;
|
||||
|
||||
|
@ -9,6 +9,12 @@
|
||||
networking.interfaces.enp5s0.useDHCP = true;
|
||||
networking.interfaces.wlp4s0.useDHCP = true;
|
||||
|
||||
networking.firewall.allowPing = lib.mkIf config.server true;
|
||||
networking.hosts = {
|
||||
"192.168.0.120" = [ "tempest" ];
|
||||
"192.168.0.218" = [ "swan" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
services.samba = lib.mkIf (config.samba.enable) {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
shares.video = {
|
||||
shares.data = {
|
||||
path = "/data";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
@ -18,15 +18,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Allow browsing Samba shares
|
||||
# Allows Windows clients to discover server
|
||||
services.samba-wsdd.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 5357 ];
|
||||
networking.firewall.allowedUDPPorts = [ 3702 ];
|
||||
|
||||
# Allow client browsing Samba and virtual filesystem shares
|
||||
services.gvfs =
|
||||
lib.mkIf (config.gui.enable && config.nautilus.enable) { enable = true; };
|
||||
|
||||
# Permissions required to mount Samba with GVFS, if not using desktop environment
|
||||
environment.systemPackages = lib.mkIf (config.gui.enable
|
||||
&& config.nautilus.enable
|
||||
&& config.services.xserver.windowManager.i3.enable)
|
||||
[ pkgs.lxqt.pxqt-policykit ];
|
||||
# # Permissions required to mount Samba with GVFS, if not using desktop environment
|
||||
# environment.systemPackages = lib.mkIf (config.gui.enable
|
||||
# && config.nautilus.enable
|
||||
# && config.services.xserver.windowManager.i3.enable)
|
||||
# [ pkgs.lxqt.lxqt-policykit ];
|
||||
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,11 @@
|
||||
};
|
||||
|
||||
home-manager.users.${config.user}.xdg = {
|
||||
|
||||
# Allow Nix to manage the default applications list
|
||||
mimeApps.enable = true;
|
||||
|
||||
# Set directories for application defaults
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
Reference in New Issue
Block a user