Initial commit

This commit is contained in:
Kiana Sheibani 2022-01-06 21:14:02 -05:00
commit c3fe1114b3
20 changed files with 885 additions and 0 deletions

89
config/config.nix Normal file
View file

@ -0,0 +1,89 @@
{ config, pkgs, nur,
nixpkgs, # The flake's input version of nixpkgs
... }:
let hashedPassword = "$6$lokU/kizIJ/HwEI8$N6c80K0.VHkFBaOMcS8Bc1Fz5bx8qqTRH8brf0.duTOkf4Mja90bLwki8IVCBVpHnj7WqEkF4.CtZA6WczeqQ1";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
restrict-eval = false
'';
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ nur.overlay ];
# Pin nixpkgs to the flake input
nix.registry.nixpkgs.flake = nixpkgs;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "kiana-pc"; # Define your hostname.
networking.wireless.enable = true;
networking.wireless.networks = {
"NETGEAR97".psk = "pastelcello694";
};
# Set your time zone.
time.timeZone = "America/New_York";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.opengl.enable = true;
users.mutableUsers = false;
users.users.kiana = {
isNormalUser = true;
description = "Kiana Sheibani";
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.fish;
inherit hashedPassword;
};
users.users.root = {
inherit hashedPassword;
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
ubuntu_font_family
(nerdfonts.override { fonts = [ "FiraCode" "Ubuntu" "UbuntuMono" ]; })
meslo-lgs-nf
];
fontconfig = {
enable = true;
defaultFonts = {
serif = [ "Noto Serif" ];
sansSerif = [ "Noto Sans" ];
monospace = [ "Meslo Nerd Font" ];
};
};
};
environment.sessionVariables.GTK_THEME = "Adwaita:dark";
# 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 = "21.11"; # Did you read the comment?
}

8
config/default.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
imports = [
./config.nix
./packages.nix
./login.nix
];
}

View file

@ -0,0 +1,29 @@
# 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 =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c8abae41-67ba-47b0-ab99-df5c152b4866";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C7D1-82A6";
fsType = "vfat";
};
swapDevices = [ ];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

25
config/login.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, pkgs, username, ... }:
{
environment.systemPackages = with pkgs; [
# Greeter
greetd.gtkgreet
# Window manager used to display the greeter
cage
];
services.greetd.enable = true;
services.greetd.settings = {
default_session = {
command = "cage -s -- gtkgreet";
user = "greeter";
};
};
environment.etc = {
"greetd/environments".text = ''
sway
fish
bash
'';
};
}

28
config/packages.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
ffmpeg
jq
git
wget
libnotify
ripgrep
unzip
tldr
pandoc
pamixer
screenfetch
gcc
rustup
idris2
wob
grim
slurp
imv
];
programs.sway.enable = true;
programs.sway.extraPackages = [];
}

64
flake.lock Normal file
View file

@ -0,0 +1,64 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1639329010,
"narHash": "sha256-k9OXwR06419/s0FAnRalUs24+8EI6GepGaatAXhBc+0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3d46c011d2cc2c9ca24d9b803e9daf156d9429ea",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1639347265,
"narHash": "sha256-q5feWoC64+h6T6J89o2HJJ8DOnB/4vwMODBlZIgeIlA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b0bf5f888d377dd2f36d90340df6dc9f035aaada",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nur": {
"locked": {
"lastModified": 1641513229,
"narHash": "sha256-lvYVhs8h58nwYCMq5uYl2rtyYikh0jVxk2HYeO+lEB0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "c10a58be01f9a26c954eae5afefbe0d58b3dfa18",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nur": "nur"
}
}
},
"root": "root",
"version": 7
}

38
flake.nix Normal file
View file

@ -0,0 +1,38 @@
{
description = "System conf";
inputs = rec {
nixpkgs.url = "nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self,
nixpkgs,
home-manager,
...}@inputs:
let
system = "x86_64-linux";
username = "kiana";
moduleArgs = inputs // { inherit system username; };
lib = nixpkgs.lib;
in {
nixosConfigurations = {
"kiana-pc" = lib.makeOverridable lib.nixosSystem {
inherit system;
modules = [
{ _module.args = moduleArgs; }
./config
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.kiana = import ./home-manager;
home-manager.extraSpecialArgs = moduleArgs;
}
];
};
};
};
}

