Quickshell initial config

This commit is contained in:
xbazzi 2025-08-09 12:02:06 -06:00
parent 303f1e0710
commit 4948d71006
40 changed files with 1156 additions and 667 deletions

View File

@ -1,8 +1,11 @@
# Run with `nix-shell cuda-fhs.nix`
{ pkgs ? import <nixpkgs> {} }:
{
pkgs ? import <nixpkgs> { },
}:
(pkgs.buildFHSUserEnv {
name = "cuda-env";
targetPkgs = pkgs: with pkgs; [
targetPkgs =
pkgs: with pkgs; [
git
gitRepo
gnupg
@ -16,9 +19,16 @@
unzip
cudaPackages_12.cudatoolkit
linuxPackages.nvidia_x11
libGLU libGL
xorg.libXi xorg.libXmu freeglut
xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
libGLU
libGL
xorg.libXi
xorg.libXmu
freeglut
xorg.libXext
xorg.libX11
xorg.libXv
xorg.libXrandr
zlib
ncurses5
stdenv.cc
binutils

View File

@ -45,10 +45,16 @@
# };
};
outputs = { nixpkgs, lanzaboote, ... }@inputs:
outputs =
{ nixpkgs, lanzaboote, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; };
pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = true;
};
};
# configModule = {
# # Add any custom options (and do feel free to upstream them!)
# # options = { ... };
@ -63,7 +69,8 @@
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
pkgs.neovim pkgs.vim
pkgs.neovim
pkgs.vim
];
shellHook = ''
echo "hello"
@ -96,7 +103,9 @@
# ];
# }
({ pkgs, lib, ... }: {
(
{ pkgs, lib, ... }:
{
environment.systemPackages = [
# For debugging and troubleshooting Secure Boot.
@ -113,7 +122,8 @@
enable = true;
pkiBundle = "/var/lib/sbctl";
};
})
}
)
];
};
};

View File

