mirror of
https://github.com/nmasur/dotfiles
synced 2025-02-07 08:42:03 +00:00
more stuff
This commit is contained in:
parent
ea3ab18cca
commit
1226eafef2
@ -179,13 +179,6 @@
|
|||||||
curl
|
curl
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the system-level nixpkgs instead of Home Manager's
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
|
|
||||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
|
||||||
# using multiple profiles for one user
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
# Allow specified unfree packages (identified elsewhere)
|
# Allow specified unfree packages (identified elsewhere)
|
||||||
# Retrieves package object based on string name
|
# Retrieves package object based on string name
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./applications
|
|
||||||
./gaming
|
|
||||||
./graphical
|
|
||||||
./hardware
|
|
||||||
./services
|
|
||||||
./system
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./dunst.nix
|
|
||||||
./fonts.nix
|
|
||||||
./gtk.nix
|
|
||||||
./i3.nix
|
|
||||||
./picom.nix
|
|
||||||
./polybar.nix
|
|
||||||
./rofi.nix
|
|
||||||
./xorg.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options = {
|
|
||||||
|
|
||||||
launcherCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for launching";
|
|
||||||
};
|
|
||||||
systemdSearch = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for interacting with systemd";
|
|
||||||
};
|
|
||||||
altTabCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for choosing windows";
|
|
||||||
};
|
|
||||||
audioSwitchCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for switching audio sink";
|
|
||||||
};
|
|
||||||
brightnessCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for adjusting brightness";
|
|
||||||
};
|
|
||||||
calculatorCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for quick calculations";
|
|
||||||
};
|
|
||||||
toggleBarCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to hide and show the status bar.";
|
|
||||||
};
|
|
||||||
powerCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Command to use for power options menu";
|
|
||||||
};
|
|
||||||
terminal = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
description = "Path to executable for terminal emulator program.";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
terminalLaunchCommand = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
description = "Command for using the terminal to launch a new window with a program.";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
wallpaper = lib.mkOption {
|
|
||||||
type = lib.types.path;
|
|
||||||
description = "Wallpaper background image file";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
fontName = "Victor Mono";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && pkgs.stdenv.isLinux) {
|
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
victor-mono # Used for Vim and Terminal
|
|
||||||
nerd-fonts.hack # For Polybar, Rofi
|
|
||||||
];
|
|
||||||
fonts.fontconfig.defaultFonts.monospace = [ fontName ];
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
xsession.windowManager.i3.config.fonts = {
|
|
||||||
names = [ "pango:${fontName}" ];
|
|
||||||
# style = "Regular";
|
|
||||||
# size = 11.0;
|
|
||||||
};
|
|
||||||
services.polybar.config."bar/main".font-0 = "Hack Nerd Font:size=10;2";
|
|
||||||
programs.rofi.font = "Hack Nerd Font 14";
|
|
||||||
programs.alacritty.settings.font.normal.family = fontName;
|
|
||||||
programs.kitty.font.name = fontName;
|
|
||||||
services.dunst.settings.global.font = "Hack Nerd Font 14";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./rofi/power.nix
|
|
||||||
./rofi/brightness.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
|
||||||
|
|
||||||
launcherCommand = ''${rofi}/bin/rofi -modes drun -show drun -theme-str '@import "launcher.rasi"' '';
|
|
||||||
systemdSearch = "${pkgs.rofi-systemd}/bin/rofi-systemd";
|
|
||||||
altTabCommand = "${rofi}/bin/rofi -show window -modi window";
|
|
||||||
calculatorCommand = "${rofi}/bin/rofi -modes calc -show calc";
|
|
||||||
audioSwitchCommand = "${
|
|
||||||
(pkgs.writeShellApplication {
|
|
||||||
name = "switch-audio";
|
|
||||||
runtimeInputs = [
|
|
||||||
pkgs.ponymix
|
|
||||||
rofi
|
|
||||||
];
|
|
||||||
text = builtins.readFile ./rofi/pulse-sink.sh;
|
|
||||||
})
|
|
||||||
}/bin/switch-audio";
|
|
||||||
};
|
|
||||||
}
|
|
4
platforms/home-manager/default.nix
Normal file
4
platforms/home-manager/default.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports = lib.filesystem.listFilesRecursive ./.;
|
||||||
|
}
|
@ -6,13 +6,12 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.presets.programs."1password";
|
cfg = config.nmasur.presets.programs._1password;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs."1password".enable =
|
options.nmasur.presets.programs._1password.enable = lib.mkEnableOption "1Password password manager";
|
||||||
lib.mkEnableOption "1Password password manager";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
unfreePackages = [
|
unfreePackages = [
|
@ -1,16 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./1password.nix
|
|
||||||
./alacritty.nix
|
|
||||||
./discord.nix
|
|
||||||
./firefox.nix
|
|
||||||
./kitty.nix
|
|
||||||
./media.nix
|
|
||||||
./nsxiv.nix
|
|
||||||
./wezterm.nix
|
|
||||||
./yt-dlp.nix
|
|
||||||
./zathura.nix
|
|
||||||
];
|
|
||||||
}
|
|
@ -17,11 +17,6 @@ in
|
|||||||
programs.direnv = {
|
programs.direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
config = {
|
|
||||||
whitelist = {
|
|
||||||
prefix = [ config.nmasur.dotfilesPath ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
programs.git.extraConfig.safe.directory = cfg.path;
|
||||||
|
programs.direnv.config.whitelist.prefix = [ cfg.path ];
|
||||||
|
|
||||||
home.activation = {
|
home.activation = {
|
||||||
|
|
||||||
# Always clone dotfiles repository if it doesn't exist
|
# Always clone dotfiles repository if it doesn't exist
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.programs.git-work;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.programs.git-work = {
|
||||||
|
enable = lib.mkEnableOption "Git settings for work";
|
||||||
|
work = {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Name to use for work git commits";
|
||||||
|
};
|
||||||
|
email = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Email to use for work git commits";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
personal = {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Name to use for personal git commits";
|
||||||
|
};
|
||||||
|
email = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Email to use for personal git commits";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
userName = lib.mkForce cfg.work.name;
|
||||||
|
userEmail = lib.mkForce cfg.work.email;
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
path = "${config.xdg.configHome}/${config.xdg.configFile."git/personal".target}";
|
||||||
|
condition = "gitdir:~/dev/personal/";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# Personal git config
|
||||||
|
xdg.configFile."git/personal".text = pkgs.formats.gitIni {
|
||||||
|
user = {
|
||||||
|
name = cfg.personal.name;
|
||||||
|
email = cfg.personal.email;
|
||||||
|
signingkey = "~/.ssh/id_ed25519";
|
||||||
|
};
|
||||||
|
commit = {
|
||||||
|
gpgsign = true;
|
||||||
|
};
|
||||||
|
tag = {
|
||||||
|
gpgsign = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -12,12 +12,12 @@ in
|
|||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.git = {
|
options.nmasur.presets.programs.git = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "Git version control";
|
||||||
gitName = lib.mkOption {
|
name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Name to use for git commits";
|
description = "Name to use for git commits";
|
||||||
};
|
};
|
||||||
gitEmail = lib.mkOption {
|
email = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Email to use for git commits";
|
description = "Email to use for git commits";
|
||||||
};
|
};
|
||||||
@ -27,17 +27,14 @@ in
|
|||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = config.gitName;
|
userName = cfg.name;
|
||||||
userEmail = config.gitEmail;
|
userEmail = cfg.email;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
core.pager = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F";
|
core.pager = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F";
|
||||||
interactive.difffilter = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
|
interactive.difffilter = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
|
||||||
pager = {
|
pager = {
|
||||||
branch = "false";
|
branch = "false";
|
||||||
};
|
};
|
||||||
safe = {
|
|
||||||
directory = config.dotfilesPath;
|
|
||||||
};
|
|
||||||
pull = {
|
pull = {
|
||||||
ff = "only";
|
ff = "only";
|
||||||
};
|
};
|
||||||
@ -61,27 +58,8 @@ in
|
|||||||
".direnv/**"
|
".direnv/**"
|
||||||
"result"
|
"result"
|
||||||
];
|
];
|
||||||
includes = [
|
|
||||||
{
|
|
||||||
path = "~/.config/git/personal";
|
|
||||||
condition = "gitdir:~/dev/personal/";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Personal git config
|
|
||||||
# TODO: fix with variables
|
|
||||||
xdg.configFile."git/personal".text = ''
|
|
||||||
[user]
|
|
||||||
name = "${config.fullName}"
|
|
||||||
email = "7386960+nmasur@users.noreply.github.com"
|
|
||||||
signingkey = ~/.ssh/id_ed25519
|
|
||||||
[commit]
|
|
||||||
gpgsign = true
|
|
||||||
[tag]
|
|
||||||
gpgsign = true
|
|
||||||
'';
|
|
||||||
|
|
||||||
xdg.configFile."git/allowed-signers".text = ''
|
xdg.configFile."git/allowed-signers".text = ''
|
||||||
7386960+nmasur@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s
|
7386960+nmasur@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s
|
||||||
'';
|
'';
|
||||||
|
@ -16,7 +16,14 @@ in
|
|||||||
./brightness.nix
|
./brightness.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.nmasur.presets.programs.rofi.enable = lib.mkEnableOption "Rofi quick launcher";
|
options.nmasur.presets.programs.rofi = {
|
||||||
|
enable = lib.mkEnableOption "Rofi quick launcher";
|
||||||
|
terminal = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Terminal application for rofi";
|
||||||
|
default = config.nmasur.presets.services.i3.terminal;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
@ -24,12 +31,33 @@ in
|
|||||||
jq # Required for rofi-systemd
|
jq # Required for rofi-systemd
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nmasur.presets.services.i3.commands =
|
||||||
|
let
|
||||||
|
rofi = config.programs.rofi.finalPackage;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
launcher = ''${lib.getExe rofi} -modes drun -show drun -theme-str '@import "launcher.rasi"' '';
|
||||||
|
systemdSearch = lib.getExe pkgs.rofi-systemd;
|
||||||
|
altTab = "${lib.getExe rofi} -show window -modi window";
|
||||||
|
calculator = "${lib.getExe rofi} -modes calc -show calc";
|
||||||
|
audioSwitch = lib.getExe (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "switch-audio";
|
||||||
|
runtimeInputs = [
|
||||||
|
pkgs.ponymix
|
||||||
|
rofi
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./rofi/pulse-sink.sh;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
programs.rofi = {
|
programs.rofi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cycle = true;
|
cycle = true;
|
||||||
location = "center";
|
location = "center";
|
||||||
pass = { };
|
pass = { };
|
||||||
terminal = lib.mkIf pkgs.stdenv.isLinux config.terminal;
|
terminal = lib.getExe cfg.terminal;
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.rofi-calc
|
pkgs.rofi-calc
|
||||||
pkgs.rofi-emoji
|
pkgs.rofi-emoji
|
||||||
|
@ -17,6 +17,10 @@ in
|
|||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
description = "Terminal application to launch";
|
description = "Terminal application to launch";
|
||||||
};
|
};
|
||||||
|
wallpaper = {
|
||||||
|
type = lib.types.path;
|
||||||
|
description = "Wallpaper background image file";
|
||||||
|
};
|
||||||
commands = {
|
commands = {
|
||||||
launcher = lib.mkOption {
|
launcher = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
@ -31,7 +35,7 @@ in
|
|||||||
updateLockScreen = lib.mkOption {
|
updateLockScreen = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
description = "Update lock screen cache";
|
description = "Update lock screen cache";
|
||||||
default = "${lib.getExe pkgs.betterlockscreen} --update ${config.wallpaper} --display 1 --span";
|
default = "${lib.getExe pkgs.betterlockscreen} --update ${cfg.wallpaper} --display 1 --span";
|
||||||
};
|
};
|
||||||
toggleBar = lib.mkOption {
|
toggleBar = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
@ -271,7 +275,7 @@ in
|
|||||||
modes = { };
|
modes = { };
|
||||||
startup = [
|
startup = [
|
||||||
{
|
{
|
||||||
command = "feh --bg-fill ${config.wallpaper}";
|
command = "feh --bg-fill ${cfg.wallpaper}";
|
||||||
always = true;
|
always = true;
|
||||||
notification = false;
|
notification = false;
|
||||||
}
|
}
|
||||||
|
@ -12,18 +12,30 @@ in
|
|||||||
options.nmasur.profiles.common.enable = lib.mkEnableOption "Common home-manager config";
|
options.nmasur.profiles.common.enable = lib.mkEnableOption "Common home-manager config";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
|
||||||
dig # DNS lookup
|
home.packages = [
|
||||||
fd # find
|
pkgs.dig # DNS lookup
|
||||||
htop # Show system processes
|
pkgs.fd # find
|
||||||
killall # Force quit
|
pkgs.htop # Show system processes
|
||||||
inetutils # Includes telnet, whois
|
pkgs.killall # Force quit
|
||||||
jq # JSON manipulation
|
pkgs.inetutils # Includes telnet, whois
|
||||||
rsync # Copy folders
|
pkgs.jq # JSON manipulation
|
||||||
ripgrep # grep
|
pkgs.rsync # Copy folders
|
||||||
sd # sed
|
pkgs.ripgrep # grep
|
||||||
unzip # Extract zips
|
pkgs.sd # sed
|
||||||
|
pkgs.unzip # Extract zips
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nmasur.presets = {
|
||||||
|
programs = {
|
||||||
|
bat.enable = true;
|
||||||
|
ripgrep.enable = true;
|
||||||
|
fd.enable = true;
|
||||||
|
};
|
||||||
|
services = {
|
||||||
|
loadkey.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Used for aerc
|
# Used for aerc
|
||||||
xdg.enable = true;
|
xdg.enable = lib.mkDefault pkgs.stdenv.isDarwin;
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.noti # Create notifications programmatically
|
pkgs.noti # Create notifications programmatically
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.profiles.fun;
|
cfg = config.nmasur.profiles.experimental;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.profiles.fun.enable = lib.mkEnableOption "Fun tools";
|
options.nmasur.profiles.experimental.enable = lib.mkEnableOption "experimental tools";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -35,23 +35,25 @@ in
|
|||||||
|
|
||||||
programs.zoxide.enable = lib.mkDefault true; # Shortcut jump command
|
programs.zoxide.enable = lib.mkDefault true; # Shortcut jump command
|
||||||
programs.fish.shellAliases = {
|
programs.fish.shellAliases = {
|
||||||
"cd" = lib.mkDefault "${pkgs.zoxide}/bin/zoxide";
|
"cd" = lib.mkDefault lib.getExe pkgs.zoxide;
|
||||||
"du" = lib.mkDefault "${pkgs.dua}/bin/dua";
|
"du" = lib.mkDefault lib.getExe pkgs.dua;
|
||||||
"ncdu" = lib.mkDefault "${pkgs.du-dust}/bin/du-dust";
|
"ncdu" = lib.mkDefault lib.getExe pkgs.du-dust;
|
||||||
"df" = lib.mkDefault "${pkgs.duf}/bin/duf";
|
"df" = lib.mkDefault lib.getExe pkgs.duf;
|
||||||
|
|
||||||
# Use eza (exa) instead of ls for fancier output
|
# Use eza (exa) instead of ls for fancier output
|
||||||
ls = "${pkgs.eza}/bin/eza --group";
|
ls = lib.mkDefault "${lib.getExe pkgs.eza} --group";
|
||||||
|
|
||||||
# Version of bash which works much better on the terminal
|
# Version of bash which works much better on the terminal
|
||||||
bash = "${pkgs.bashInteractive}/bin/bash";
|
bash = lib.mkDefault lib.getExe pkgs.bashInteractive;
|
||||||
};
|
};
|
||||||
|
|
||||||
config.nmasur.presets.bat.enable = lib.mkDefault true;
|
nmasur.presets = {
|
||||||
config.nmasur.presets.fd.enable = lib.mkDefault true;
|
bat.enable = lib.mkDefault true;
|
||||||
config.nmasur.presets.ripgrep.enable = lib.mkDefault true;
|
fd.enable = lib.mkDefault true;
|
||||||
config.nmasur.presets.prettyping.enable = lib.mkDefault true;
|
ripgrep.enable = lib.mkDefault true;
|
||||||
config.nmasur.presets.weather.enable = lib.mkDefault true;
|
prettyping.enable = lib.mkDefault true;
|
||||||
|
weather.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
config.nmasur.programs.wine.enable = lib.mkDefault true;
|
nmasur.programs.wine.enable = lib.mkDefault true;
|
||||||
|
|
||||||
home.packages = lib.mkDefault [
|
home.packages = lib.mkDefault [
|
||||||
pkgs.heroic
|
pkgs.heroic
|
||||||
|
@ -34,35 +34,40 @@ in
|
|||||||
pkgs.ipcalc # Make IP network calculations
|
pkgs.ipcalc # Make IP network calculations
|
||||||
pkgs.cloudflared # Allow connecting to Cloudflare tunnels
|
pkgs.cloudflared # Allow connecting to Cloudflare tunnels
|
||||||
pkgs.monitorcontrol # Allows adjusting external displays
|
pkgs.monitorcontrol # Allows adjusting external displays
|
||||||
(pkgs.writeShellApplication {
|
pkgs.ocr # Converts images to text
|
||||||
name = "ocr";
|
pkgs.aws-ec2 # Browse EC2 instances
|
||||||
runtimeInputs = [ pkgs.tesseract ];
|
pkgs.terraform-init # Quick shortcut for initializing Terraform backend
|
||||||
text = builtins.readFile ../../modules/common/shell/bash/scripts/ocr.sh;
|
|
||||||
})
|
|
||||||
(pkgs.writeShellApplication {
|
|
||||||
name = "ec2";
|
|
||||||
runtimeInputs = [
|
|
||||||
pkgs.awscli2
|
|
||||||
pkgs.jq
|
|
||||||
pkgs.fzf
|
|
||||||
];
|
|
||||||
text = builtins.readFile ../../modules/common/shell/bash/scripts/aws-ec2.sh;
|
|
||||||
})
|
|
||||||
(pkgs.writeShellApplication {
|
|
||||||
name = "tfinit";
|
|
||||||
runtimeInputs = [
|
|
||||||
pkgs.terraform
|
|
||||||
pkgs.gawk
|
|
||||||
pkgs.git
|
|
||||||
];
|
|
||||||
text = builtins.readFile ../../modules/common/shell/bash/scripts/terraform-init.sh;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.helix.enable = lib.mkDefault true;
|
programs.helix.enable = lib.mkDefault true;
|
||||||
programs.zed-editor.enable = lib.mkDefault true;
|
programs.zed-editor.enable = lib.mkDefault true;
|
||||||
|
|
||||||
config.nmasur.presets.programs.terraform.enable = lib.mkDefault true;
|
nmasur.presets = {
|
||||||
|
programs = {
|
||||||
|
_1password.enable = lib.mkDefault true;
|
||||||
|
atuin.enable = lib.mkDefault true;
|
||||||
|
bash.enable = lib.mkDefault true;
|
||||||
|
bat.enable = lib.mkDefault true;
|
||||||
|
direnv.enable = lib.mkDefault true;
|
||||||
|
dotfiles.enable = lib.mkDefault true;
|
||||||
|
fd.enable = lib.mkDefault true;
|
||||||
|
firefox.enable = lib.mkDefault true;
|
||||||
|
fish.enable = lib.mkDefault true;
|
||||||
|
fzf.enable = lib.mkDefault true;
|
||||||
|
git-work.enable = lib.mkDefault true;
|
||||||
|
git.enable = lib.mkDefault true;
|
||||||
|
github.enable = lib.mkDefault true;
|
||||||
|
jujutsu.enable = lib.mkDefault true;
|
||||||
|
k9s.enable = lib.mkDefault true;
|
||||||
|
kubectl.enable = lib.mkDefault true;
|
||||||
|
ldapsearch.enable = lib.mkDefault true;
|
||||||
|
ripgrep.enable = lib.mkDefault true;
|
||||||
|
starship.enable = lib.mkDefault true;
|
||||||
|
terraform.enable = lib.mkDefault true;
|
||||||
|
weather.enable = lib.mkDefault true;
|
||||||
|
wezterm.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
platforms/nix-darwin/default.nix
Normal file
4
platforms/nix-darwin/default.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports = lib.filesystem.listFilesRecursive ./.;
|
||||||
|
}
|
@ -14,6 +14,11 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
nmasur.presets = {
|
||||||
|
fish = lib.mkDefault true;
|
||||||
|
homebrew = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
homebrew.brews = lib.mkDefault [
|
homebrew.brews = lib.mkDefault [
|
||||||
"trash" # Delete files and folders to trash instead of rm
|
"trash" # Delete files and folders to trash instead of rm
|
||||||
];
|
];
|
||||||
|
@ -5,15 +5,17 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.nmasur.profiles.gaming;
|
cfg = config.nmasur.profiles.extra;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.profiles.gaming.enable = lib.mkEnableOption "extra config for macOS";
|
options.nmasur.profiles.extra.enable = lib.mkEnableOption "extra config for macOS";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
nmasur.profiles.base.enable = lib.mkDefault true;
|
||||||
|
|
||||||
homebrew.casks = lib.mkDefault [
|
homebrew.casks = lib.mkDefault [
|
||||||
"keybase" # GUI on Nix not available for macOS
|
"keybase" # GUI on Nix not available for macOS
|
||||||
];
|
];
|
||||||
|
@ -14,6 +14,8 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
nmasur.profiles.base.enable = lib.mkDefault true;
|
||||||
|
|
||||||
homebrew.casks = lib.mkDefault [
|
homebrew.casks = lib.mkDefault [
|
||||||
"steam" # Not packaged for Nixon macOS
|
"steam" # Not packaged for Nixon macOS
|
||||||
"epic-games" # Not packaged for Nix
|
"epic-games" # Not packaged for Nix
|
||||||
|
@ -13,6 +13,9 @@ in
|
|||||||
options.nmasur.profiles.work.enable = lib.mkEnableOption "work machine";
|
options.nmasur.profiles.work.enable = lib.mkEnableOption "work machine";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
nmasur.profiles.base.enable = lib.mkDefault true;
|
||||||
|
|
||||||
homebrew.casks = [
|
homebrew.casks = [
|
||||||
"1password" # 1Password will not launch from Nix on macOS
|
"1password" # 1Password will not launch from Nix on macOS
|
||||||
# "gitify" # Git notifications in menu bar (downgrade manually from 4.6.1)
|
# "gitify" # Git notifications in menu bar (downgrade manually from 4.6.1)
|
||||||
|
4
platforms/nixos/default.nix
Normal file
4
platforms/nixos/default.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports = lib.filesystem.listFilesRecursive ./.;
|
||||||
|
}
|
@ -10,7 +10,13 @@ in
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.services.lightdm.enable = lib.mkEnableOption "Lightdm display manager";
|
options.nmasur.presets.services.lightdm = {
|
||||||
|
enable = lib.mkEnableOption "Lightdm display manager";
|
||||||
|
wallpaper = {
|
||||||
|
type = lib.types.path;
|
||||||
|
description = "Wallpaper background image file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
@ -21,7 +27,7 @@ in
|
|||||||
displayManager = {
|
displayManager = {
|
||||||
lightdm = {
|
lightdm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
background = config.wallpaper;
|
background = cfg.wallpaper;
|
||||||
|
|
||||||
# Show default user
|
# Show default user
|
||||||
# Also make sure /var/lib/AccountsService/users/<user> has SystemAccount=false
|
# Also make sure /var/lib/AccountsService/users/<user> has SystemAccount=false
|
||||||
|
18
platforms/nixos/modules/nmasur/presets/services/logind.nix
Normal file
18
platforms/nixos/modules/nmasur/presets/services/logind.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.nmasur.presets.services.logind;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options.nmasur.presets.services.logind.enable = lib.mkEnableOption "Logind power key management";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Use power button to sleep instead of poweroff
|
||||||
|
services.logind.powerKey = "suspend";
|
||||||
|
services.logind.powerKeyLongPress = "poweroff";
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -15,21 +15,34 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# Allows us to declaritively set password
|
# Allows us to declaritively set password
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = lib.mkDefault false;
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.${config.user} = {
|
users.users.${config.user} = {
|
||||||
|
|
||||||
# Create a home directory for human user
|
# Create a home directory for human user
|
||||||
isNormalUser = true;
|
isNormalUser = lib.mkDefault true;
|
||||||
|
|
||||||
# Automatically create a password to start
|
# Automatically create a password to start
|
||||||
hashedPassword = config.passwordHash;
|
hashedPassword = lib.mkDefault config.passwordHash;
|
||||||
|
|
||||||
extraGroups = [
|
extraGroups = lib.mkDefault [
|
||||||
"wheel" # Sudo privileges
|
"wheel" # Sudo privileges
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Include home-manager config in NixOS
|
||||||
|
home-manager = {
|
||||||
|
sharedModules = [ ../../../../home-manager ];
|
||||||
|
|
||||||
|
# Use the system-level nixpkgs instead of Home Manager's
|
||||||
|
useGlobalPkgs = lib.mkDefault true;
|
||||||
|
|
||||||
|
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||||
|
# using multiple profiles for one user
|
||||||
|
useUserPackages = lib.mkDefault true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -15,24 +15,27 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
# Configure physical power buttons
|
||||||
|
nmasur.presets.services.logind.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Enable automatic timezone updates based on location
|
# Enable automatic timezone updates based on location
|
||||||
services.tzupdate.enable = true;
|
services.tzupdate.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Allow reading from Windows drives
|
# Allow reading from Windows drives
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
# Enable fstrim, which tracks free space on SSDs for garbage collection
|
# Enable fstrim, which tracks free space on SSDs for garbage collection
|
||||||
# More info: https://www.reddit.com/r/NixOS/comments/rbzhb1/if_you_have_a_ssd_dont_forget_to_enable_fstrim/
|
# More info: https://www.reddit.com/r/NixOS/comments/rbzhb1/if_you_have_a_ssd_dont_forget_to_enable_fstrim/
|
||||||
services.fstrim.enable = true;
|
services.fstrim.enable = lib.mkDefault true;
|
||||||
|
|
||||||
networking.useDHCP = !config.networking.networkmanager.enable;
|
networking.useDHCP = lib.mkDefault (!config.networking.networkmanager.enable);
|
||||||
|
|
||||||
networking.wireless = {
|
networking.wireless = {
|
||||||
# Enables wireless support via wpa_supplicant.
|
# Enables wireless support via wpa_supplicant.
|
||||||
enable = !config.networking.networkmanager.enable;
|
enable = lib.mkDefault (!config.networking.networkmanager.enable);
|
||||||
|
|
||||||
# Allows the user to control the WiFi settings.
|
# Allows the user to control the WiFi settings.
|
||||||
userControlled.enable = true;
|
userControlled.enable = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Wake up tempest with a command
|
# Wake up tempest with a command
|
||||||
@ -40,5 +43,25 @@ in
|
|||||||
(pkgs.writeShellScriptBin "wake-tempest" "${pkgs.wakeonlan}/bin/wakeonlan --ip=192.168.1.255 74:56:3C:40:37:5D")
|
(pkgs.writeShellScriptBin "wake-tempest" "${pkgs.wakeonlan}/bin/wakeonlan --ip=192.168.1.255 74:56:3C:40:37:5D")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Prevent wake from keyboard
|
||||||
|
powerManagement.powerDownCommands = lib.mkDefault ''
|
||||||
|
set +e
|
||||||
|
|
||||||
|
# Fix for Gigabyte motherboard
|
||||||
|
# /r/archlinux/comments/y7b97e/my_computer_wakes_up_immediately_after_i_suspend/isu99sr/
|
||||||
|
# Disable if enabled
|
||||||
|
if (grep "GPP0.*enabled" /proc/acpi/wakeup >/dev/null); then
|
||||||
|
echo GPP0 | ${pkgs.doas}/bin/doas tee /proc/acpi/wakeup
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
set -e
|
||||||
|
'';
|
||||||
|
services.udev.extraRules = lib.mkDefault ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ATTR{power/wakeup}="disabled"
|
||||||
|
ACTION=="add", SUBSYSTEM=="i2c", ATTR{power/wakeup}="disabled"
|
||||||
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
@ -15,38 +14,13 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
networking.firewall.allowPing = true;
|
networking.firewall.allowPing = lib.mkDefault true;
|
||||||
|
|
||||||
# Implement a simple fail2ban service for sshd
|
# Implement a simple fail2ban service for sshd
|
||||||
services.sshguard.enable = true;
|
services.sshguard.enable = lib.mkDefault true;
|
||||||
|
|
||||||
# Servers need a bootloader or they won't start
|
# Servers need a bootloader or they won't start
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = lib.mkDefault true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||||
|
|
||||||
# Use power button to sleep instead of poweroff
|
|
||||||
services.logind.powerKey = "suspend";
|
|
||||||
services.logind.powerKeyLongPress = "poweroff";
|
|
||||||
|
|
||||||
# Prevent wake from keyboard
|
|
||||||
powerManagement.powerDownCommands = ''
|
|
||||||
set +e
|
|
||||||
|
|
||||||
# Fix for Gigabyte motherboard
|
|
||||||
# /r/archlinux/comments/y7b97e/my_computer_wakes_up_immediately_after_i_suspend/isu99sr/
|
|
||||||
# Disable if enabled
|
|
||||||
if (grep "GPP0.*enabled" /proc/acpi/wakeup >/dev/null); then
|
|
||||||
echo GPP0 | ${pkgs.doas}/bin/doas tee /proc/acpi/wakeup
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
set -e
|
|
||||||
'';
|
|
||||||
services.udev.extraRules = ''
|
|
||||||
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ATTR{power/wakeup}="disabled"
|
|
||||||
ACTION=="add", SUBSYSTEM=="i2c", ATTR{power/wakeup}="disabled"
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
@ -9,12 +9,12 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# Replace config directory with our repo, since it sources from config on
|
# # Replace config directory with our repo, since it sources from config on
|
||||||
# every launch
|
# # every launch
|
||||||
system.activationScripts.configDir.text = ''
|
# system.activationScripts.configDir.text = ''
|
||||||
rm -rf /etc/nixos
|
# rm -rf /etc/nixos
|
||||||
ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos
|
# ln --symbolic --no-dereference --force ${config.dotfilesPath} /etc/nixos
|
||||||
'';
|
# '';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user