16
home-manager/default.nix Normal file
View file

@ -0,0 +1,16 @@
{ config, pkgs, username, ... }:
{
home.username = username;
home.homeDirectory = "/home/" + username;
imports = [ ./shell ./wayland ];
xdg.enable = true;
xdg.userDirs.enable = true;
programs.git = {
enable = true;
userName = "kiana-S";
userEmail = "kiana.a.sheibani@gmail.com";
};
}

View file

@ -0,0 +1,48 @@
{ config, pkgs, ... }:
{
programs.alacritty = {
enable = true;
settings = {
background_opacity = 0.9;
# Based on the GNOME Dark theme
colors.primary = {
foreground = "#d0cfcc";
background = "#000000";
bright_foreground = "#ffffff";
};
colors.normal = {
black = "#171421";
red = "#c01c28";
green = "#26a269";
yellow = "#a2734c";
blue = "#12488b";
magenta = "#a347ba";
cyan = "#2aa1b3";
white = "#d0cfcc";
};
colors.bright = {
black = "#5e5c64";
red = "#f66151";
green = "#33d17a";
yellow = "#e9ad0c";
blue = "#2a7bde";
magenta = "#c061cb";
cyan = "#33c7de";
white = "#ffffff";
};
font =
let family = "FiraCode Nerd Font Mono";
font-style = style: { inherit family style; };
in {
normal = font-style "Regular";
bold = font-style "Bold";
italic = font-style "Italic";
bold_italic = font-style "Bold Italic";
size = 11;
};
};
};
}

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./alacritty.nix
./starship.nix
];
programs.fish.enable = true;
}

View file