@ -4,7 +4,8 @@
shellAliases =
let
flakePath = "~/nixos-config";
in {
in
{
la = "ls -lath";
lr = "ls -ltr";
rebuild = "sudo nixos-rebuild switch --flake ${flakePath}";

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
dconf = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
imports = [
@ -10,8 +16,10 @@
#./vscode.nix
./packages.nix
./hyprlock.nix
./waybar.nix
# ./waybar.nix
# ./dconf.nix
./quickshell.nix
./hyprpaper.nix
./git.nix
./hyprland.nix
./zsh.nix

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.git = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
gtk = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
home.username = "xbazzi";

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.hypridle = {

View File

@ -1,4 +1,9 @@
{ config, pkgs, inputs, ... }:
{
config,
pkgs,
inputs,
...
}:
{
wayland.windowManager.hyprland = {
@ -12,23 +17,41 @@
# "DP-3,addreserved,30,0,0,0"
];
bind =
[
# "$mod, k, exec, kitty"
# Mouse stuff (Ew... I know)
bindm = [
# Left click move
"$mod, mouse:272, movewindow"
# Left click resize
"ALT, mouse:272, resizewindow"
# "ALT CTRL, mouse:272, resizewindow 1"
];
binde = [
"$mod CTRL, h, resizeactive, -30 0"
"$mod CTRL, l, resizeactive, 30 0"
"$mod CTRL, j, resizeactive, 0 30"
"$mod CTRL, k, resizeactive, 0 -30"
];
bind = [
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod, q, killactive"
"$mod SHIFT, q, killactive"
"$mod, 0, layoutmsg, rollnext"
"$mod SHIFT, n, layoutmsg, cycleprev"
"$mod SHIFT, p, layoutmsg, cyclenext"
"$mod, f, fullscreen, 0"
"$mod, d, exec, wofi --show drun"
"$mod, t, exec, kitty --single-instance"
"$mod, c, exec, code"
"$mod SHIFT, l, movewindow, mon:-1"
"$mod SHIFT, h, movewindow, mon:+1"
@ -38,21 +61,18 @@
"$mod, e, exec, thunderbird"
"$mod, r, exec, kitty -- zsh -c 'exec yazi; exec zsh'"
"$mod, b, exec, kitty -- zsh -c 'btop; exec zsh'"
"$mod SHIFT, n, exec, kitty --start-as=normal -- zsh -ic 'code ~/nixos-config && exit'"
"$mod CTRL, n, exec, kitty --start-as=normal -- zsh -ic 'code ~/nixos-config && exit'"
"$mod, i, exec, brave"
"$mod, u, exec, kitty --start-as=normal -- zsh -ic 'home'"
"$mod, y, exec, kitty --start-as=normal -- zsh -ic 'repos'"
"$mod, s, togglespecialworkspace, special1"
"$mod, v, togglespecialworkspace, special2"
# "$mod, v, togglespecialworkspace, special2"
"$mod, p, swapwindow, l"
"$mod, p, layoutmsg, swapwithmaster"
# Mouse stuff (Ew... I know)
# "$mod, mouse:272, movewindow"
# "$mod, mouse:273, resizewindow"
# "ALT, mouse:272, resizewindow"
"$mod, v, togglefloating, active"
# Log out
# "$mod, -, exec, hyprctl dispatch exit"
@ -69,36 +89,51 @@
++ (
# workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (builtins.genList (i:
let ws = i + 1;
in [
builtins.concatLists (
builtins.genList (
i:
let
ws = i + 1;
in
[
"$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
) 9
)
9)
);
general = {
layout = "master";
};
windowrulev2 = [
"opacity 0.85, class:^(Code)$"
"opacity 0.85, class:^(kitty)$"
];
# layerrule = [
# "ignorealpha 0.1, title:^(Blur)$"
# ];
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
rounding = 5;
# active_opacity = 1.0;
# inactive_opacity = 1.0;
# rounding = 5;
blur = {
enabled = true;
size = 3;
size = 5;
passes = 2;
brightness = 1;
contrast = 1.4;
ignore_opacity = true;
contrast = 1.0;
ignore_opacity = false;
noise = 0;
new_optimizations = true;
xray = true;
# xray = true;
};
blurls = "^(popup|menu)$";
shadow = {
enabled = true;
@ -142,16 +177,16 @@
};
exec-once = [
"sleep 2 && waybar &"
# "sleep 2 && waybar &"
"hypridle &"
# "waybar &"
"eval $(gnome-keyring-daemon --start --components=secrets,ssh,gpg)"
# "hash dbus-update-activation-environment 2>/dev/null"
"dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
# "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"nm-applet &"
"poweralertd &"
# "nm-applet &"
# "poweralertd &"
# "wl-clip-persist --clipboard both &"
# "wl-paste --watch cliphist store &"
# "waybar &"

25
home/hyprpaper.nix Normal file
View File

@ -0,0 +1,25 @@
{
pkgs,
# inputs,
...
}:
{
home.packages = [
pkgs.hyprpaper
];
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
preload = [
"/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png"
];
wallpaper = [
",/home/xbazzi/Pictures/wallpapers/Fantasy-Landscape2.png"
];
};
};
}

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.kitty = lib.mkForce {
@ -10,8 +16,8 @@
enable_audio_bell = false;
mouse_hide_wait = "-1.0";
window_padding_width = 5;
background_opacity = "0.95";
background_blur = 5;
# background_opacity = "0.95";
# background_blur = 5;
background = "#17041c";
hide_window_decorations = true;
# themeFile = "Alucard";

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.neovim = {

View File

@ -6,7 +6,7 @@
tmux
# gnomeExtensions.appindicator
wofi
waybar
# waybar
# eww
# gnome-keyring
libsecret

64
home/quickshell.nix Normal file
View File

@ -0,0 +1,64 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.quickshell ];
# start it when Hyprland starts
wayland.windowManager.hyprland.settings.exec-once = [
"quickshell -c default"
];
# write the Quickshell config
xdg.configFile."quickshell/default/shell.qml".text = ''
import Quickshell
import Quickshell.Io
import QtQuick
// one window per screen
Variants {
model: Quickshell.screens
delegate: Component {
PanelWindow {
required property var modelData
screen: modelData
// top bar, full width
anchors.top: true
anchors.left: true
anchors.right: true
implicitHeight: 30 // tweak height if yuh want
Rectangle {
anchors.fill: parent
color: "#1a1a1a"
opacity: 0.92
}
// center clock
Text {
id: clock
anchors.centerIn: parent
font.pixelSize: 13
color: "#e6e6e6"
}
// update clock every second using `date`
Process {
id: dateProc
command: [ "date", "+%a %b %d %H:%M:%S" ]
running: true
stdout: StdioCollector {
onStreamFinished: clock.text = this.text.trim()
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}
}
}
'';
}

169
home/quickshell.nix.nope Normal file
View File

@ -0,0 +1,169 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
quickshell jq playerctl pamixer networkmanager # nmcli
coreutils gnugrep gawk
];
wayland.windowManager.hyprland.settings.exec-once = [
"quickshell -c default"
];
xdg.configFile."quickshell/default/shell.qml".text = ''
import Quickshell
import QtQuick
import QtQuick.Layouts
// ===== Helpers =====
function run(cmd) {
const p = Qt.createQmlObject('import Quickshell; Process { }', root);
p.command = cmd; p.running = true; return p;
}
function pipe(cmdArr, cb) {
const p = Qt.createQmlObject('import Quickshell; Process { stdout: StdioCollector{} }', root);
p.command = cmdArr; p.running = true;
p.stdout.onStreamFinished.connect(function() { cb(p.stdout.text.trim()); });
}
// ===== Window per monitor =====
Variants {
id: root
model: Quickshell.screens
delegate: Component {
PanelWindow {
required property var modelData
screen: modelData
anchors.top: true; anchors.left: true; anchors.right: true
implicitHeight: 30
layer: "top"
exclusiveZone: implicitHeight
Rectangle { anchors.fill: parent; color: "#121212"; opacity: 0.95; radius: 0 }
// ===== Layout =====
RowLayout {
anchors.fill: parent
anchors.margins: 8
spacing: 12
// ---- LEFT: Workspaces ----
Row {
id: wsRow
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
property int activeWs: 1
Repeater {
model: 10
delegate: Rectangle {
property int idx: index + 1
height: 18; width: 22; radius: 5
color: (wsRow.activeWs === idx) ? "#2e7d32" : "#1f1f1f"
border.width: 1
border.color: (wsRow.activeWs === idx) ? "#4caf50" : "#333333"
Text {
anchors.centerIn: parent
text: idx; color: "#eaeaea"; font.pixelSize: 11
}
MouseArea {
anchors.fill: parent
onClicked: run(["hyprctl","dispatch","workspace", String(idx)])
}
}
}
// active workspace poll
Timer {
interval: 500; running: true; repeat: true
onTriggered: pipe(["bash","-lc","hyprctl activeworkspace -j | jq -r .id"], function(t){
if (t !== "" && !isNaN(parseInt(t))) wsRow.activeWs = parseInt(t)
})
}
}
// ---- CENTER: Active window title ----
Item { Layout.fillWidth: true }
Text {
id: titleText
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
elide: Text.ElideRight; horizontalAlignment: Text.AlignHCenter
font.pixelSize: 12; color: "#dcdcdc"; text: "—"
width: parent.width * 0.40
}
Timer {
interval: 500; running: true; repeat: true
onTriggered: pipe(["bash","-lc","hyprctl activewindow -j | jq -r .title"], function(t){
titleText.text = (t && t !== "null") ? t : "—"
})
}
Item { Layout.fillWidth: true }
// ---- RIGHT: Media / Volume / Net / Battery / Clock ----
Row {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 10
// Media (playerctl)
Text {
id: media
font.pixelSize: 12; color: "#c0c0c0"; text: ""
width: 220; elide: Text.ElideRight
}
Timer {
interval: 1000; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"playerctl metadata --format '{{status}} {{artist}} - {{title}}' 2>/dev/null || true"
], function(t){ media.text = t })
}
// Volume (pamixer)
Text {
id: vol; font.pixelSize: 12; color: "#e0e0e0"; text: ""
MouseArea { anchors.fill: parent; onWheel: (wheel.angleDelta.y>0)
? run(["pamixer","-i","3"]) : run(["pamixer","-d","3"]) }
onPressed: run(["pamixer","-t"])
}
Timer {
interval: 800; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"if pamixer --get-mute; then echo ' Mute'; else echo \" $(pamixer --get-volume)%\"; fi"
], function(t){ vol.text = t })
}
// Network (nmcli)
Text {
id: net; font.pixelSize: 12; color: "#b0b0b0"; text: ""
MouseArea { anchors.fill: parent; onClicked: run(["nm-connection-editor"]) }
}
Timer {
interval: 2500; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"nmcli -t -f NAME,TYPE,DEVICE,STATE connection show --active | awk -F: 'NR==1{print $1\" (\"$2\")\"}' || true"
], function(t){ net.text = t || "offline" })
}
// Battery (upower/sysfs)
Text { id: bat; font.pixelSize: 12; color: "#b0e08a"; text: "" }
Timer {
interval: 3000; running: true; repeat: true
onTriggered: pipe(["bash","-lc",
"cap=$(cat /sys/class/power_supply/BAT*/capacity 2>/dev/null | head -n1); " +
"stat=$(cat /sys/class/power_supply/BAT*/status 2>/dev/null | head -n1); " +
"if [ -n \"$cap\" ]; then echo \"$stat $cap%\"; fi"
], function(t){ bat.text = t || "" })
}
// Clock
Text {
id: clock; font.pixelSize: 12; color: "#eeeeee"
}
Timer {
interval: 1000; running: true; repeat: true
onTriggered: pipe(["date","+%a %b %d %H:%M:%S"], function(t){ clock.text = t })
}
}
}
}
}
}
'';
}

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.starship = {

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
# Home Manager can also manage your environment variables through

View File

@ -1,4 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.vim = {

View File

@ -1,32 +1,32 @@
{ pkgs, ... }:
{
programs.waybar = {
enable = true;
# settings = [
# {
# main.modules-right = ["clock"];
# layer = "top";
# position = "top";
# modules-left = [ "hyprland/workspaces" "clock" ];
# modules-center = [ "window" ];
# modules-right = [ "battery" "pulseaudio" "network" ];
# }
# programs.waybar = {
# enable = true;
# # settings = [
# # {
# # main.modules-right = ["clock"];
# # layer = "top";
# # position = "top";
# # modules-left = [ "hyprland/workspaces" "clock" ];
# # modules-center = [ "window" ];
# # modules-right = [ "battery" "pulseaudio" "network" ];
# # }
# # ];
# # style = ''
# # * {
# # font-family: "JetBrainsMono Nerd Font", monospace;
# # font-size: 12px;
# # }
# # #workspaces button.active {
# # background-color: #ff5555;
# # }
# # '';
# # settings = [ ./waybar/config.jsonc ];
# settings = [
# (builtins.fromJSON (builtins.readFile ./waybar/config.json))
# ];
# style = ''
# * {
# font-family: "JetBrainsMono Nerd Font", monospace;
# font-size: 12px;
# }
# #workspaces button.active {
# background-color: #ff5555;
# }
# '';
# settings = [ ./waybar/config.jsonc ];
settings = [
(builtins.fromJSON (builtins.readFile ./waybar/config.json))
];
style = ./waybar/style.css;
};
}
# style = ./waybar/style.css;
# };
# }

View File

@ -27,10 +27,10 @@ window#waybar {
background: rgba(94, 129, 172, 0.5);
}
#clock, #cpu, #memory, #temperature, #pulseaudio, #network, #custom-windowtitle {
/* #clock, #cpu, #memory, #temperature, #pulseaudio, #network, #custom-windowtitle {
padding: 0 8px;
color: #eceff4;
}
} */
#tray {
padding-left: 6px;

View File

@ -1,6 +1,10 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
programs.zsh = {
@ -63,7 +67,11 @@
history.size = 10000;
history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history";
history.ignorePatterns = ["rm *" "pkill *" "cp *"];
history.ignorePatterns = [
"rm *"
"pkill *"
"cp *"
];
shellAliases =
let

View File

@ -6,30 +6,48 @@ let
# The fetchers. fetch_<type> fetches specs of type <type>.
#
fetch_file = pkgs: name: spec:
fetch_file =
pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
builtins_fetchurl {
inherit (spec) url sha256;
name = name';
}
else
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
pkgs.fetchurl {
inherit (spec) url sha256;
name = name';
};
fetch_tarball = pkgs: name: spec:
fetch_tarball =
pkgs: name: spec:
let
name' = sanitizeName name + "-src";
in
if spec.builtin or true then
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
builtins_fetchTarball {
name = name';
inherit (spec) url sha256;
}
else
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
pkgs.fetchzip {
name = name';
inherit (spec) url sha256;
};
fetch_git = name: spec:
fetch_git =
name: spec:
let
ref =
spec.ref or (
if spec ? branch then "refs/heads/${spec.branch}" else
if spec ? tag then "refs/tags/${spec.tag}" else
if spec ? branch then
"refs/heads/${spec.branch}"
else if spec ? tag then
"refs/tags/${spec.tag}"
else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"
);
submodules = spec.submodules or false;
@ -37,32 +55,38 @@ let
let
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
emptyArgWithWarning =
if submodules
then
builtins.trace
(
if submodules then
builtins.trace (
"The niv input \"${name}\" uses submodules "
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
+ "does not support them"
)
{ }
else { };
) { }
else
{ };
in
if nixSupportsSubmodules
then { inherit submodules; }
else emptyArgWithWarning;
if nixSupportsSubmodules then { inherit submodules; } else emptyArgWithWarning;
in
builtins.fetchGit
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
builtins.fetchGit (
{
url = spec.repo;
inherit (spec) rev;
inherit ref;
}
// submoduleArg
);
fetch_local = spec: spec.path;
fetch_builtin-tarball = name: throw
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
fetch_builtin-tarball =
name:
throw ''
[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=tarball -a builtin=true'';
fetch_builtin-url = name: throw
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
fetch_builtin-url =
name:
throw ''
[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
$ niv modify ${name} -a type=file -a builtin=true'';
#
@ -70,70 +94,89 @@ let
#
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
sanitizeName = name:
(
concatMapStrings (s: if builtins.isList s then "-" else s)
(
builtins.split "[^[:alnum:]+._?=-]+"
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
)
);
sanitizeName =
name:
(concatMapStrings (s: if builtins.isList s then "-" else s) (
builtins.split "[^[:alnum:]+._?=-]+" ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
));
# The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources: system:
mkPkgs =
sources: system:
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
sourcesNixpkgs = import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {
inherit system;
};
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in
if builtins.hasAttr "nixpkgs" sources
then sourcesNixpkgs
if builtins.hasAttr "nixpkgs" sources then
sourcesNixpkgs
else if hasNixpkgsPath && !hasThisAsNixpkgsPath then
import <nixpkgs> { }
else
abort
''
abort ''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
# The actual fetching function.
fetch = pkgs: name: spec:
fetch =
pkgs: name: spec:
if !builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else if spec.type == "file" then fetch_file pkgs name spec
else if spec.type == "tarball" then fetch_tarball pkgs name spec
else if spec.type == "git" then fetch_git name spec
else if spec.type == "local" then fetch_local spec
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
else if spec.type == "builtin-url" then fetch_builtin-url name
else if spec.type == "file" then
fetch_file pkgs name spec
else if spec.type == "tarball" then
fetch_tarball pkgs name spec
else if spec.type == "git" then
fetch_git name spec
else if spec.type == "local" then
fetch_local spec
else if spec.type == "builtin-tarball" then
fetch_builtin-tarball name
else if spec.type == "builtin-url" then
fetch_builtin-url name
else
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# If the environment variable NIV_OVERRIDE_${name} is set, then use
# the path directly as opposed to the fetched source.
replace = name: drv:
replace =
name: drv:
let
saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
if ersatz == "" then drv else
if ersatz == "" then
drv
else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
if builtins.substring 0 1 ersatz == "/" then
/. + ersatz
else
/. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist
mapAttrs = builtins.mapAttrs or (
f: set: with builtins;
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
mapAttrs =
builtins.mapAttrs or (
f: set:
with builtins;
listToAttrs (
map (attr: {
name = attr;
value = f attr set.${attr};
}) (attrNames set)
)
);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
range =
first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
@ -147,7 +190,12 @@ let
optionalAttrs = cond: as: if cond then as else { };
# fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
builtins_fetchTarball =
{
url,
name ? null,
sha256,
}@attrs:
let
inherit (builtins) lessThan nixVersion fetchTarball;
in
@ -157,7 +205,12 @@ let
fetchTarball attrs;
# fetchurl version that is compatible between all the versions of Nix
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
builtins_fetchurl =
{
url,
name ? null,
sha256,
}@attrs:
let
inherit (builtins) lessThan nixVersion fetchurl;
in
@ -167,26 +220,25 @@ let
fetchurl attrs;
# Create the final "sources" from the config
mkSources = config:
mapAttrs
(
mkSources =
config:
mapAttrs (
name: spec:
if builtins.hasAttr "outPath" spec
then
abort
"The values in sources.json should not have an 'outPath' attribute"
if builtins.hasAttr "outPath" spec then
abort "The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = replace name (fetch config.pkgs name spec); }
)
config.sources;
) config.sources;
# The "config" used by the fetchers
mkConfig =
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile)
, system ? builtins.currentSystem
, pkgs ? mkPkgs sources system
}: rec {
{
sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null,
sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile),
system ? builtins.currentSystem,
pkgs ? mkPkgs sources system,
}:
rec {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;

View File

@ -1,4 +1,3 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
@ -7,7 +6,8 @@ let
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
in
{
inherit imports;
nix.settings.substituters = [ "https://cache.nixos.org/" ];
}

View File

@ -1,4 +1,3 @@
{
nix = {
settings = {

View File

@ -5,12 +5,14 @@
{ config, pkgs, ... }:
{
imports =
[
imports = [
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# OpenRGB
services.hardware.openrgb.enable = true;
@ -18,7 +20,7 @@
# Hyprland
programs.hyprland.enable = true;
programs.hyprlock.enable = true;
programs.waybar.enable = true;
# programs.waybar.enable = true;
security.pam.services.hyprlock = { };
services.gnome.gnome-keyring.enable = true;
security.pam.services.hyprlock.enableGnomeKeyring = true;
@ -27,12 +29,12 @@
default_session = {
# GUI greeter
#command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c hyprland";
command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c 'Hyprland'";
# command = "${pkgs.greetd.gtkgreet}/bin/gtkgreet -c 'Hyprland'";
# TUI greeter
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember \
# --cmd 'dbus-run-session ${pkgs.hyprland}/bin/Hyprland'";
# user = "greeter";
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember \
--cmd 'dbus-run-session ${pkgs.hyprland}/bin/Hyprland'";
user = "greeter";
};
};
@ -43,7 +45,10 @@
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-hyprland ];
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
];
};
# Bootloader.
@ -53,7 +58,7 @@
boot.loader.efi.efiSysMountPoint = "/boot";
# systemd
systemd.network.wait-online.timeout = 10;
systemd.network.wait-online.timeout = 5;
# Set your time zone.
time.timeZone = "America/Denver";

View File

@ -1,8 +1,7 @@
{ config, pkgs, ... }:
{
imports =
[
imports = [
./configuration.nix
./fonts.nix
./ssh.nix

View File

@ -1,7 +1,9 @@
{ config, pkgs, ... }:
{
fonts.packages = with pkgs; [
fonts.packages =
with pkgs;
[
nerd-fonts.fira-code
nerd-fonts.sauce-code-pro
# nerd-fonts._Oxproto
@ -15,5 +17,6 @@
dina-font
proggyfonts
monaspace
] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
]
++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
}

View File

@ -8,7 +8,8 @@
# services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true;
environment.systemPackages = (with pkgs.gnomeExtensions; [
environment.systemPackages =
(with pkgs.gnomeExtensions; [
blur-my-shell
pop-shell
tactile
@ -18,7 +19,8 @@
pastafarian-holy-days
just-perfection
appindicator
]) ++ (with pkgs; [
])
++ (with pkgs; [
#vimix-cursors
# breeze-icons
tokyonight-gtk-theme
@ -26,4 +28,3 @@
# adwaita-icon-theme
]);
}

View File

@ -1,32 +1,50 @@
# 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, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d1210185-1181-47af-bebc-1b07ce66ad82";
fileSystems."/" = {
device = "/dev/disk/by-uuid/d1210185-1181-47af-bebc-1b07ce66ad82";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/F253-5DFF";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F253-5DFF";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [{
swapDevices = [
{
device = "/dev/disk/by-uuid/e2e8a734-702b-43a7-b645-cf239309b070";
}];
}
];
# 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

View File

@ -1,21 +1,28 @@
{ inputs, config, pkgs, ... }:
{
inputs,
config,
pkgs,
...
}:
{
# Enable networking
# networking.networkmanager.enable = true;
# systemd.services."NetworkManager-wait-online" = {
# serviceConfig.TimeoutStartSec = "20s";
# };
networking = {
useDHCP = false;
hostName = "nixos";
wireless.enable = false;
interfaces.enp6s0f0 = {
ipv4.addresses = [{
ipv4.addresses = [
{
address = "10.29.90.100";
prefixLength = 22;
}];
}
];
mtu = 9000;
};
defaultGateway = {

View File

@ -1,4 +1,9 @@
{ inputs, config, pkgs, ... }:
{
inputs,
config,
pkgs,
...
}:
{
# NVIDIA stuff

View File

@ -1,33 +1,34 @@
{ pkgs, lib, ... }:
{ }
{
# {
# OpenRGB
services.hardware.openrgb.enable = true;
# services.hardware.openrgb.enable = true;
# NO RGB
let
no-rgb = pkgs.writeScriptBin "no-rgb" ''
#!/bin/sh
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
# # NO RGB
# let
# no-rgb = pkgs.writeScriptBin "no-rgb" ''
# #!/bin/sh
# NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
for i in $(seq 0 $(($NUM_DEVICES - 1))); do
${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
done
'';
in {
config = {
services.udev.packages = [ pkgs.openrgb ];
boot.kernelModules = [ "i2c-dev" ];
hardware.i2c.enable = true;
# for i in $(seq 0 $(($NUM_DEVICES - 1))); do
# ${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
# done
# '';
# in {
# config = {
# services.udev.packages = [ pkgs.openrgb ];
# boot.kernelModules = [ "i2c-dev" ];
# hardware.i2c.enable = true;
systemd.services.no-rgb = {
description = "no-rgb";
serviceConfig = {
ExecStart = "${no-rgb}/bin/no-rgb";
Type = "oneshot";
};
wantedBy = [ "multi-user.target" ];
};
};
}
}
# systemd.services.no-rgb = {
# description = "no-rgb";
# serviceConfig = {
# ExecStart = "${no-rgb}/bin/no-rgb";
# Type = "oneshot";
# };
# wantedBy = [ "multi-user.target" ];
# };
# };
# }
# }

View File

@ -53,6 +53,7 @@
# firefox
direnv
jq
nixfmt
# Hyprland Ecosystem
hyprpaper

View File

@ -1,4 +1,3 @@
{ config, pkgs, ... }:
{

View File

@ -1,19 +1,25 @@
{ inputs, pkgs, lib, config, ... }:
{
inputs,
pkgs,
lib,
config,
...
}:
{
environment.systemPackages = with pkgs; [
(vscode-with-extensions.override {
vscodeExtensions = with vscode-extensions; [
vscodeExtensions =
with vscode-extensions;
[
redhat.vscode-yaml
redhat.ansible
bbenoist.nix
ms-python.python
ms-azuretools.vscode-docker
ms-vscode-remote.remote-ssh
golang.go
ms-vscode.cpptools
ms-vsliveshare.vsliveshare
bbenoist.nix
ms-python.python
vscodevim.vim
enkia.tokyo-night
@ -21,11 +27,14 @@
vscode-icons-team.vscode-icons
ms-vscode-remote.remote-containers
bmewburn.vscode-intelephense-client
jnoortheen.nix-ide
zxh404.vscode-proto3
twxs.cmake
# arrterian.nix-env-selector
# bbenoist.nix
mkhl.direnv
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";