Compare commits

...

6 Commits

6 changed files with 93 additions and 25 deletions

View File

@ -10,6 +10,8 @@
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
# script for rebuilding nixos
../../modules/nixos/rebuild.nix
# greetd login manager # greetd login manager
../../modules/nixos/greetd.nix ../../modules/nixos/greetd.nix
# sway as window manager # sway as window manager
@ -82,12 +84,9 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim
wget wget
fprintd fprintd
home-manager home-manager
git
alejandra
]; ];
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [

View File

@ -63,7 +63,7 @@
]; ];
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "${pkgs.neovim}/bin/nvim";
}; };
xdg.enable = true; xdg.enable = true;

View File

@ -80,7 +80,6 @@
{command = "${pkgs.keepassxc}/bin/keepassxc";} {command = "${pkgs.keepassxc}/bin/keepassxc";}
{command = "${pkgs.waybar}/bin/waybar";} {command = "${pkgs.waybar}/bin/waybar";}
{command = "${pkgs.foot}/bin/foot";} {command = "${pkgs.foot}/bin/foot";}
{command = "${pkgs.firefox}/bin/firefox";}
]; ];
}; };
}; };
@ -244,4 +243,29 @@
fuzzy-match = true fuzzy-match = true
''; '';
}; };
services.mako = {
enable = true;
actions = true;
anchor = "top-right";
backgroundColor = "#313131";
borderColor = "#00FFEE";
progressColor = "#338833";
textColor = "#e0e0e0";
extraConfig = ''
[urgency=low]
border-color=#008877
'';
borderRadius = 10;
borderSize = 2;
height = 100;
width = 400;
defaultTimeout = 10000; # ms
font = "FiraCode Nerd Font 11";
icons = true;
markup = true;
};
} }

View File

@ -10,26 +10,25 @@
historySubstringSearch.enable = true; historySubstringSearch.enable = true;
shellAliases = { shellAliases = {
ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first"; ls = "${pkgs.eza}/bin/eza --icons -a --group-directories-first";
diff = "diff --color=auto"; diff = "${pkgs.diffutils}/bin/diff --color=auto";
grep = "grep --color=auto"; grep = "${pkgs.gnugrep}/bin/grep --color=auto";
ip = "ip --color=auto"; ip = "${pkgs.iproute2}/bin/ip --color=auto";
mkdir = "mkdir -p"; mkdir = "${pkgs.coreutils}/bin/mkdir -p";
gst = "git status"; gst = "${pkgs.git}/bin/git status";
gc = "git commit"; gc = "${pkgs.git}/bin/git commit";
ga = "git add"; ga = "${pkgs.git}/bin/git add";
gpl = "git pull"; gpl = "${pkgs.git}/bin/git pull";
gpu = "git push"; gpu = "${pkgs.git}/bin/git push";
gd = "git diff"; gd = "${pkgs.git}/bin/git diff";
gch = "git checkout"; gch = "${pkgs.git}/bin/git checkout";
gs = "git switch"; gs = "${pkgs.git}/bin/git switch";
gre = "git restore"; gre = "${pkgs.git}/bin/git restore";
gr = "git remote"; gr = "${pkgs.git}/bin/git remote";
gcl = "git clone"; gcl = "${pkgs.git}/bin/git clone";
glg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"; glg = "${pkgs.git}/bin/git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
gb = "git branch"; gb = "${pkgs.git}/bin/git branch";
gm = "git merge"; gm = "${pkgs.git}/bin/git merge";
gf = "git fetch"; gf = "${pkgs.git}/bin/git fetch";
rebuild = "~/dotfiles/nixos/rebuild.sh";
}; };
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
syntaxHighlighting.highlighters = ["main" "brackets"]; syntaxHighlighting.highlighters = ["main" "brackets"];

45
modules/nixos/rebuild.nix Normal file
View File

@ -0,0 +1,45 @@
{pkgs, ...}: let
# script for rebuilding nixos
rebuild = pkgs.writeTextFile {
name = "rebuild";
destination = "/bin/rebuild";
executable = true;
text = ''
#!${pkgs.bash}/bin/bash
# A rebuild script that commits on a successful build
set -e
# cd to your config dir
pushd ~/dotfiles/nixos/
# Edit your config
$EDITOR
# Autoformat your nix files
${pkgs.alejandra}/bin/alejandra . #&>/dev/null
# Shows your changes
${pkgs.git}/bin/git diff -U0 *.nix
echo "NixOS Rebuilding..."
# Rebuild, output simplified errors, log trackebacks
${pkgs.sudo}/bin/sudo nixos-rebuild switch &>nixos-switch.log || (${pkgs.coreutils}/bin/cat nixos-switch.log | ${pkgs.gnugrep}/bin/grep --color error && false)
# Get current generation metadata
current=$(nixos-rebuild list-generations | ${pkgs.gnugrep}/bin/grep current)
# Commit all changes with the gereation metadata
${pkgs.git}/bin/git commit -am "$current"
# Back to where you were
popd
# Notify all OK!
${pkgs.libnotify}/bin/notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
'';
};
in {
environment.systemPackages = [rebuild];
}

View File

@ -48,6 +48,7 @@ in {
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin/stdout wl-clipboard # wl-copy and wl-paste for copy/paste from stdin/stdout
mako # notification system developed by swaywm maintainer mako # notification system developed by swaywm maintainer
wdisplays # tool to configure displays wdisplays # tool to configure displays
libnotify
]; ];
sound.enable = true; sound.enable = true;