@ -0,0 +1,23 @@
{ ... }:
{
programs.starship.enable = true;
programs.starship.settings = {
add_newline = true;
character =
let char = ""; charVi = "";
in {
success_symbol = "[${char}](bold green)";
error_symbol = "[${char}](bold red)";
vicmd_symbol = "[${charVi}](bold green)";
};
directory = {
truncation_length = 6;
truncation_symbol = " /";
read_only = " 🔒";
read_only_style = "cyan";
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View file

@ -0,0 +1,15 @@
{ ... }:
{
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
MOZ_USE_XINPUT2 = "1";
};
imports = [
./sway.nix
./swaylock.nix
./waybar.nix
./wofi.nix
./mako.nix
];
}

View file

@ -0,0 +1,38 @@
{ pkgs, ... }:
{
programs.mako = {
enable = true;
font = "UbuntuMono Light 11";
format = ''<i>%a</i>\n<b>%s</b>\n\n%b'';
layer = "overlay";
backgroundColor = "#111320d0";
width = 300;
margin = "5";
padding = "5,10";
borderSize = 2;
borderColor = "#04c2e8";
borderRadius = 5;
defaultTimeout = 10000;
extraConfig =
''
[urgency=low]
format=<i>%s</i>\n%b
background-color=#111111c0
border-color=#ffffff
border-size=1
[urgency=high]
background-color=#1e0909d0
border-color=#bf616a
border-size=4
default-timeout=0
ignore-timeout=1
[app-name=lightcord]
format=<b>%s</b>\n%b
border-color=#88c0d0
'';
};
}

View file

@ -0,0 +1,105 @@
{ pkgs, ... }:
let
modifier = "Mod1";
terminal = "alacritty";
bgimg = "What_Space_Really_Looks_Like_2880x1800.png";
in {
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
MOZ_USE_XINPUT2 = "1";
};
home.packages = with pkgs; [ swayidle wl-clipboard wlroots ];
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = {
inherit modifier terminal;
menu = "wofi --show drun";
fonts = {
names = [ "UbuntuMono" ];
style = "Medium";
size = 11.0;
};
bars = [{ command = "waybar"; }];
window.border = 1;
gaps = {
inner = 10;
outer = 5;
};
colors = {
unfocused.border = "#333333";
unfocused.background = "#000000a0";
unfocused.text = "#a0a0a0";
unfocused.indicator = "#2d292e";
unfocused.childBorder = "#333333";
focused.border = "#808080";
focused.background = "#000000";
focused.text = "#ffffff";
focused.indicator = "#2d292e";
focused.childBorder = "#ffffff";
focusedInactive.border = "#333333";
focusedInactive.background = "#000000";
focusedInactive.text = "#ffffff";
focusedInactive.indicator = "#4e4850";
focusedInactive.childBorder = "#333333";
urgent.border = "#000000";
urgent.background = "#900000";
urgent.text = "#ffffff";
urgent.indicator = "#900000";
urgent.childBorder = "#000000";
};
startup = map (x: { command = x; }) [
''~/.azotebg''
# Make wob channel
''mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob''
''swayidle timeout 120 'swaylock -f --grace=180' \
timeout 600 'systemctl suspend' \
before-sleep 'swaylock -f' ''
''export XDG_SESSION_TYPE=wayland''
''export XDG_CURRENT_DESKTOP=sway''
];
keybindings = let
# Display volume using wob
audio-disp = ''pamixer --get-volume > $SWAYSOCK.wob'';
audio = cmd: "exec pamixer ${cmd} && ${audio-disp}";
brightness-set = x: "exec brightnessctl set ${x}";
playerctl = cmd: "exec playerctl ${cmd}";
in pkgs.lib.mkOptionDefault {
"${modifier}+Shift+d" = ''exec wofi --show run'';
"${modifier}+Shift+l" = ''exec swaylock --grace=30'';
# Screenshot
"Print" = ''exec grim -o $(date +%Y-%m-%d_%H-%m-%s)'';
"Shift+Print" = ''exec grim -g "$(slurp)" -o $(date +%Y-%m-%d_%H-%m-%s)'';
"${modifier}+Print" = ''grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" -o $(date +%Y-%m-%d_%H-%m-%s)'';
# Special XF86 key bindings
"XF86AudioRaiseVolume" = audio "-ui 2";
"XF86AudioLowerVolume" = audio "-ud 2";
"XF86AudioMute" = ''exec pamixer --toggle-mute'';
"XF86AudioMicMute" = ''exec pactl set-source-mute @DEFAULT_SOURCE@ toggle'';
"XF86MonBrightnessDown" = brightness-set "5%-";
"XF86MonBrightnessUp" = brightness-set "+5%";
"XF86AudioPlay" = playerctl "play-pause";
"XF86AudioNext" = playerctl "next";
"XF86AudioPrev" = playerctl "previous";
};
output."*" = {
bg = "${./background/${bgimg}} fill";
};
};
};
}
# bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'

View file

@ -0,0 +1,35 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.swaylock-effects ];
xdg.configFile."swaylock/config".text =
''
ignore-empty-password
grace-no-mouse
fade-in=0.3
indicator
screenshots
font=Ubuntu
text-color=ffffff
color=00000000
ring-color=151fea
key-hl-color=6ecef4
line-uses-inside
indicator-radius=120
indicator-thickness=7
clock
datestr=%A, %e.%m.%Y
effect-scale=0.4
effect-vignette=0.3:0.7
effect-blur=2x2
'';
}

View file

