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

View File

@@ -1,10 +1,11 @@
{ ... }: {
imports = [ ../modules/goread.nix ];
{...}: {
imports = [../modules/goread.nix];
programs.goread = {
enable = true;
config = {
urls = {
categories = [{
categories = [
{
name = "Rust";
desc = "Stuff related to the rust programming language";
subscriptions = [
@@ -35,9 +36,9 @@
url = "https://old.reddit.com/r/nixos/.rss";
}
];
}];
}
];
};
};
};
}

View File

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

View File

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

View File

@@ -1,32 +1,29 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.newsboat = {
enable = false;
urls = [
{
title = "r/rust";
url = "https://www.reddit.com/r/rust/.rss";
tags = [ "rust" ];
tags = ["rust"];
}
{
title = "the square planet";
url = "https://thesquareplanet.com/feed.xml";
tags = [ "rust" ];
tags = ["rust"];
}
{
title = "Jon Gjengset's YouTube";
url =
"https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
tags = [ "rust" "youtube" ];
url = "https://www.youtube.com/feeds/videos.xml?channel_id=UC_iD0xppBwwsrM9DegC5cQQ";
tags = ["rust" "youtube"];
}
];
extraConfig =
let
extraConfig = let
dracula = builtins.fetchurl {
url = "https://raw.githubusercontent.com/dracula/newsboat/main/newsboat";
sha256 = "sha256:08b00ilc5zk5fkzqqd6aghcpya3d00s9kvv65b8c50rg7ikm88xr";
};
in
''
in ''
include ${dracula}
unbind-key g
bind-key g home

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 = {
enable = true;
extraPlugins = with pkgs.vimPlugins; [
@@ -80,7 +86,9 @@
undofile = true;
};
globals = { mapleader = " "; };
globals = {
mapleader = " ";
};
plugins = {
lspconfig = {
enable = true;
@@ -89,12 +97,14 @@
nil = {
enable = true;
extraConfig =
/* lua */
# lua
''
settings = {
['nil'] = {
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 = {
flake = {
@@ -113,7 +123,7 @@
sqls = {
enable = true;
onAttachExtra =
/* lua */
# lua
''
require('sqls').on_attach(client, bufnr)
'';
@@ -121,7 +131,7 @@
# rust-analyzer.enable = true;
};
extraLua.pre =
/* lua */
# lua
''
local lsp_zero = require'lsp-zero'
local lspconfig = require 'lspconfig'
@@ -163,7 +173,10 @@
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;
};
@@ -174,7 +187,6 @@
# cursorword.enable = true;
starter.enable = true;
};
};
colorschemes = {
catppuccin = {
@@ -221,18 +233,21 @@
};
};
extraConfigLua =
let
codelldb = if device.isLinux then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter else null;
extraConfigLua = let
codelldb =
if device.isLinux
then pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter
else null;
liblldb =
if device.isLinux then
"${codelldb}/lldb/lib/liblldb.so"
if device.isLinux
then "${codelldb}/lldb/lib/liblldb.so"
# else if device.isMac then
# "${codelldb}/lldb/lib/liblldb.dylib"
else null
;
else null;
in
/* lua */
/*
lua
*/
''
require'neotest'.setup({
adapters = {
@@ -287,8 +302,7 @@
autoload_configurations = false,
${pkgs.lib.optionalString device.isLinux ''
adapter = require'rustaceanvim.config'.get_codelldb_adapter("${codelldb}/bin/codelldb", "${liblldb}")
''
}
''}
},
}
@@ -441,4 +455,3 @@
package = pkgs.neovim-nightly;
};
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,11 @@
{ devices, inputs, overlays, home-manager, nix-darwin, ... }:
{
devices,
inputs,
overlays,
home-manager,
nix-darwin,
...
}:
builtins.listToAttrs (builtins.map (device: {
name = device.name;
value = nix-darwin.lib.darwinSystem {
@@ -19,9 +26,10 @@ builtins.listToAttrs (builtins.map (device: {
inherit inputs;
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 = {
skhd = {
enable = true;

View File

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

View File

@@ -68,17 +68,16 @@
};
};
outputs =
{ nixpkgs
, home-manager
, nix-darwin
, flake-utils
, anyrun
, nur
, neovim-nightly-overlay
, ...
}@inputs:
let
outputs = {
nixpkgs,
home-manager,
nix-darwin,
flake-utils,
anyrun,
nur,
neovim-nightly-overlay,
...
} @ inputs: let
config_devices = [
{
name = "mirai";
@@ -108,10 +107,12 @@
}
];
mkDevice = { device }: {
mkDevice = {device}: {
isLinux = !isNull (builtins.match ".*-linux" device.system);
isNix =
if (builtins.hasAttr "isNix" device) then device.isNix else false;
if (builtins.hasAttr "isNix" device)
then device.isNix
else false;
isMac = !isNull (builtins.match ".*-darwin" device.system);
system = device.system;
name = device.name;
@@ -119,32 +120,32 @@
};
devices =
builtins.map (device: mkDevice { inherit device; }) config_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;
};
overlays = import ./overlays.nix {inherit inputs;};
in {
nixosConfigurations = let
devices = nixos_devices;
in
{
nixosConfigurations =
let devices = nixos_devices;
in import ./nixos/device.nix {
import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations =
let devices = darwin_devices;
in import ./darwin/device.nix {
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 {
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 = {
enable = true;
config = {
@@ -15,10 +21,10 @@
symbols
kidex
];
x = { fraction = 0.5; };
y = { fraction = 0.3; };
height = { absolute = 0; };
width = { absolute = 1000; };
x = {fraction = 0.5;};
y = {fraction = 0.3;};
height = {absolute = 0;};
width = {absolute = 1000;};
showResultsImmediately = true;
maxEntries = 10;
layer = "overlay";
@@ -26,10 +32,12 @@
extraConfigFiles = {
"nixos-options.ron".text = let
nixos-options = pkgs.lib.optionalString device.isNix
nixos-options =
pkgs.lib.optionalString device.isNix
osConfig.system.build.manual.optionsJSON
+ "/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";
# 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
@@ -41,8 +49,13 @@
# ":nall" = [nixos-options hm-options some-other-option];
# };
options = builtins.toJSON ({
":hm" = [ hm-options ];
} // (if device.isNix then { ":nix" = [ nixos-options ]; } else { }));
":hm" = [hm-options];
}
// (
if device.isNix
then {":nix" = [nixos-options];}
else {}
));
in ''
Config(
options: ${options},
@@ -56,7 +69,9 @@
)
'';
"websearch.ron".text =
/* ron */
/*
ron
*/
''
Config(
prefix: "?",

View File

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

View File

@@ -1,4 +1,10 @@
{ devices, inputs, overlays, home-manager, ... }:
{
devices,
inputs,
overlays,
home-manager,
...
}:
builtins.listToAttrs (builtins.map (device: {
name = device.user;
value = let
@@ -6,12 +12,14 @@ builtins.listToAttrs (builtins.map (device: {
inherit overlays;
system = device.system;
};
in home-manager.lib.homeManagerConfiguration {
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
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 = {
enable = pkgs.stdenv.isLinux;
server.enable = true;

View File

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

View File

@@ -1,8 +1,12 @@
{ pkgs, inputs, ... }: {
imports = [ ../modules/hyprpaper.nix inputs.hyprlock.homeManagerModules.hyprlock ];
{
pkgs,
inputs,
...
}: {
imports = [../modules/hyprpaper.nix inputs.hyprlock.homeManagerModules.hyprlock];
programs.hyprpaper =
let wallpapers = import ../utils/wallhaven.nix { inherit pkgs; };
programs.hyprpaper = let
wallpapers = import ../utils/wallhaven.nix {inherit pkgs;};
in {
enable = true;
systemd.enable = true;

View File

@@ -1,5 +1,9 @@
{ inputs, pkgs, ... }: {
imports = [ inputs.ironbar.homeManagerModules.default ];
{
inputs,
pkgs,
...
}: {
imports = [inputs.ironbar.homeManagerModules.default];
programs.ironbar = {
enable = true;
config.monitors = {
@@ -8,11 +12,11 @@
start = [
{
type = "launcher";
favourites = [ "firefox" "discord" ];
favourites = ["firefox" "discord"];
show_names = false;
show_icons = true;
}
{ type = "focused"; }
{type = "focused";}
];
end = [
{
@@ -25,7 +29,7 @@
type = "music";
player_type = "mpris";
}
{ type = "clock"; }
{type = "clock";}
];
};
DP-3 = {
@@ -46,9 +50,10 @@
# networks= 3;
};
}
{ type = "tray"; }
{type = "tray";}
];
start = [{
start = [
{
type = "workspaces";
name_map = {
"1" = "icon:foot";
@@ -62,9 +67,10 @@
"9" = "icon:discord";
"10" = "icon:spotify";
};
favorites = [ "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" ];
favorites = ["1" "2" "3" "4" "5" "6" "7" "8" "9" "10"];
all_monitors = true;
}];
}
];
};
};
style = let
@@ -79,6 +85,7 @@
sha256 = "sha256-vfwfBE3iqIN1cGoItSssR7h0z6tuJAhNarkziGFlNBw";
};
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 = {
enable = true;
};

View File

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

View File

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

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

View File

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

View File

@@ -1,4 +1,12 @@
{ nixpkgs, devices, inputs, overlays, home-manager, nur, ... }:
{
nixpkgs,
devices,
inputs,
overlays,
home-manager,
nur,
...
}:
builtins.listToAttrs (builtins.map (device: {
name = device.name;
value = nixpkgs.lib.nixosSystem {
@@ -9,7 +17,7 @@ builtins.listToAttrs (builtins.map (device: {
};
modules = [
nur.nixosModules.nur
{ nixpkgs.overlays = overlays; }
{nixpkgs.overlays = overlays;}
./configuration.nix
home-manager.nixosModules.home-manager
inputs.lanzaboote.nixosModules.lanzaboote
@@ -22,9 +30,10 @@ builtins.listToAttrs (builtins.map (device: {
inherit inputs;
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
# 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") ];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
hardware.opengl = {
enable = true;
@@ -12,9 +16,8 @@
driSupport32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc.
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
@@ -45,15 +48,12 @@
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
# hardware.bluetooth.settings = {
boot.initrd.availableKernelModules =
[ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/11d8beef-2a63-4231-af35-b9b8d3a17e9b";
@@ -70,7 +70,7 @@
fsType = "ext4";
};
swapDevices = [ ];
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@@ -1,13 +1,12 @@
{ inputs, ... }:
let
{inputs, ...}: let
shell-scipts = final: prev: {
handlr-xdg = (final.pkgs.writeShellApplication {
handlr-xdg = final.pkgs.writeShellApplication {
name = "xdg-open";
runtimeInputs = [ final.pkgs.handlr-regex ];
runtimeInputs = [final.pkgs.handlr-regex];
text = ''
handlr open "$@"
'';
});
};
};
misc-applications = final: prev: {
@@ -21,12 +20,11 @@ let
rev = "v1.6.4";
sha256 = "sha256-m6reRaJNeFhJBUatfPNm66LwTXPdD/gioT8HTv52QOw";
};
patches = [ patches/goread.patch ];
patches = [patches/goread.patch];
checkPhase = null;
};
music-player-git = inputs.music-player.packages.${prev.system}.default;
davis =
let
davis = let
davis-src = final.pkgs.fetchFromGitHub {
owner = "SimonPersson";
repo = "davis";
@@ -40,13 +38,13 @@ let
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = davis-src;
cargoLock = { lockFile = "${davis-src}/Cargo.lock"; };
cargoLock = {lockFile = "${davis-src}/Cargo.lock";};
buildPhase = ''
runHook cargoBuildHook
runHook cargoInstallPostBuildHook
'';
runtimeInputs = [ final.pkgs.picat ];
buildInputs = [ final.pkgs.picat ];
runtimeInputs = [final.pkgs.picat];
buildInputs = [final.pkgs.picat];
installPhase = ''
mkdir -p $out/bin
cp $bins $out/bin
@@ -56,8 +54,7 @@ let
'';
};
picat =
let
picat = let
# https://github.com/SimonPersson/picat
picat-src = final.pkgs.fetchFromGitHub {
owner = "SimonPersson";
@@ -72,13 +69,16 @@ let
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = picat-src;
cargoLock = { lockFile = "${picat-src}/Cargo.lock"; };
cargoLock = {lockFile = "${picat-src}/Cargo.lock";};
};
psst =
if final.pkgs.stdenv.isLinux then
if final.pkgs.stdenv.isLinux
then
(prev.psst.overrideAttrs (finalAttrs: prevAttrs: {
postInstall = (prevAttrs.postInstall or "") + ''
postInstall =
(prevAttrs.postInstall or "")
+ ''
patch $out/share/applications/Psst.desktop < ${./patches/psst.patch}
'';
}))
@@ -110,14 +110,17 @@ let
};
anyrun-overlay = final: prev: {
anyrun = (inputs.anyrun.packages.${prev.system}.anyrun.overrideAttrs
(finalAttrs: prevAttrs: { cargoPatches = [ ./patches/anyrun.patch ]; }));
anyrun =
inputs.anyrun.packages.${prev.system}.anyrun.overrideAttrs
(finalAttrs: prevAttrs: {cargoPatches = [./patches/anyrun.patch];});
hyprwin = inputs.anyrun-hyprwin.packages.${prev.system}.hyprwin;
nixos-options = inputs.anyrun-nixos-options.packages.${prev.system}.default;
anyrun-rink = inputs.anyrun-rink.packages.${prev.system}.default;
};
vimPlugins = final: prev: {
vimPlugins = prev.vimPlugins // {
vimPlugins =
prev.vimPlugins
// {
comfortable-motion = final.pkgs.vimUtils.buildVimPlugin {
name = "comfortable-motion";
src = final.pkgs.fetchFromGitHub {
@@ -157,8 +160,9 @@ let
};
};
tmuxPlugins = final: prev: {
tmuxPlugins = prev.tmuxPlugins // {
tmuxPlugins =
prev.tmuxPlugins
// {
tmux-super-fingers = final.pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "tmux-super-fingers";
version = "v1-2024-02-14";
@@ -172,17 +176,17 @@ let
};
};
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-database = final.runCommandLocal "nix-index-database" { } ''
nix-index-db = final: prev: {
nix-index-database = final.runCommandLocal "nix-index-database" {} ''
mkdir -p $out
ln -s ${
inputs.nix-index-database.legacyPackages.${prev.system}.database
} $out/files
'';
});
};
# nixneovim = nixneovim.applyPatches {
# name = "nixneovim-patched";
@@ -190,8 +194,10 @@ let
# patches = [ ./patches/nixneovim.patch ];
# };
tree-sitter-grammars = (final: prev: {
tree-sitter-grammars = prev.tree-sitter-grammars // {
tree-sitter-grammars = final: prev: {
tree-sitter-grammars =
prev.tree-sitter-grammars
// {
tree-sitter-just = final.pkgs.tree-sitter.buildGrammar {
language = "just";
version = "1";
@@ -203,9 +209,8 @@ let
};
};
};
});
in
[
};
in [
catppuccinThemes
vimPlugins
tree-sitter-grammars

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{pkgs, ...}:
pkgs.writeShellScript "start-tmux" ''
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)

View File

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

View File

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