[feat] Alejandra formatting

This commit is contained in:
uttarayan21
2024-03-21 21:35:51 +05:30
parent e8434fadf5
commit d5dc5a79d3
33 changed files with 699 additions and 589 deletions

View File

@@ -1,17 +1,22 @@
{ device, pkgs, ... }: { {
device,
pkgs,
...
}: {
programs.firefox = { programs.firefox = {
enable = device.isLinux; enable = device.isLinux;
profiles.default = { profiles.default = {
userChrome = userChrome = let
let csshacks = pkgs.fetchFromGitHub {
csshacks = pkgs.fetchFromGitHub { owner = "MrOtherGuy";
owner = "MrOtherGuy"; repo = "firefox-csshacks";
repo = "firefox-csshacks"; rev = "master";
rev = "master"; sha256 = "sha256-XJ+MTEADzOsCIh0I8EAxbtIpDHfMJsN68sKBy7/1l60=";
sha256 = "sha256-XJ+MTEADzOsCIh0I8EAxbtIpDHfMJsN68sKBy7/1l60="; };
}; in
in /*
/* css */ css
*/
'' ''
/* @import url(${csshacks}/chrome/toolbars_below_content.css); */ /* @import url(${csshacks}/chrome/toolbars_below_content.css); */
/* @import url(${csshacks}/chrome/scrollable_menupopups.css); */ /* @import url(${csshacks}/chrome/scrollable_menupopups.css); */
@@ -23,12 +28,11 @@
tridactyl tridactyl
]; ];
}; };
nativeMessagingHosts = [ pkgs.tridactyl-native ]; nativeMessagingHosts = [pkgs.tridactyl-native];
policies = { policies = {
ExtensionSettings = { ExtensionSettings = {
"uBlock0@raymondhill.net" = { "uBlock0@raymondhill.net" = {
install_url = install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed"; installation_mode = "force_installed";
}; };
}; };

View File

@@ -1,30 +1,31 @@
{ ... }: { {...}: {
imports = [ ../modules/goread.nix ]; imports = [../modules/goread.nix];
programs.goread = { programs.goread = {
enable = true; enable = true;
config = { config = {
urls = { urls = {
categories = [{ categories = [
name = "Rust"; {
desc = "Stuff related to the rust programming language"; name = "Rust";
subscriptions = [ desc = "Stuff related to the rust programming language";
{ subscriptions = [
name = "r/rust"; {
desc = "The rust subreddit"; name = "r/rust";
url = "https://old.reddit.com/r/rust/.rss"; desc = "The rust subreddit";
} url = "https://old.reddit.com/r/rust/.rss";
{ }
name = "thesquareplanet"; {
desc = "jonhoo's blog"; name = "thesquareplanet";
url = "https://thesquareplanet.com/feed.xml"; desc = "jonhoo's blog";
} url = "https://thesquareplanet.com/feed.xml";
{ }
name = "Jon Gjengset's Youtube"; {
desc = "jonhoo's youtube channel"; name = "Jon Gjengset's Youtube";
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ"; desc = "jonhoo's youtube channel";
} url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
]; }
} ];
}
{ {
name = "Nix"; name = "Nix";
desc = "Stuff related to the nix / nixos / nixlang"; desc = "Stuff related to the nix / nixos / nixlang";
@@ -35,9 +36,9 @@
url = "https://old.reddit.com/r/nixos/.rss"; url = "https://old.reddit.com/r/nixos/.rss";
} }
]; ];
}]; }
];
}; };
}; };
}; };
} }

View File

@@ -1,16 +1,26 @@
{ inputs, config, pkgs, lib, device, ... }: { {
imports = [ inputs,
inputs.nix-index-database.hmModules.nix-index config,
./tmux.nix pkgs,
./wezterm.nix lib,
./nvim.nix device,
./goread.nix ...
./ncmpcpp.nix }: {
# ./neomutt.nix imports =
] ++ lib.optionals device.isLinux [ ../linux ]; [
inputs.nix-index-database.hmModules.nix-index
./tmux.nix
./wezterm.nix
./nvim.nix
./goread.nix
./ncmpcpp.nix
# ./neomutt.nix
]
++ lib.optionals device.isLinux [../linux];
home.packages = with pkgs; home.packages = with pkgs;
[ [
sony-headphones-client
sd sd
go go
p7zip p7zip
@@ -38,7 +48,7 @@
macchina macchina
ripgrep ripgrep
fd fd
nixfmt alejandra
dust dust
cachix cachix
rustup rustup
@@ -48,11 +58,12 @@
nil nil
pkg-config pkg-config
lua-language-server lua-language-server
(nerdfonts.override { fonts = [ "Hasklig" ]; }) (nerdfonts.override {fonts = ["Hasklig"];})
pfetch-rs pfetch-rs
psst psst
abaddon abaddon
] ++ lib.optionals device.isLinux [ ]
++ lib.optionals device.isLinux [
mpv mpv
catppuccinThemes.gtk catppuccinThemes.gtk
catppuccinThemes.papirus-folders catppuccinThemes.papirus-folders
@@ -74,7 +85,8 @@
lsof lsof
wl-clipboard wl-clipboard
ncpamixer ncpamixer
] ++ lib.optionals device.isMac [ ]; ]
++ lib.optionals device.isMac [];
xdg.enable = true; xdg.enable = true;
xdg.userDirs = { xdg.userDirs = {
@@ -102,7 +114,7 @@
space.space = "file_picker"; space.space = "file_picker";
space.w = ":w"; space.w = ":w";
space.q = ":q"; space.q = ":q";
esc = [ "collapse_selection" "keep_primary_selection" ]; esc = ["collapse_selection" "keep_primary_selection"];
}; };
}; };
}; };
@@ -133,7 +145,7 @@
cat = "bat"; cat = "bat";
t = "tmux"; t = "tmux";
}; };
shellAliases = { g = "git"; }; shellAliases = {g = "git";};
shellInit = '' shellInit = ''
set fish_greeting set fish_greeting
yes | fish_config theme save "Catppuccin Mocha" yes | fish_config theme save "Catppuccin Mocha"
@@ -171,9 +183,10 @@
enable = true; enable = true;
enableFishIntegration = true; enableFishIntegration = true;
enableNushellIntegration = true; enableNushellIntegration = true;
settings = settings = let
let flavour = "mocha"; # Replace with your preferred palette flavour = "mocha"; # Replace with your preferred palette
in { in
{
# Check https://starship.rs/config/#prompt # Check https://starship.rs/config/#prompt
format = "$all$character"; format = "$all$character";
palette = "catppuccin_${flavour}"; palette = "catppuccin_${flavour}";
@@ -186,7 +199,8 @@
truncation_length = 4; truncation_length = 4;
style = "bold lavender"; style = "bold lavender";
}; };
} // builtins.fromTOML (builtins.readFile }
// builtins.fromTOML (builtins.readFile
(pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml)); (pkgs.catppuccinThemes.starship + /palettes/${flavour}.toml));
}; };
eza = { eza = {
@@ -213,14 +227,14 @@
}; };
bat = { bat = {
enable = true; enable = true;
config = { theme = "catppuccin"; }; config = {theme = "catppuccin";};
themes = { themes = {
catppuccin = { catppuccin = {
src = "${pkgs.catppuccinThemes.bat}/themes"; src = "${pkgs.catppuccinThemes.bat}/themes";
file = "Catppuccin Mocha.tmTheme"; file = "Catppuccin Mocha.tmTheme";
}; };
}; };
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ]; extraPackages = with pkgs.bat-extras; [batdiff batman batgrep batwatch];
}; };
rbw = { rbw = {
@@ -229,7 +243,9 @@
email = "uttarayan21@gmail.com"; email = "uttarayan21@gmail.com";
base_url = "https://pass.uttarayan.me"; base_url = "https://pass.uttarayan.me";
pinentry = pinentry =
if device.isMac then pkgs.pinentry_mac else pkgs.pinentry-gnome3; if device.isMac
then pkgs.pinentry_mac
else pkgs.pinentry-gnome3;
}; };
}; };
@@ -243,7 +259,7 @@
]; ];
}; };
home-manager = { enable = true; }; home-manager = {enable = true;};
}; };
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
@@ -251,10 +267,9 @@
home = { home = {
username = device.user; username = device.user;
homeDirectory = homeDirectory =
if device.isMac then if device.isMac
lib.mkForce "/Users/${device.user}" then lib.mkForce "/Users/${device.user}"
else else lib.mkForce "/home/${device.user}";
lib.mkForce "/home/${device.user}";
stateVersion = "23.11"; stateVersion = "23.11";
@@ -266,9 +281,11 @@
EDITOR = "nvim"; EDITOR = "nvim";
SHELL = "${pkgs.nushellFull}/bin/nu"; SHELL = "${pkgs.nushellFull}/bin/nu";
CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target"; CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target";
BROWSER = if device.isMac then "open" else "xdg-open"; BROWSER =
if device.isMac
then "open"
else "xdg-open";
}; };
sessionPath = [ "${config.home.homeDirectory}/.cargo/bin" ]; sessionPath = ["${config.home.homeDirectory}/.cargo/bin"];
}; };
} }

