Initial commit

inky
Elnu 2 years ago
commit 3d0f689542

@ -0,0 +1,15 @@
alias v=`which vim`
git=`which git`
alias g=$git
alias ga="$git add"
alias gc="$git commit -m"
alias gu="ga . && gc" # u for update
alias gs="$git status"
alias gi="$git init"
alias gp="$git push"
alias gf="$git pull" # f for fetch
alias gC="$git clone"
alias goops="$git reset --soft HEAD^"
alias rm="trash-put"

@ -0,0 +1,138 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
user = "elnu";
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#<home-manager/nixos>
];
# Use the GRUB 2 boot loader.
boot.loader.grub = {
enable = true;
version = 2;
# efiSupport = true;
# efiInstallAsRemovable = true;
# efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
device = "/dev/sda"; # or "nodev" for efi only
};
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkbOptions in tty.
# };
# Enable the X11 windowing system.
services = {
xserver = {
enable = true;
displayManager = {
lightdm.enable = true;
#sddm.enable = true;
defaultSession = "none+i3";
};
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
};
};
};
# Configure keymap in X11
# services.xserver.layout = "us";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
nixpkgs.config.pulseaudio = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.${user} = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" "optical" "storage" ];
initialPassword = "password";
};
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.nixVersions.stable; # flakes
extraOptions = "experimental-features = nix-command flakes";
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
rustc
cargo
];
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
(nerdfonts.override { fonts = [ "FiraCode" ]; }) # required for icons
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
}

@ -0,0 +1,64 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1664783440,
"narHash": "sha256-KlMwR7mUf5h8MPnzV7nGFUAt6ih/euW5xgvZ5x+hwvI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e4e639dd4dc3e431aa5b5f95325f9a66ac7e0dd9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1664780719,
"narHash": "sha256-Oxe6la5dSqRfJogjtY4sRzJjDDqvroJIVkcGEOT87MA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
},
"utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,47 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager }:
let
user = "elnu";
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
elnu = lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = {
imports = [
./home.nix
./wallpaper.nix
./picom.nix
./i3.nix
./polybar/index.nix
./rofi/index.nix
./git.nix
./terminal.nix
];
};
}
];
};
};
};
}

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.git = {
package = pkgs.gitAndTools.gitFull;
enable = true;
userName = "ElnuDev";
userEmail = "elnu@elnu.com";
};
}

@ -0,0 +1,30 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s3.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
virtualisation.virtualbox.guest.enable = true;
}

@ -0,0 +1,48 @@
{ config, pkgs, ... }:
let
user = "elnu";
in
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home = {
# Home Manager needs a bit of information about you and the
# paths it should manage.
username = "${user}";
homeDirectory = "/home/${user}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "22.05";
packages = with pkgs; [
# Command line utilities
wget
neofetch
vim
ranger
trash-cli # aliased to rm in .bashrc
# GUI applications
firefox
];
file = {
".bashrc" = {
source = ./.bashrc;
};
};
sessionVariables = {
EDITOR = "vim";
};
};
}

@ -0,0 +1,34 @@
{ pkgs, lib, ... }:
let
mod = "Mod4";
in {
xsession.windowManager.i3 = {
enable = true;
config = {
modifier = mod;
gaps.inner = 12;
startup = [
{
command = "systemctl --user restart polybar";
always = true;
notification = false;
}
];
keybindings = lib.mkOptionDefault {
"${mod}+Return" = "exec kitty";
"Mod1+Q" = "exec /etc/profiles/per-user/elnu/bin/rofi-power";
};
keycodebindings = {
"133" = "--release exec rofi -show run -theme";
};
window.commands = [
{
command = "border pixel 0";
criteria = { class = "^.*"; };
}
];
bars = [];
};
};
}

@ -0,0 +1,7 @@
{ ... }:
{
services.picom = {
enable = true;
};
}

@ -0,0 +1,25 @@
{ pkgs, lib, fetchFromGitHub, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "aozora";
version = "5b94155b4137c885bd63bc49cd400ec58152547f";
buildInputs = with pkgs; [ openssl ];
nativeBuildInputs = with pkgs; [ pkg-config ];
src = fetchFromGitHub {
owner = "ElnuDev";
repo = pname;
rev = version;
sha256 = "93MP1Iw1eklC+IEQXAhzLHJ+qsDASm53qw7vUEtEstI=";
};
cargoSha256 = "fiDdk6c1rPS6L//KKqfp6ODxcLEzNKrpySCb9n8aGQ0=";
meta = with lib; {
description = "A simple CLI for fetching Plume Labs air quality info.";
homepage = "https://github.com/ElnuDev/aozora";
license = licenses.gpl3;
maintaners = [ maintainers.tailhook ];
};
}