@ -0,0 +1,234 @@
{ pkgs, ... }:
{
programs.waybar = {
enable = true;
settings = [{
height = 30;
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ];
modules-right = [ "pulseaudio" "network" "backlight" "idle_inhibitor" "clock" ];
modules = {
"sway/mode" = {
"format" = "<span style=\"italic\">{}</span>";
};
"mpd" = {
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) {songPosition}|{queueLength} ";
format-disconnected = "Disconnected ";
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
unknown-tag = "N/A";
interval = 2;
consume-icons.on = " ";
random-icons.off = "<span color=\"#f53c3c\"></span> ";
random-icons.on = " ";
repeat-icons.on = " ";
single-icons.on = "1 ";
state-icons.paused = "";
state-icons.playing = "";
tooltip-format = "MPD (connected)";
tooltip-format-disconnected = "MPD (disconnected)";
};
"idle_inhibitor" = {
format = "{icon}";
format-icons.activated = "";
format-icons.deactivated = "";
};
"tray" = {
# icon-size = 21;
spacing = 10;
};
"clock" = {
# timezone = "America/New_York";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = "{:%Y-%m-%d}";
};
"cpu" = {
format = " {usage}%";
tooltip = false;
};
"memory" = {
format = " {}%";
};
"temperature" = {
# thermal-zone = 2;
# hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
critical-threshold = 80;
# format-critical = "{temperatureC}°C {icon}";
format = "{icon} {temperatureC}°C";
format-icons = [ "" "" "" ];
};
"backlight" = {
# device = "acpi_video1";
format = "{percent}% {icon}";
format-icons = [ "" "" ];
};
"network" = {
# interface = "wlp2*"; # (Optional) To force the use of this interface
format-wifi = " {essid} <span foreground='#B0B0B0'>{signalStrength}%</span>";
format-ethernet = " wired";
format-disconnected = "disconnected";
tooltip-format = "{ifname} {ipaddr}";
tooltip-format-disconnected = "disconnected";
};
"pulseaudio" = {
# scroll-step = 1; # %, can be a float
format = "{icon} {volume}%";
format-bluetooth = "{icon} {volume}%";
format-bluetooth-muted = "{icon} 0%";
format-muted = "{icon} 0%";
format-icons.headphone = "";
format-icons.hands-free = "";
format-icons.headset = "";
format-icons.phone = "";
format-icons.portable = "";
format-icons.car = "";
format-icons.default = [ "" "" "" ];
on-click = "pamixer -t";
};
"custom/media" = {
format = "{icon} {}";
return-type = "json";
max-length = 40;
format-icons.spotify = "";
format-icons.default = "🎜";
escape = true;
};
};
}];
style =
''
* {
border: none;
border-radius: 0;
font-family: "UbuntuMono Nerd Font Mono", sans-serif;
font-size: 16px;
min-height: 0;
}
window#waybar {
background-color: rgba(0, 0, 0, 0.6);
color: #ffffff;
transition-property: background-color;
transition-duration: .2s;
padding: 5px 0;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #ffffff;
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -3px transparent;
}
#workspaces button:hover {
background: rgba(255, 255, 255, 0.1);
}
#workspaces button.focused {
background: rgba(255, 255, 255, 0.2);
box-shadow: inset 0 -3px #ffffff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0px 10px;
margin: 0px 16px 0px 0px;
}
#window,
#workspaces {
margin: 0 4px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#clock {
box-shadow: inset 0 -3px #0a6cf5;
}
#network {
box-shadow: inset 0 -3px #9f78ff;
}
#pulseaudio {
box-shadow: inset 0 -3px #5af78e;
}
#pulseaudio.muted {
box-shadow: inset 0 -3px #ff5c57;
}
label:focus {
background-color: #000000;
}
'';
};
}

View file

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.wofi ];
xdg.configFile.wofi.source = ./wofi;
}

View file

@ -0,0 +1,7 @@
width=100%
xoffset=0px
allow_images=true
image_size=20px
drun-display_generic=true
dynamic_lines=true
term=alacritty

View file

@ -0,0 +1,68 @@
window {
margin: 0px;
background-color: rgba(0, 0, 0, 0.6);
font-size: 1.2em;
font-family: "Ubuntu Mono";
}
#input {
color: white;
margin: 0px;
margin-right: 10px;
margin-left: 10px;
border: 0px;
border-bottom: 2px solid #eef279;
border-radius: 0px;
background-color: transparent;
}
#inner-box {
margin: 0px;
margin-right: 10px;
margin-left: 10px;
border-top: 2px solid transparent;
color: white;
background-color: transparent;
}
expander .entry {
margin-left: -15px;
}
#img {
margin-right: 6px;
}
#outer-box {
margin: 0px;
border: 0px solid;
background-color: transparent;
}
#scroll {
margin: 0px;
border: 0px solid;
background-color: transparent;
}
#entry{
padding: 1px;
padding-left: 4px;
padding-right: 4px;
margin: 0px;
}
#entry:selected{
background-color: #eef279;
color: #141414;
outline: 0px;
border-radius: 0px;
}
#text:selected{
background-color: #eef279;
color: #141414;
outline: 0px;
border-radius: 0px;
}