View File

@@ -1,15 +1,16 @@
{ pkgs, ... }: { {pkgs, ...}: {
programs.ncmpcpp = { programs.ncmpcpp = {
enable = true; enable = true;
bindings = pkgs.lib.attrsets.mapAttrsToList (key: value: { bindings =
key = key; pkgs.lib.attrsets.mapAttrsToList (key: value: {
command = value; key = key;
}) { command = value;
j = "scroll_down"; }) {
k = "scroll_up"; j = "scroll_down";
J = [ "select_item" "scroll_down" ]; k = "scroll_up";
K = [ "select_item" "scroll_up" ]; J = ["select_item" "scroll_down"];
}; K = ["select_item" "scroll_up"];
};
package = pkgs.ncmpcpp; package = pkgs.ncmpcpp;
}; };
} }

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
programs.neomutt = { programs.neomutt = {
enable = true; enable = true;
vimKeys = true; vimKeys = true;

View File

@@ -1,48 +1,45 @@
{ pkgs, ... }: { {pkgs, ...}: {
programs.newsboat = { programs.newsboat = {
enable = false; enable = false;
urls = [ urls = [
{ {
title = "r/rust"; title = "r/rust";
url = "https://www.reddit.com/r/rust/.rss"; url = "https://www.reddit.com/r/rust/.rss";
tags = [ "rust" ]; tags = ["rust"];
} }
{ {
title = "the square planet"; title = "the square planet";
url = "https://thesquareplanet.com/feed.xml"; url = "https://thesquareplanet.com/feed.xml";
tags = [ "rust" ]; tags = ["rust"];
} }
{ {
title = "Jon Gjengset's YouTube"; title = "Jon Gjengset's YouTube";
url = url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
"https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ"; tags = ["rust" "youtube"];
tags = [ "rust" "youtube" ];
} }
]; ];
extraConfig = extraConfig = let
let dracula = builtins.fetchurl {
dracula = builtins.fetchurl { url = "https://raw.githubusercontent.com/dracula/newsboat/main/newsboat";
url = "https://raw.githubusercontent.com/dracula/newsboat/main/newsboat"; sha256 = "sha256:08b00ilc5zk5fkzqqd6aghcpya3d00s9kvv65b8c50rg7ikm88xr";
sha256 = "sha256:08b00ilc5zk5fkzqqd6aghcpya3d00s9kvv65b8c50rg7ikm88xr"; };
}; in ''
in include ${dracula}
'' unbind-key g
include ${dracula} bind-key g home
unbind-key g unbind-key G
bind-key g home bind-key G end
unbind-key G
bind-key G end
unbind-key h unbind-key h
unbind-key j unbind-key j
unbind-key k unbind-key k
unbind-key l unbind-key l
bind-key h quit bind-key h quit
bind-key j down bind-key j down
bind-key k up bind-key k up
bind-key l open bind-key l open
''; '';
browser = "${pkgs.handlr-xdg}/bin/xdg-open"; browser = "${pkgs.handlr-xdg}/bin/xdg-open";
maxItems = 50; maxItems = 50;
autoReload = true; autoReload = true;

View File

@@ -1,5 +1,11 @@
{ pkgs, config, inputs, device, ... }: { {
imports = [ inputs.nixneovim.nixosModules.default ]; pkgs,
config,
inputs,
device,
...
}: {
imports = [inputs.nixneovim.nixosModules.default];
programs.nixneovim = { programs.nixneovim = {
enable = true; enable = true;
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
@@ -80,7 +86,9 @@
undofile = true; undofile = true;
}; };
globals = { mapleader = " "; }; globals = {
mapleader = " ";
};
plugins = { plugins = {
lspconfig = { lspconfig = {
enable = true; enable = true;
@@ -89,12 +97,14 @@
nil = { nil = {
enable = true; enable = true;
extraConfig = extraConfig =
/* lua */ # lua
'' ''
settings = { settings = {
['nil'] = { ['nil'] = {
formatting = { formatting = {
command = { "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" }, -- command = { "$\{pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" },
-- command = { "$\{pkgs.nixfmt}/bin/nixfmt" },
command = { "${pkgs.alejandra}/bin/alejandra" },
}, },
nix = { nix = {
flake = { flake = {
@@ -113,7 +123,7 @@
sqls = { sqls = {
enable = true; enable = true;
onAttachExtra = onAttachExtra =
/* lua */ # lua
'' ''
require('sqls').on_attach(client, bufnr) require('sqls').on_attach(client, bufnr)
''; '';
@@ -121,7 +131,7 @@
# rust-analyzer.enable = true; # rust-analyzer.enable = true;
}; };
extraLua.pre = extraLua.pre =
/* lua */ # lua
'' ''
local lsp_zero = require'lsp-zero' local lsp_zero = require'lsp-zero'
local lspconfig = require 'lspconfig' local lspconfig = require 'lspconfig'
@@ -163,7 +173,10 @@
enable = true; enable = true;
}; };
}; };
grammars = with pkgs.tree-sitter-grammars; [ tree-sitter-just tree-sitter-norg-meta ]; grammars = with pkgs.tree-sitter-grammars; [
tree-sitter-just
tree-sitter-norg-meta
];
installAllGrammars = true; installAllGrammars = true;
}; };
@@ -174,7 +187,6 @@
# cursorword.enable = true; # cursorword.enable = true;
starter.enable = true; starter.enable = true;
}; };
}; };
colorschemes = { colorschemes = {
catppuccin = { catppuccin = {
@@ -221,18 +233,21 @@
}; };
}; };
extraConfigLua = extraConfigLua = let
let codelldb =
codelldb = if device.isLinux then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter else null; if device.isLinux
liblldb = then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter
if device.isLinux then else null;
"${codelldb}/lldb/lib/liblldb.so" liblldb =
# else if device.isMac then if device.isLinux
# "${codelldb}/lldb/lib/liblldb.dylib" then "${codelldb}/lldb/lib/liblldb.so"
else null # else if device.isMac then
; # "${codelldb}/lldb/lib/liblldb.dylib"
in else null;
/* lua */ in
/*
lua
*/
'' ''
require'neotest'.setup({ require'neotest'.setup({
adapters = { adapters = {
@@ -276,7 +291,7 @@
vim.lsp.inlay_hint.enable(bufnr, true) vim.lsp.inlay_hint.enable(bufnr, true)
end end
end, end,
settings = function(project_root) settings = function(project_root)
local ra = require('rustaceanvim.config.server') local ra = require('rustaceanvim.config.server')
return ra.load_rust_analyzer_settings(project_root, { return ra.load_rust_analyzer_settings(project_root, {
settings_file_pattern = 'rust-analyzer.json' settings_file_pattern = 'rust-analyzer.json'
@@ -286,9 +301,8 @@
dap = { dap = {
autoload_configurations = false, autoload_configurations = false,
${pkgs.lib.optionalString device.isLinux '' ${pkgs.lib.optionalString device.isLinux ''
adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${liblldb}") adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${liblldb}")
'' ''}
}
}, },
} }
@@ -441,4 +455,3 @@
package = pkgs.neovim-nightly; package = pkgs.neovim-nightly;
}; };
} }

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: let
let
scratchpad = pkgs.writeShellScript "scratchpad" '' scratchpad = pkgs.writeShellScript "scratchpad" ''
width=''${2:-95%} width=''${2:-95%}
height=''${2:-95%} height=''${2:-95%}

View File

@@ -1,5 +1,5 @@
{ ... }: { {...}: {
imports = [ ../modules/tuifeed.nix ]; imports = [../modules/tuifeed.nix];
programs.tuifeed = { programs.tuifeed = {
enable = false; enable = false;
config = { config = {
@@ -10,5 +10,4 @@
}; };
}; };
}; };
} }

View File

@@ -1,8 +1,10 @@
{ pkgs, ... }: { {pkgs, ...}: {
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;
extraConfig = extraConfig =
/* lua */ /*
lua
*/
'' ''
local wezterm = require 'wezterm'; local wezterm = require 'wezterm';
return { return {

View File

@@ -1,12 +1,12 @@
{ pkgs, ... }: { {pkgs, ...}: {
imports = [ ./yabai.nix ./skhd.nix ]; imports = [./yabai.nix ./skhd.nix];
environment.systemPackages = with pkgs; [ nix neovim ]; environment.systemPackages = with pkgs; [nix neovim];
nix = { nix = {
settings = { settings = {
experimental-features = "nix-command flakes repl-flake"; experimental-features = "nix-command flakes repl-flake";
max-jobs = 8; max-jobs = 8;
trusted-users = [ "root" "fs0c131y" ]; trusted-users = ["root" "fs0c131y"];
}; };
extraOptions = '' extraOptions = ''
build-users-group = nixbld build-users-group = nixbld

View File

@@ -1,27 +1,35 @@
{ devices, inputs, overlays, home-manager, nix-darwin, ... }: {
devices,
inputs,
overlays,
home-manager,
nix-darwin,
...
}:
builtins.listToAttrs (builtins.map (device: { builtins.listToAttrs (builtins.map (device: {
name = device.name; name = device.name;
value = nix-darwin.lib.darwinSystem { value = nix-darwin.lib.darwinSystem {
system = device.system; system = device.system;
modules = [ modules = [
{ {
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
# nixpkgs.hostPlatform.config = device.system; # nixpkgs.hostPlatform.config = device.system;
} }
./configuration.nix ./configuration.nix
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
{ {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
inherit device; inherit device;
};
users.${device.user}.imports = [../common/home.nix];
}; };
users.${device.user}.imports = [ ../common/home.nix ]; }
}; ];
} };
]; })
}; devices)
}) devices)

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
services = { services = {
skhd = { skhd = {
enable = true; enable = true;

View File

@@ -1,4 +1,4 @@
{ ... }: { {...}: {
services = { services = {
yabai = { yabai = {
enable = true; enable = true;

157
flake.nix
View File

@@ -68,84 +68,85 @@
}; };
}; };
outputs = outputs = {
{ nixpkgs nixpkgs,
, home-manager home-manager,
, nix-darwin nix-darwin,
, flake-utils flake-utils,
, anyrun anyrun,
, nur nur,
, neovim-nightly-overlay neovim-nightly-overlay,
, ... ...
}@inputs: } @ inputs: let
let config_devices = [
config_devices = [ {
{ name = "mirai";
name = "mirai"; system = "x86_64-linux";
system = "x86_64-linux"; user = "fs0c131y";
user = "fs0c131y"; }
} {
{ name = "ryu";
name = "ryu"; system = "x86_64-linux";
system = "x86_64-linux"; user = "servius";
user = "servius"; isNix = true;
isNix = true; }
} {
{ name = "genzai";
name = "genzai"; system = "x86_64-linux";
system = "x86_64-linux"; user = "fs0c131y";
user = "fs0c131y"; }
} {
{ name = "Uttarayans-MacBook-Pro";
name = "Uttarayans-MacBook-Pro"; system = "aarch64-darwin";
system = "aarch64-darwin"; user = "fs0c131y";
user = "fs0c131y"; }
} {
{ name = "SteamDeck";
name = "SteamDeck"; system = "x86_64-linux";
system = "x86_64-linux"; user = "deck";
user = "deck"; }
} ];
];
mkDevice = { device }: { mkDevice = {device}: {
isLinux = !isNull (builtins.match ".*-linux" device.system); isLinux = !isNull (builtins.match ".*-linux" device.system);
isNix = isNix =
if (builtins.hasAttr "isNix" device) then device.isNix else false; if (builtins.hasAttr "isNix" device)
isMac = !isNull (builtins.match ".*-darwin" device.system); then device.isNix
system = device.system; else false;
name = device.name; isMac = !isNull (builtins.match ".*-darwin" device.system);
user = device.user; system = device.system;
}; name = device.name;
user = device.user;
devices =
builtins.map (device: mkDevice { inherit device; }) config_devices;
nixos_devices = builtins.filter (x: x.isNix) devices;
linux_devices = builtins.filter (x: x.isLinux) devices;
darwin_devices = builtins.filter (x: x.isMac) devices;
overlays = import ./overlays.nix {
inherit inputs;
};
in
{
nixosConfigurations =
let devices = nixos_devices;
in import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations =
let devices = darwin_devices;
in import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin;
};
homeConfigurations =
let devices = linux_devices;
in import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};
}; };
devices =
builtins.map (device: mkDevice {inherit device;}) config_devices;
nixos_devices = builtins.filter (x: x.isNix) devices;
linux_devices = builtins.filter (x: x.isLinux) devices;
darwin_devices = builtins.filter (x: x.isMac) devices;
overlays = import ./overlays.nix {inherit inputs;};
in {
nixosConfigurations = let
devices = nixos_devices;
in
import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations = let
devices = darwin_devices;
in
import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin;
};
homeConfigurations = let
devices = linux_devices;
in
import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};
};
} }

View File

@@ -1,5 +1,11 @@
{ inputs, pkgs, device, osConfig, ... }: { {
imports = [ inputs.anyrun.nixosModules.home-manager ]; inputs,
pkgs,
device,
osConfig,
...
}: {
imports = [inputs.anyrun.nixosModules.home-manager];
programs.anyrun = { programs.anyrun = {
enable = true; enable = true;
config = { config = {
@@ -15,10 +21,10 @@
symbols symbols
kidex kidex
]; ];
x = { fraction = 0.5; }; x = {fraction = 0.5;};
y = { fraction = 0.3; }; y = {fraction = 0.3;};
height = { absolute = 0; }; height = {absolute = 0;};
width = { absolute = 1000; }; width = {absolute = 1000;};
showResultsImmediately = true; showResultsImmediately = true;
maxEntries = 10; maxEntries = 10;
layer = "overlay"; layer = "overlay";
@@ -26,10 +32,12 @@
extraConfigFiles = { extraConfigFiles = {
"nixos-options.ron".text = let "nixos-options.ron".text = let
nixos-options = pkgs.lib.optionalString device.isNix nixos-options =
pkgs.lib.optionalString device.isNix
osConfig.system.build.manual.optionsJSON osConfig.system.build.manual.optionsJSON
+ "/share/doc/nixos/options.json"; + "/share/doc/nixos/options.json";
hm-options = inputs.home-manager.packages.${pkgs.system}.docs-json hm-options =
inputs.home-manager.packages.${pkgs.system}.docs-json
+ "/share/doc/home-manager/options.json"; + "/share/doc/home-manager/options.json";
# or alternatively if you wish to read any other documentation options, such as home-manager # or alternatively if you wish to read any other documentation options, such as home-manager
# get the docs-json package from the home-manager flake # get the docs-json package from the home-manager flake
@@ -41,8 +49,13 @@
# ":nall" = [nixos-options hm-options some-other-option]; # ":nall" = [nixos-options hm-options some-other-option];
# }; # };
options = builtins.toJSON ({ options = builtins.toJSON ({
":hm" = [ hm-options ]; ":hm" = [hm-options];
} // (if device.isNix then { ":nix" = [ nixos-options ]; } else { })); }
// (
if device.isNix
then {":nix" = [nixos-options];}
else {}
));
in '' in ''
Config( Config(
options: ${options}, options: ${options},
@@ -56,7 +69,9 @@
) )
''; '';
"websearch.ron".text = "websearch.ron".text =
/* ron */ /*
ron
*/
'' ''
Config( Config(
prefix: "?", prefix: "?",
@@ -85,12 +100,12 @@
"rink.ron".text = '' "rink.ron".text = ''
Config( Config(
currency: Some("${ currency: Some("${
builtins.toFile "currency.units" '' builtins.toFile "currency.units" ''
!category currencies "Currencies" !category currencies "Currencies"
usd USD usd USD
inr INR inr INR
'' ''
}"), }"),
) )
''; '';
}; };

View File

@@ -1,4 +1,10 @@
{ pkgs, device, nur, inputs, ... }: { {
pkgs,
device,
nur,
inputs,
...
}: {
imports = [ imports = [
../common/firefox.nix ../common/firefox.nix
../linux/hyprland.nix ../linux/hyprland.nix
@@ -9,7 +15,6 @@
../linux/mpd.nix ../linux/mpd.nix
]; ];
services.kdeconnect.enable = true; services.kdeconnect.enable = true;
services.kdeconnect.indicator = true; services.kdeconnect.indicator = true;
services.swayosd.enable = true; services.swayosd.enable = true;
@@ -19,10 +24,10 @@
}; };
systemd.user.services.spotify-player = { systemd.user.services.spotify-player = {
Install = { WantedBy = [ "graphical-session.target" ]; }; Install = {WantedBy = ["graphical-session.target"];};
Unit = { Unit = {
Description = "Spotify Player Daemon"; Description = "Spotify Player Daemon";
After = [ "graphical-session.target" ]; After = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${pkgs.spotify-player}/bin/spotify_player -d"; ExecStart = "${pkgs.spotify-player}/bin/spotify_player -d";

View File

@@ -1,17 +1,25 @@
{ devices, inputs, overlays, home-manager, ... }: {
devices,
inputs,
overlays,
home-manager,
...
}:
builtins.listToAttrs (builtins.map (device: { builtins.listToAttrs (builtins.map (device: {
name = device.user; name = device.user;
value = let value = let
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit overlays; inherit overlays;
system = device.system; system = device.system;
}; };
in home-manager.lib.homeManagerConfiguration { in
inherit pkgs; home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = { inherit pkgs;
inherit inputs; extraSpecialArgs = {
inherit device; inherit inputs;
}; inherit device;
modules = [ { nixpkgs.config.allowUnfree = true; } ../common/home.nix ]; };
}; modules = [{nixpkgs.config.allowUnfree = true;} ../common/home.nix];
}) devices) };
})
devices)

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
programs.foot = { programs.foot = {
enable = pkgs.stdenv.isLinux; enable = pkgs.stdenv.isLinux;
server.enable = true; server.enable = true;

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { {pkgs, ...}: {
gtk = { gtk = {
enable = true; enable = true;
theme = { theme = {
@@ -6,8 +6,8 @@
package = pkgs.catppuccin-gtk.override { package = pkgs.catppuccin-gtk.override {
variant = "mocha"; variant = "mocha";
size = "standard"; size = "standard";
accents = [ "mauve" ]; accents = ["mauve"];
tweaks = [ "normal" ]; tweaks = ["normal"];
}; };
}; };
@@ -20,11 +20,11 @@
}; };
cursorTheme = { cursorTheme = {
name = "Vanillay-DMZ"; name = "Vanillay-DMZ";
package = pkgs.vanilla-dmz; package = pkgs.vanilla-dmz;
}; };
gtk3.extraConfig = { gtk-application-prefer-dark-theme = 1; }; gtk3.extraConfig = {gtk-application-prefer-dark-theme = 1;};
gtk4.extraConfig = { gtk-application-prefer-dark-theme = 1; }; gtk4.extraConfig = {gtk-application-prefer-dark-theme = 1;};
}; };
} }

View File

@@ -1,18 +1,22 @@
{ pkgs, inputs, ... }: { {
imports = [ ../modules/hyprpaper.nix inputs.hyprlock.homeManagerModules.hyprlock ]; pkgs,
inputs,
...
}: {
imports = [../modules/hyprpaper.nix inputs.hyprlock.homeManagerModules.hyprlock];
programs.hyprpaper = programs.hyprpaper = let
let wallpapers = import ../utils/wallhaven.nix { inherit pkgs; }; wallpapers = import ../utils/wallhaven.nix {inherit pkgs;};
in { in {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
systemd.target = "hyprland-session.target"; systemd.target = "hyprland-session.target";
settings.preload = wallpapers.all; settings.preload = wallpapers.all;
settings.wallpapers = { settings.wallpapers = {
"DP-3" = wallpapers.frieren_3; "DP-3" = wallpapers.frieren_3;
"DP-1" = wallpapers.shapes; "DP-1" = wallpapers.shapes;
};
}; };
};
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
}; };

View File

@@ -1,5 +1,9 @@
{ inputs, pkgs, ... }: { {
imports = [ inputs.ironbar.homeManagerModules.default ]; inputs,
pkgs,
...
}: {
imports = [inputs.ironbar.homeManagerModules.default];
programs.ironbar = { programs.ironbar = {
enable = true; enable = true;
config.monitors = { config.monitors = {
@@ -8,11 +12,11 @@
start = [ start = [
{ {
type = "launcher"; type = "launcher";
favourites = [ "firefox" "discord" ]; favourites = ["firefox" "discord"];
show_names = false; show_names = false;
show_icons = true; show_icons = true;
} }
{ type = "focused"; } {type = "focused";}
]; ];
end = [ end = [
{ {
@@ -25,7 +29,7 @@
type = "music"; type = "music";
player_type = "mpris"; player_type = "mpris";
} }
{ type = "clock"; } {type = "clock";}
]; ];
}; };
DP-3 = { DP-3 = {
@@ -46,25 +50,27 @@
# networks= 3; # networks= 3;
}; };
} }
{ type = "tray"; } {type = "tray";}
];
start = [
{
type = "workspaces";
name_map = {
"1" = "icon:foot";
"2" = "icon:code";
"3" = "icon:firefox";
"4" = "icon:slack";
"5" = "icon:steam";
"6" = "icon:misc";
"7" = "icon:misc";
"8" = "icon:firefox";
"9" = "icon:discord";
"10" = "icon:spotify";
};
favorites = ["1" "2" "3" "4" "5" "6" "7" "8" "9" "10"];
all_monitors = true;
}
]; ];
start = [{
type = "workspaces";
name_map = {
"1" = "icon:foot";
"2" = "icon:code";
"3" = "icon:firefox";
"4" = "icon:slack";
"5" = "icon:steam";
"6" = "icon:misc";
"7" = "icon:misc";
"8" = "icon:firefox";
"9" = "icon:discord";
"10" = "icon:spotify";
};
favorites = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ];
all_monitors = true;
}];
}; };
}; };
style = let style = let
@@ -79,6 +85,7 @@
sha256 = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw"; sha256 = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw";
}; };
mocha = builtins.readFile "${catppuccin}/mocha.css"; mocha = builtins.readFile "${catppuccin}/mocha.css";
in mocha + builtins.readFile ./ironbar.css; in
mocha + builtins.readFile ./ironbar.css;
}; };
} }

View File

@@ -1,4 +1,8 @@
{ pkgs, config, ... }: { {
pkgs,
config,
...
}: {
services.mpd = { services.mpd = {
enable = true; enable = true;
}; };

View File

@@ -1,14 +1,17 @@
{ pkgs, config, lib, ... }: {
with lib; pkgs,
let config,
lib,
...
}:
with lib; let
cfg = config.programs.goread; cfg = config.programs.goread;
# configDir = # configDir =
# if pkgs.stdenv.isDarwin then # if pkgs.stdenv.isDarwin then
# "${config.home.homeDirectory}Library/Application Support/goread" # "${config.home.homeDirectory}Library/Application Support/goread"
# else # else
# "${config.xdg.configHome}/goread"; # "${config.xdg.configHome}/goread";
in in {
{
options = { options = {
programs.goread = { programs.goread = {
enable = mkEnableOption "goread - a terminal RSS/Atom reader"; enable = mkEnableOption "goread - a terminal RSS/Atom reader";
@@ -16,17 +19,17 @@ in
config = with types; { config = with types; {
urls = mkOption { urls = mkOption {
type = attrsOf (listOf attrs); type = attrsOf (listOf attrs);
default = { }; default = {};
description = '' description = ''
Urls that will be fetched ~/.config/goread/urls.yml Urls that will be fetched ~/.config/goread/urls.yml
''; '';
example = { }; example = {};
}; };
colorscheme = mkOption { colorscheme = mkOption {
type = attrsOf str; type = attrsOf str;
default = { }; default = {};
example = { }; example = {};
description = '' description = ''
Colorscheme that will be fetched ~/.config/goread/colorscheme.json Colorscheme that will be fetched ~/.config/goread/colorscheme.json
''; '';
@@ -36,12 +39,11 @@ in
}; };
config = { config = {
home.packages = mkIf cfg.enable [ pkgs.goread ]; home.packages = mkIf cfg.enable [pkgs.goread];
xdg.configFile = mkIf cfg.enable { xdg.configFile = mkIf cfg.enable {
"goread/urls.yml".text = generators.toYAML { } cfg.config.urls; "goread/urls.yml".text = generators.toYAML {} cfg.config.urls;
# "goread/colorscheme.json".text = lib.generators.toJSON cfg.config.colorscheme; # "goread/colorscheme.json".text = lib.generators.toJSON cfg.config.colorscheme;
}; };
}; };
} }

View File

@@ -1,8 +1,11 @@
{ pkgs, config, lib, ... }: {
pkgs,
with lib; config,
lib,
let cfg = config.programs.hyprpaper; ...
}:
with lib; let
cfg = config.programs.hyprpaper;
in { in {
options = { options = {
programs.hyprpaper = { programs.hyprpaper = {
@@ -24,17 +27,17 @@ in {
settings = with types; { settings = with types; {
preload = mkOption { preload = mkOption {
type = listOf path; type = listOf path;
default = [ ]; default = [];
description = '' description = ''
Wallpaper images that should be preloaded into memory Wallpaper images that should be preloaded into memory
''; '';
example = [ ./wallpapers/tensura.png ]; example = [./wallpapers/tensura.png];
}; };
wallpapers = mkOption { wallpapers = mkOption {
type = attrsOf str; type = attrsOf str;
default = { }; default = {};
example = { "DP-1" = ./wallpapers/tensura.png; }; example = {"DP-1" = ./wallpapers/tensura.png;};
description = '' description = ''
Wallpaper to monitor mapper Wallpaper to monitor mapper
''; '';
@@ -43,8 +46,7 @@ in {
extraConfig = mkOption { extraConfig = mkOption {
type = str; type = str;
default = ""; default = "";
description = description = "Check https://github.com/hyprwm/hyprpaper#usage for info";
"Check https://github.com/hyprwm/hyprpaper#usage for info";
example = '' example = ''
newConfigOption = foo,bar newConfigOption = foo,bar
''; '';
@@ -54,14 +56,14 @@ in {
}; };
config = { config = {
home.packages = mkIf cfg.enable [ pkgs.hyprpaper ]; home.packages = mkIf cfg.enable [pkgs.hyprpaper];
systemd.user.services.hyprpaper = mkIf cfg.systemd.enable { systemd.user.services.hyprpaper = mkIf cfg.systemd.enable {
Unit = { Unit = {
Description = "autostart service for Hyprpaper"; Description = "autostart service for Hyprpaper";
Documentation = "https://github.com/hyprwm/hyprpaper"; Documentation = "https://github.com/hyprwm/hyprpaper";
BindsTo = [ "graphical-session.target" ]; BindsTo = ["graphical-session.target"];
After = [ "graphical-session-pre.target" ]; After = ["graphical-session-pre.target"];
}; };
Service = { Service = {
@@ -71,7 +73,7 @@ in {
KillMode = "mixed"; KillMode = "mixed";
}; };
Install = { WantedBy = [ cfg.systemd.target ]; }; Install = {WantedBy = [cfg.systemd.target];};
}; };
xdg.configFile = mkIf cfg.enable { xdg.configFile = mkIf cfg.enable {
@@ -80,16 +82,19 @@ in {
# hyprpaper.settings.preload # hyprpaper.settings.preload
${(lists.foldl (acc: v: ${(lists.foldl (acc: v:
acc + '' acc
+ ''
preload = ${v} preload = ${v}
'') "" cfg.settings.preload)} '') ""
cfg.settings.preload)}
# hyprpaper.settings.wallpapers # hyprpaper.settings.wallpapers
${(lists.foldl (acc: v: ${(lists.foldl (acc: v:
acc + '' acc
+ ''
wallpaper = ${v} wallpaper = ${v}
'') "" (pkgs.lib.attrsets.mapAttrsToList (name: val: name + "," + val) '') "" (pkgs.lib.attrsets.mapAttrsToList (name: val: name + "," + val)
cfg.settings.wallpapers))} cfg.settings.wallpapers))}
# hyprpaper.settings.extraConfig # hyprpaper.settings.extraConfig
${cfg.settings.extraConfig} ${cfg.settings.extraConfig}

View File

@@ -1,12 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.programs.tuifeed;
tomlFormat = pkgs.formats.toml { };
in
{ {
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.programs.tuifeed;
tomlFormat = pkgs.formats.toml {};
in {
options = { options = {
programs.tuifeed = { programs.tuifeed = {
enable = mkEnableOption "tuifeed - a terminal RSS/Atom reader"; enable = mkEnableOption "tuifeed - a terminal RSS/Atom reader";
@@ -14,11 +15,11 @@ in
config = with types; { config = with types; {
sources = mkOption { sources = mkOption {
type = attrsOf str; type = attrsOf str;
default = { }; default = {};
description = '' description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml Urls that will be fetched ~/.config/tuifeed/urls.yml
''; '';
example = { }; example = {};
}; };
article_title = mkOption { article_title = mkOption {
@@ -30,15 +31,14 @@ in
description = '' description = ''
Urls that will be fetched ~/.config/tuifeed/urls.yml Urls that will be fetched ~/.config/tuifeed/urls.yml
''; '';
example = { }; example = {};
}; };
}; };
}; };
}; };
config = { config = {
home.packages = mkIf cfg.enable [ pkgs.tuifeed ]; home.packages = mkIf cfg.enable [pkgs.tuifeed];
xdg.configFile = mkIf cfg.enable { xdg.configFile = mkIf cfg.enable {
"tuifeed/config.toml".source = tomlFormat.generate "tuifeed-config" { "tuifeed/config.toml".source = tomlFormat.generate "tuifeed-config" {
@@ -46,6 +46,5 @@ in
"article-title" = cfg.config.article_title; "article-title" = cfg.config.article_title;
}; };
}; };
}; };
} }

View File

@@ -1,7 +1,11 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ pkgs, device, ... }: { {
pkgs,
device,
...
}: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./ryu.nix ./ryu.nix
@@ -28,24 +32,20 @@
}; };
boot.plymouth.enable = true; boot.plymouth.enable = true;
boot.plymouth.theme = "catppuccin-mocha"; boot.plymouth.theme = "catppuccin-mocha";
boot.plymouth.themePackages = with pkgs; boot.plymouth.themePackages = with pkgs; [(catppuccin-plymouth.override {variant = "mocha";})];
[ (catppuccin-plymouth.override { variant = "mocha"; }) ];
services.greetd = services.greetd = let
let tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; hyprland-session = "${pkgs.hyprland}/share/wayland-sessions";
hyprland-session = "${pkgs.hyprland}/share/wayland-sessions"; in {
in enable = true;
{ settings = {
enable = true; default_session = {
settings = { command = "${tuigreet} --time --remember --remember-session --sessions ${hyprland-session}";
default_session = { user = "greeter";
command =
"${tuigreet} --time --remember --remember-session --sessions ${hyprland-session}";
user = "greeter";
};
}; };
}; };
};
systemd.services.greetd.serviceConfig = { systemd.services.greetd.serviceConfig = {
Type = "idle"; Type = "idle";
@@ -87,11 +87,10 @@
boot.bootspec.enable = true; boot.bootspec.enable = true;
networking.hostName = "ryu"; # Define your hostname. networking.hostName = "ryu"; # Define your hostname.
networking.nameservers = [ "1.1.1.1" "8.8.8.8" ]; networking.nameservers = ["1.1.1.1" "8.8.8.8"];
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
services.udev.packages = services.udev.packages = [pkgs.yubikey-personalization pkgs.yubikey-personalization-gui];
[ pkgs.yubikey-personalization pkgs.yubikey-personalization-gui ];
services.yubikey-agent.enable = true; services.yubikey-agent.enable = true;
# Configure network proxy if necessary # Configure network proxy if necessary
@@ -104,7 +103,7 @@
# Set your time zone. # Set your time zone.
time.timeZone = "Asia/Kolkata"; time.timeZone = "Asia/Kolkata";
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" ]; i18n.supportedLocales = ["en_US.UTF-8/UTF-8"];
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
@@ -131,7 +130,7 @@
users.users.servius = { users.users.servius = {
isNormalUser = true; isNormalUser = true;
description = "Uttarayan"; description = "Uttarayan";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = ["networkmanager" "wheel"];
}; };
# Allow unfree packages # Allow unfree packages
@@ -152,11 +151,11 @@
fish fish
nushellFull nushellFull
(pkgs.wrapFirefox (pkgs.wrapFirefox
(pkgs.firefox-unwrapped.override { pipewireSupport = true; }) (pkgs.firefox-unwrapped.override {pipewireSupport = true;})
{ }) {})
gnumake gnumake
python3 python3
(nerdfonts.override { fonts = [ "FiraCode" "Hasklig" ]; }) (nerdfonts.override {fonts = ["FiraCode" "Hasklig"];})
]; ];
environment.sessionVariables = { environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1"; WLR_NO_HARDWARE_CURSORS = "1";
@@ -204,14 +203,19 @@
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPortRanges = [ allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect {
from = 1714;
to = 1764;
} # KDE Connect
]; ];
allowedUDPPortRanges = [ allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect {
from = 1714;
to = 1764;
} # KDE Connect
]; ];
}; };
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave
@@ -220,5 +224,5 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
nix.settings.extra-experimental-features = "nix-command flakes"; nix.settings.extra-experimental-features = "nix-command flakes";
nix.settings.trusted-users = [ "root" "servius" ]; nix.settings.trusted-users = ["root" "servius"];
} }

View File

@@ -1,30 +1,39 @@
{ nixpkgs, devices, inputs, overlays, home-manager, nur, ... }: {
nixpkgs,
devices,
inputs,
overlays,
home-manager,
nur,
...
}:
builtins.listToAttrs (builtins.map (device: { builtins.listToAttrs (builtins.map (device: {
name = device.name; name = device.name;
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
system = device.system; system = device.system;
specialArgs = { specialArgs = {
inherit device; inherit device;
lanzaboote = inputs.lanzaboote; lanzaboote = inputs.lanzaboote;
}; };
modules = [ modules = [
nur.nixosModules.nur nur.nixosModules.nur
{ nixpkgs.overlays = overlays; } {nixpkgs.overlays = overlays;}
./configuration.nix ./configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
{ {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
inherit device; inherit device;
};
users.${device.user}.imports = [../common/home.nix];
}; };
users.${device.user}.imports = [ ../common/home.nix ]; }
}; ];
} };
]; })
}; devices)
}) devices)

View File

@@ -1,10 +1,14 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
@@ -12,15 +16,14 @@
driSupport32Bit = true; driSupport32Bit = true;
}; };
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc. services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
hardware.nvidia = { hardware.nvidia = {
# Modesetting is required. # Modesetting is required.
modesetting.enable = true; modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking # Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials. # of just the bare essentials.
powerManagement.enable = false; powerManagement.enable = false;
@@ -30,9 +33,9 @@
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of # Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at: # supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+ # Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting. # Currently alpha-quality/buggy, so false is currently the recommended setting.
open = true; open = true;
@@ -45,15 +48,12 @@
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
}; };
# hardware.bluetooth.settings = { # hardware.bluetooth.settings = {
boot.initrd.availableKernelModules = ["vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.availableKernelModules = boot.initrd.kernelModules = [];
[ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.kernelModules = ["kvm-intel"];
boot.initrd.kernelModules = [ ]; boot.extraModulePackages = [];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/11d8beef-2a63-4231-af35-b9b8d3a17e9b"; device = "/dev/disk/by-uuid/11d8beef-2a63-4231-af35-b9b8d3a17e9b";
@@ -70,7 +70,7 @@
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = [ ]; swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,13 +1,12 @@
{ inputs, ... }: {inputs, ...}: let
let
shell-scipts = final: prev: { shell-scipts = final: prev: {
handlr-xdg = (final.pkgs.writeShellApplication { handlr-xdg = final.pkgs.writeShellApplication {
name = "xdg-open"; name = "xdg-open";
runtimeInputs = [ final.pkgs.handlr-regex ]; runtimeInputs = [final.pkgs.handlr-regex];
text = '' text = ''
handlr open "$@" handlr open "$@"
''; '';
}); };
}; };
misc-applications = final: prev: { misc-applications = final: prev: {
@@ -21,32 +20,31 @@ let
rev = "v1.6.4"; rev = "v1.6.4";
sha256 = "sha256-m6reRaJNeFhJBUatfPNm66LwTXPdD/gioT8HTv52QOw"; sha256 = "sha256-m6reRaJNeFhJBUatfPNm66LwTXPdD/gioT8HTv52QOw";
}; };
patches = [ patches/goread.patch ]; patches = [patches/goread.patch];
checkPhase = null; checkPhase = null;
}; };
music-player-git = inputs.music-player.packages.${prev.system}.default; music-player-git = inputs.music-player.packages.${prev.system}.default;
davis = davis = let
let davis-src = final.pkgs.fetchFromGitHub {
davis-src = final.pkgs.fetchFromGitHub { owner = "SimonPersson";
owner = "SimonPersson"; repo = "davis";
repo = "davis"; rev = "main";
rev = "main"; sha256 = "sha256-p4l1nF6M28OyIaPorgsyR7NJtmVwpmuws67KvVnJa8s";
sha256 = "sha256-p4l1nF6M28OyIaPorgsyR7NJtmVwpmuws67KvVnJa8s"; };
}; cargoToml =
cargoToml = builtins.fromTOML (builtins.readFile "${davis-src}/Cargo.toml");
builtins.fromTOML (builtins.readFile "${davis-src}/Cargo.toml"); in
in
final.rustPlatform.buildRustPackage { final.rustPlatform.buildRustPackage {
pname = cargoToml.package.name; pname = cargoToml.package.name;
version = cargoToml.package.version; version = cargoToml.package.version;
src = davis-src; src = davis-src;
cargoLock = { lockFile = "${davis-src}/Cargo.lock"; }; cargoLock = {lockFile = "${davis-src}/Cargo.lock";};
buildPhase = '' buildPhase = ''
runHook cargoBuildHook runHook cargoBuildHook
runHook cargoInstallPostBuildHook runHook cargoInstallPostBuildHook
''; '';
runtimeInputs = [ final.pkgs.picat ]; runtimeInputs = [final.pkgs.picat];
buildInputs = [ final.pkgs.picat ]; buildInputs = [final.pkgs.picat];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp $bins $out/bin cp $bins $out/bin
@@ -56,31 +54,33 @@ let
''; '';
}; };
picat = picat = let
let # https://github.com/SimonPersson/picat
# https://github.com/SimonPersson/picat picat-src = final.pkgs.fetchFromGitHub {
picat-src = final.pkgs.fetchFromGitHub { owner = "SimonPersson";
owner = "SimonPersson"; repo = "picat";
repo = "picat"; rev = "main";
rev = "main"; sha256 = "sha256-HheBinHW4RLjRtiE8Xe5BoEuSCdtZTA9XkRJgtDkXaM";
sha256 = "sha256-HheBinHW4RLjRtiE8Xe5BoEuSCdtZTA9XkRJgtDkXaM"; };
}; cargoToml =
cargoToml = builtins.fromTOML (builtins.readFile "${picat-src}/Cargo.toml");
builtins.fromTOML (builtins.readFile "${picat-src}/Cargo.toml"); in
in
final.rustPlatform.buildRustPackage { final.rustPlatform.buildRustPackage {
pname = cargoToml.package.name; pname = cargoToml.package.name;
version = cargoToml.package.version; version = cargoToml.package.version;
src = picat-src; src = picat-src;
cargoLock = { lockFile = "${picat-src}/Cargo.lock"; }; cargoLock = {lockFile = "${picat-src}/Cargo.lock";};
}; };
psst = psst =
if final.pkgs.stdenv.isLinux then if final.pkgs.stdenv.isLinux
then
(prev.psst.overrideAttrs (finalAttrs: prevAttrs: { (prev.psst.overrideAttrs (finalAttrs: prevAttrs: {
postInstall = (prevAttrs.postInstall or "") + '' postInstall =
patch $out/share/applications/Psst.desktop < ${./patches/psst.patch} (prevAttrs.postInstall or "")
''; + ''
patch $out/share/applications/Psst.desktop < ${./patches/psst.patch}
'';
})) }))
else else
final.rustPlatform.buildRustPackage rec { final.rustPlatform.buildRustPackage rec {
@@ -110,79 +110,83 @@ let
}; };
anyrun-overlay = final: prev: { anyrun-overlay = final: prev: {
anyrun = (inputs.anyrun.packages.${prev.system}.anyrun.overrideAttrs anyrun =
(finalAttrs: prevAttrs: { cargoPatches = [ ./patches/anyrun.patch ]; })); inputs.anyrun.packages.${prev.system}.anyrun.overrideAttrs
(finalAttrs: prevAttrs: {cargoPatches = [./patches/anyrun.patch];});
hyprwin = inputs.anyrun-hyprwin.packages.${prev.system}.hyprwin; hyprwin = inputs.anyrun-hyprwin.packages.${prev.system}.hyprwin;
nixos-options = inputs.anyrun-nixos-options.packages.${prev.system}.default; nixos-options = inputs.anyrun-nixos-options.packages.${prev.system}.default;
anyrun-rink = inputs.anyrun-rink.packages.${prev.system}.default; anyrun-rink = inputs.anyrun-rink.packages.${prev.system}.default;
}; };
vimPlugins = final: prev: { vimPlugins = final: prev: {
vimPlugins = prev.vimPlugins // { vimPlugins =
comfortable-motion = final.pkgs.vimUtils.buildVimPlugin { prev.vimPlugins
name = "comfortable-motion"; // {
src = final.pkgs.fetchFromGitHub { comfortable-motion = final.pkgs.vimUtils.buildVimPlugin {
owner = "yuttie"; name = "comfortable-motion";
repo = "comfortable-motion.vim"; src = final.pkgs.fetchFromGitHub {
rev = "master"; owner = "yuttie";
sha256 = "sha256-S1LJXmShhpCJIg/FEPx3jFbmPpS/1U4MAQN2RY/nkI0"; repo = "comfortable-motion.vim";
rev = "master";
sha256 = "sha256-S1LJXmShhpCJIg/FEPx3jFbmPpS/1U4MAQN2RY/nkI0";
};
};
sqls-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "sqls-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "nanotee";
repo = "sqls.nvim";
rev = "master";
sha256 = "sha256-jKFut6NZAf/eIeIkY7/2EsjsIhvZQKCKAJzeQ6XSr0s";
};
};
outline-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "outline-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "hedyhli";
repo = "outline.nvim";
rev = "master";
sha256 = "sha256-HaxfnvgFy7fpa2CS7/dQhf6dK9+Js7wP5qGdIeXLGPY";
};
};
rest-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "rest-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "rest-nvim";
repo = "rest.nvim";
rev = "main";
sha256 = "sha256-3EC0j/hEbdQ8nJU0I+LGmE/zNnglO/FrP/6POer0338=";
};
}; };
}; };
sqls-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "sqls-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "nanotee";
repo = "sqls.nvim";
rev = "master";
sha256 = "sha256-jKFut6NZAf/eIeIkY7/2EsjsIhvZQKCKAJzeQ6XSr0s";
};
};
outline-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "outline-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "hedyhli";
repo = "outline.nvim";
rev = "master";
sha256 = "sha256-HaxfnvgFy7fpa2CS7/dQhf6dK9+Js7wP5qGdIeXLGPY";
};
};
rest-nvim = final.pkgs.vimUtils.buildVimPlugin {
name = "rest-nvim";
src = final.pkgs.fetchFromGitHub {
owner = "rest-nvim";
repo = "rest.nvim";
rev = "main";
sha256 = "sha256-3EC0j/hEbdQ8nJU0I+LGmE/zNnglO/FrP/6POer0338=";
};
};
};
}; };
tmuxPlugins = final: prev: { tmuxPlugins = final: prev: {
tmuxPlugins = prev.tmuxPlugins // { tmuxPlugins =
prev.tmuxPlugins
tmux-super-fingers = final.pkgs.tmuxPlugins.mkTmuxPlugin { // {
pluginName = "tmux-super-fingers"; tmux-super-fingers = final.pkgs.tmuxPlugins.mkTmuxPlugin {
version = "v1-2024-02-14"; pluginName = "tmux-super-fingers";
src = final.pkgs.fetchFromGitHub { version = "v1-2024-02-14";
owner = "artemave"; src = final.pkgs.fetchFromGitHub {
repo = "tmux_super_fingers"; owner = "artemave";
rev = "518044ef78efa1cf3c64f2e693fef569ae570ddd"; repo = "tmux_super_fingers";
sha256 = "sha256-iKfx9Ytk2vSuINvQTB6Kww8Vv7i51cFEnEBHLje+IJw="; rev = "518044ef78efa1cf3c64f2e693fef569ae570ddd";
sha256 = "sha256-iKfx9Ytk2vSuINvQTB6Kww8Vv7i51cFEnEBHLje+IJw=";
};
}; };
}; };
};
}; };
catppuccinThemes = final: prev: { catppuccinThemes = final: prev: {
catppuccinThemes = import ./themes/catppuccin.nix { pkgs = final.pkgs; }; catppuccinThemes = import ./themes/catppuccin.nix {pkgs = final.pkgs;};
}; };
nix-index-db = (final: prev: { nix-index-db = final: prev: {
nix-index-database = final.runCommandLocal "nix-index-database" { } '' nix-index-database = final.runCommandLocal "nix-index-database" {} ''
mkdir -p $out mkdir -p $out
ln -s ${ ln -s ${
inputs.nix-index-database.legacyPackages.${prev.system}.database inputs.nix-index-database.legacyPackages.${prev.system}.database
} $out/files } $out/files
''; '';
}); };
# nixneovim = nixneovim.applyPatches { # nixneovim = nixneovim.applyPatches {
# name = "nixneovim-patched"; # name = "nixneovim-patched";
@@ -190,22 +194,23 @@ let
# patches = [ ./patches/nixneovim.patch ]; # patches = [ ./patches/nixneovim.patch ];
# }; # };
tree-sitter-grammars = (final: prev: { tree-sitter-grammars = final: prev: {
tree-sitter-grammars = prev.tree-sitter-grammars // { tree-sitter-grammars =
tree-sitter-just = final.pkgs.tree-sitter.buildGrammar { prev.tree-sitter-grammars
language = "just"; // {
version = "1"; tree-sitter-just = final.pkgs.tree-sitter.buildGrammar {
src = final.pkgs.fetchFromGitHub { language = "just";
owner = "IndianBoy42"; version = "1";
repo = "tree-sitter-just"; src = final.pkgs.fetchFromGitHub {
rev = "613b3fd39183bec94bc741addc5beb6e6f17969f"; owner = "IndianBoy42";
sha256 = "sha256-OBlXwWriE6cdGn0dhpfSMnJ6Rx1Z7KcXehaamdi/TxQ"; repo = "tree-sitter-just";
rev = "613b3fd39183bec94bc741addc5beb6e6f17969f";
sha256 = "sha256-OBlXwWriE6cdGn0dhpfSMnJ6Rx1Z7KcXehaamdi/TxQ";
};
}; };
}; };
}; };
}); in [
in
[
catppuccinThemes catppuccinThemes
vimPlugins vimPlugins
tree-sitter-grammars tree-sitter-grammars

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: {pkgs, ...}:
pkgs.writeShellScript "start-tmux" '' pkgs.writeShellScript "start-tmux" ''
live_sessions=$(${pkgs.tmux}/bin/tmux list-sessions 2>/dev/null) live_sessions=$(${pkgs.tmux}/bin/tmux list-sessions 2>/dev/null)
all_sessions=$(${pkgs.findutils}/bin/find -L ~/.config/tmux/sessions -type f -executable -printf '%f\n'| sort) all_sessions=$(${pkgs.findutils}/bin/find -L ~/.config/tmux/sessions -type f -executable -printf '%f\n'| sort)

View File

@@ -1,13 +1,12 @@
{ pkgs, ... }: {pkgs, ...}: let
let mkCatppuccin = {
mkCatppuccin = owner ? "catppuccin",
{ owner ? "catppuccin" version ? "0.0.1",
, version ? "0.0.1" item,
, item rev ? "main",
, rev ? "main" sha256 ? pkgs.lib.fakeSha256,
, sha256 ? pkgs.lib.fakeSha256 override ? null,
, override ? null }:
}:
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
inherit version override; inherit version override;
pname = item; pname = item;
@@ -22,13 +21,14 @@ let
''; '';
}; };
flavors = [ "latte" "frappe" "macchiato" "mocha" ]; flavors = ["latte" "frappe" "macchiato" "mocha"];
mapFlavor = flavorMap: (flavor: { mapFlavor = flavorMap:
name = flavor; (flavor: {
value = flavorMap flavor; name = flavor;
}) flavors; value = flavorMap flavor;
in })
{ flavors;
in {
bat = mkCatppuccin { bat = mkCatppuccin {
item = "bat"; item = "bat";
sha256 = "sha256-yHt3oIjUnljARaihalcWSNldtaJfVDfmfiecYfbzGs0"; sha256 = "sha256-yHt3oIjUnljARaihalcWSNldtaJfVDfmfiecYfbzGs0";
@@ -60,15 +60,15 @@ in
sha256 = "sha256-czvR3bVZ0NfBmuu0JixalS7B1vf1uEGSTSUVVTclKxI"; sha256 = "sha256-czvR3bVZ0NfBmuu0JixalS7B1vf1uEGSTSUVVTclKxI";
}; };
gtk = (pkgs.catppuccin-gtk.override { gtk = pkgs.catppuccin-gtk.override {
variant = "mocha"; variant = "mocha";
size = "standard"; size = "standard";
accents = [ "mauve" ]; accents = ["mauve"];
tweaks = [ "normal" ]; tweaks = ["normal"];
}); };
papirus-folders = (pkgs.catppuccin-papirus-folders.override { papirus-folders = pkgs.catppuccin-papirus-folders.override {
accent = "mauve"; accent = "mauve";
flavor = "mocha"; flavor = "mocha";
}); };
} }

View File

@@ -1,9 +1,10 @@
{ pkgs, ... }: {pkgs, ...}: let
let getWall = {
getWall = { url, sha256 ? pkgs.lib.fakeSha256 }: url,
builtins.fetchurl { inherit url sha256; }; sha256 ? pkgs.lib.fakeSha256,
in }:
rec { builtins.fetchurl {inherit url sha256;};
in rec {
inherit getWall; inherit getWall;
# Some predefined wallpapers # Some predefined wallpapers
lights = getWall { lights = getWall {
@@ -23,6 +24,6 @@ rec {
sha256 = "0vm02yg4w5bfqns5k1r8y09fqxs0qy4y886myvnp64n1maaihp4k"; sha256 = "0vm02yg4w5bfqns5k1r8y09fqxs0qy4y886myvnp64n1maaihp4k";
}; };
anime = [ frieren_3 ]; anime = [frieren_3];
all = [ lights shapes cloud ] ++ anime; all = [lights shapes cloud] ++ anime;
} }