@ -0,0 +1,135 @@
{ pkgs, lib, ... }:
{
# Dependencies
home.packages = with pkgs; [
(pkgs.callPackage ./aozora.nix { })
(pkgs.callPackage ./polybar-now-playing.nix { })
];
services.polybar = {
enable = true;
script = "polybar &";
package = pkgs.polybar.override {
i3GapsSupport = true;
alsaSupport = true;
};
config = {
"colors" = {
background = "#2e3440";
background-alt = "#3b4252";
foreground = "#eceff4";
primary = "#8fbcbb";
secondary = "#ff00ff"; # not sure what this does
alert = "#ff00ff"; # not sure what this does
disabled = "#434c5e";
};
"bar/top" = {
font-0 = "Noto Sans Mono;2";
font-1 = "Noto Sans CJK JP;2";
background = "\${colors.background}";
foreground = "\${colors.foreground}";
width = "100%";
height = "24pt";
line-size = "3pt";
padding-right = 1;
module-margin = 1;
separator = "|";
separator-foreground = "\${colors.disabled}";
cursor-click = "pointer";
cursor-scroll = "ns-resize";
modules-left = [
"xworkspaces"
"xwindow"
"now-playing"
];
modules-right = [
"aozora"
"filesystem"
"pulseaudio"
"memory"
"cpu"
"date"
];
};
"module/xworkspaces" = {
type = "internal/xworkspaces";
label-active-background = "\${colors.background-alt}";
label-active-underline = "\${colors.primary}";
label-active-padding-right = 1;
label-occupied-padding-right = 1;
label-urgent-background = "\${colors.alert}";
label-urgent-padding-right = 1;
label-empty-foreground = "\${colors.disabled}";
label-empty-padding-right = 1;
};
"module/xwindow" = {
type = "internal/xwindow";
};
"module/now-playing" = {
type = "custom/script";
tail = true;
format = "<label>";
exec = "/etc/profiles/per-user/elnu/bin/polybar-now-playing";
click-right = "kill -USR1 $(pgrep --oldest --parent %pid%)";
};
"module/aozora" = {
type = "custom/script";
format = "<label>";
# Wait a few seconds before running to prevent no internet error on first start
# TODO: make aozora wait blockingly for internet in --bar mode
exec = "/run/current-system/sw/bin/sleep 3 && /etc/profiles/per-user/elnu/bin/aozora air-quality-in-lakewood-aw-341300 --bar";
interval = 90;
};
"module/filesystem" = {
type = "internal/fs";
interval = 25;
mount-0 = "/";
label-mounted = "%{F#88c0d0}%mountpoint%%{F-} %percentage_used%%";
label-unmounted = "%mountpoint% not mounted";
label-unmounted-foreground = "\${colors.disabled}";
};
"module/pulseaudio" = {
type = "internal/pulseaudio";
format-volume-prefix = "VOL ";
format-volume-prefix-foreground = "\${colors.primary}";
label-muted = "muted";
label-muted-foreground = "\${colors.disabled}";
};
"module/memory" = {
type = "internal/memory";
interval = 2;
format-prefix = "RAM ";
format-prefix-foreground = "\${colors.primary}";
};
"module/cpu" = {
type = "internal/cpu";
interval = 2;
format-prefix = "CPU ";
format-prefix-foreground = "\${colors.primary}";
};
"module/date" = {
type = "internal/date";
internal = 1;
date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S";
label-foreground = "\${colors.primary}";
};
};
};
}

@ -0,0 +1,36 @@
{ pkgs, lib, fetchFromGitHub }:
with pkgs.python3Packages;
buildPythonPackage rec {
pname = "polybar-now-playing";
version = "c61658efeda178a842b03c558749169aa629f5a6";
# nativeBuildInputs = with pkgs; [ setuptools ];
propagatedBuildInputs = with pkgs; [ dbus-python ];
src = fetchFromGitHub {
owner = "d093w1z";
repo = pname;
rev = version;
sha256 = "DM4cVOWZiEJtBbGcA7PCuX2ZQMbNOj3AQX795ABBvOs=";
};
meta = with lib; {
description = "Script for polybar to display and control media(not only Spotify) using DBus. ";
homepage = "https://github.com/d093w1z/polybar-now-playing";
maintaners = [ maintainers.tailhook ];
};
preBuild = ''
cat > setup.py << 'EOF'
from setuptools import setup
setup (
name='polybar-now-playing',
author='d093w1z',
description='Script for polybar to display and control media(not only Spotify) using DBus. ',
install_requires=['dbus-python'],
scripts=['polybar-now-playing'],
)
EOF
'';
}

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
(pkgs.callPackage ./power.nix { })
];
programs.rofi = {
enable = true;
theme = "nord";
};
home.file.".config/rofi/nord.rasi" = {
source = ./nord.rasi;
};
}

@ -0,0 +1,142 @@
/**
* Nordic rofi theme
* Adapted by undiabler <undiabler@gmail.com>
*
* Nord Color palette imported from https://www.nordtheme.com/
*
*/
configuration {
font: "Noto Sans Mono 12";
width: 30;
line-margin: 10;
lines: 6;
columns: 2;
display-ssh: "";
display-run: "";
display-drun: "";
display-window: "";
display-combi: "";
show-icons: true;
}
* {
nord0: #2e3440;
nord1: #3b4252;
nord2: #434c5e;
nord3: #4c566a;
nord4: #d8dee9;
nord5: #e5e9f0;
nord6: #eceff4;
nord7: #8fbcbb;
nord8: #88c0d0;
nord9: #81a1c1;
nord10: #5e81ac;
nord11: #bf616a;
nord12: #d08770;
nord13: #ebcb8b;
nord14: #a3be8c;
nord15: #b48ead;
foreground: @nord9;
backlight: #ccffeedd;
background-color: transparent;
highlight: underline bold #eceff4;
transparent: rgba(46,52,64,0);
}
window {
location: center;
anchor: center;
transparency: "screenshot";
padding: 0px;
border: 0px;
border-radius: 0px;
background-color: @transparent;
spacing: 0;
children: [mainbox];
orientation: horizontal;
}
mainbox {
spacing: 0;
children: [ inputbar, message, listview ];
}
message {
color: @nord0;
padding: 5;
border-color: @foreground;
border: 0px 2px 2px 2px;
background-color: @nord7;
}
inputbar {
color: @nord6;
padding: 11px;
background-color: #3b4252;
border: 0px;
border-radius: 6px 6px 0px 0px;
border-color: @nord10;
}
entry, prompt, case-indicator {
text-font: inherit;
text-color:inherit;
}
prompt {
margin: 0px 0.3em 0em 0em ;
}
listview {
padding: 8px;
border-radius: 0px 0px 6px 6px;
border-color: @nord10;
border: 0;
background-color: rgba(46,52,64,0.9);
dynamic: false;
}
element {
padding: 3px;
vertical-align: 0.5;
border-radius: 4px;
background-color: transparent;
color: @foreground;
text-color: rgb(216, 222, 233);
}
element selected.normal {
background-color: @nord7;
text-color: #2e3440;
}
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
button {
padding: 6px;
color: @foreground;
horizontal-align: 0.5;
border: 2px 0px 2px 2px;
border-radius: 4px 0px 0px 4px;
border-color: @foreground;
}
button selected normal {
border: 2px 0px 2px 2px;
border-color: @foreground;
}

@ -0,0 +1,9 @@
{ substituteAll }:
substituteAll {
name = "rofi-power";
src = ./power.sh;
dir = "bin";
isExecutable = true;
}

@ -0,0 +1,33 @@
POWER_OFF=" Power Off"
REBOOT=" Reboot"
SUSPEND=" Suspend"
LOG_OUT=" Log out"
chosen=`printf "%s\n%s\n%s\n%s" "$POWER_OFF" "$REBOOT" "$SUSPEND" "$LOG_OUT" | rofi -dmenu -i -p ""`
case "$chosen" in
$POWER_OFF) action="power off" ;;
$REBOOT) action="reboot" ;;
$SUSPEND) action="suspend" ;;
$LOG_OUT) action="log out" ;;
*) exit 1 ;;
esac
confirm=`printf "Yes, %s" "$action"`
sure=`printf "%s\nNo, cancel" "$confirm" | rofi -dmenu -i -p "Are you sure"`
if [[ $sure != $confirm ]]; then
exit 1
fi
if [[ $chosen != $SUSPEND ]]; then
sh /home/elnu/scripts/graceful-shutdown/graceful_shutdown.sh
fi
case "$chosen" in
$POWER_OFF) sudo poweroff ;;
$REBOOT) sudo reboot ;;
$SUSPEND) sudo systemctl suspend ;;
$LOG_OUT) i3-msg exit ;;
*) exit 1 ;;
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
programs.kitty = {
enable = true;
theme = "Nord";
font = {
name = "Monospace Regular";
size = 12;
};
extraConfig = "enable_auto_bell 0\nconfirm_os_window_close 0";
};
}

@ -0,0 +1,7 @@
{ ... }:
{
home.file."./.background-image" = {
source = ./roxynord.png;
};
}
Loading…
Cancel
Save