renamed to home.nix
This commit is contained in:
+14
-10
@@ -1,10 +1,10 @@
|
||||
{
|
||||
myConfig = {
|
||||
general = {
|
||||
Hostname = "nixos";
|
||||
Timezone = "America/Chicago";
|
||||
essentials = {
|
||||
# !!! replace it with your own, else system might malfunction.
|
||||
Username = "kenji";
|
||||
|
||||
};
|
||||
general = {
|
||||
Terminal = {
|
||||
font = "JetBrainsMono Nerd Font";
|
||||
size = "12";
|
||||
@@ -13,13 +13,12 @@
|
||||
ls = "ls --color=auto";
|
||||
};
|
||||
};
|
||||
Git = {
|
||||
user = "";
|
||||
email = "";
|
||||
defaultBranch = "master";
|
||||
};
|
||||
};
|
||||
linux = {
|
||||
|
||||
nixos = {
|
||||
Hostname = "nixos";
|
||||
Timezone = "America/Chicago";
|
||||
|
||||
Boot = {
|
||||
mode = "grub"; # systemd or grub
|
||||
};
|
||||
@@ -35,6 +34,11 @@
|
||||
Hyprland = {
|
||||
monitors = [];
|
||||
};
|
||||
Git = {
|
||||
user = "";
|
||||
email = "";
|
||||
defaultBranch = "master";
|
||||
};
|
||||
};
|
||||
optionals = {
|
||||
Builds = {
|
||||
|
||||
@@ -12,20 +12,59 @@
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
darwin = {
|
||||
url = "github:lnl7/nix-darwin";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
home-manager,
|
||||
darwin,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
config = import ./config.nix;
|
||||
lib = nixpkgs.lib;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
args = {inherit inputs system;} // config;
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
desktop = lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = args;
|
||||
modules = [];
|
||||
};
|
||||
};
|
||||
homeConfigurations = {
|
||||
desktop = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
extraSpecialArgs = args;
|
||||
modules = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
darwinConfigurations = {
|
||||
macos = darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
specialArgs = args;
|
||||
modules = [
|
||||
./hosts/macos/darwin.nix
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = args;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../modules/home/terminal.nix
|
||||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.packages = [];
|
||||
home.stateVersion = "23.05";
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../modules/default/darwin.nix
|
||||
];
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
environment.systemPackages = [];
|
||||
|
||||
# Auto upgrade nix package and the daemon service.
|
||||
# services.nix-daemon.enable = true;
|
||||
# services.karabiner-elements.enable = true;
|
||||
# nix.package = pkgs.nix;
|
||||
|
||||
# Necessary for using flakes on this system.
|
||||
nix.settings.experimental-features = "nix-command flakes";
|
||||
nix.settings.trusted-users = myConfig.optionals.Builds.trustedUsers;
|
||||
|
||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||
programs.zsh.enable = true; # default shell on catalina
|
||||
programs.fish.enable = true;
|
||||
|
||||
# $ darwin-rebuild changelog
|
||||
system.stateVersion = 5;
|
||||
|
||||
# The platform the configuration will be used on.
|
||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||
security.pam.services.sudo_local.touchIdAuth = true;
|
||||
|
||||
users.users.${myConfig.esssentials.Username} = {
|
||||
name = "${myConfig.essentials.Username}";
|
||||
home = "/Users/${myConfig.essentials.Username}";
|
||||
# shell = pkgs.${myConfig.general.terminal.Shell}; # no support for nix-darwin, but can be changed via chsh.
|
||||
};
|
||||
|
||||
home-manager.users.${myConfig.essentials.Username} = import ../../home/macos.nix;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
@girs/
|
||||
@@ -0,0 +1,17 @@
|
||||
import { App } from "astal/gtk3"
|
||||
import style from "./style.scss"
|
||||
import Bar from "./widget/Bar"
|
||||
|
||||
App.start({
|
||||
css: style,
|
||||
instanceName: "js",
|
||||
requestHandler(request, res) {
|
||||
print(request)
|
||||
res("ok")
|
||||
},
|
||||
main: () => {
|
||||
const monitors = App.get_monitors()
|
||||
const primary = monitors.find(m => m.primary) || monitors[0]
|
||||
return Bar(primary)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
$background: #131318;
|
||||
$foreground: #e4e1e9;
|
||||
$primary: #bec2ff;
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
declare const SRC: string
|
||||
|
||||
declare module "inline:*" {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module "*.scss" {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module "*.blp" {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
|
||||
declare module "*.css" {
|
||||
const content: string
|
||||
export default content
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "astal-shell",
|
||||
"dependencies": {
|
||||
"astal": "/home/biscuit/.local/share/ags"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
@use "sass:color";
|
||||
@use "./colors" as *;
|
||||
|
||||
// default
|
||||
// $bg: #212223;
|
||||
// $fg: #f1f1f1;
|
||||
// $accent: #378DF7;
|
||||
// $radius: 7px;
|
||||
|
||||
// Kanagawa Theme
|
||||
// $bg: #1F1F28;
|
||||
// $fg: #DCD7BA;
|
||||
// $accent: #C0A36E;
|
||||
// $radius: 7px;
|
||||
|
||||
// mstcl
|
||||
// $bg: #121212;
|
||||
// $fg: #f1f1f1;
|
||||
// $accent: #C0A36E;
|
||||
// $radius: 7px;
|
||||
|
||||
$bg: $background;
|
||||
$fg: $foreground;
|
||||
$accent: $primary;
|
||||
$radius: 7px;
|
||||
|
||||
window.Bar {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
background-color: $bg;
|
||||
color: $fg;
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
font-family: "JetBrainsMono Nerd Font";
|
||||
|
||||
label {
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.Workspaces {
|
||||
button {
|
||||
all: unset;
|
||||
background-color: transparent;
|
||||
|
||||
&:hover label {
|
||||
background-color: color.adjust($fg, $alpha: -0.84);
|
||||
border-color: color.adjust($accent, $alpha: -0.8);
|
||||
}
|
||||
|
||||
&:active label {
|
||||
background-color: color.adjust($fg, $alpha: -0.8)
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
transition: 200ms;
|
||||
padding: 0 8px;
|
||||
margin: 2px;
|
||||
border-radius: $radius;
|
||||
border: 1pt solid transparent;
|
||||
}
|
||||
|
||||
.focused label {
|
||||
color: $accent;
|
||||
border-color: $accent;
|
||||
}
|
||||
}
|
||||
|
||||
.SysTray {
|
||||
margin-right: 8px;
|
||||
|
||||
button {
|
||||
padding: 0 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.Time {
|
||||
.TimeHM {
|
||||
font-weight: bold;
|
||||
color: $accent;
|
||||
}
|
||||
|
||||
.TimeDate {
|
||||
// color: color.adjust($fg, $lightness: -10%);
|
||||
color: $fg;
|
||||
opacity: 0.85;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.FocusedClient {
|
||||
color: color.adjust($fg, $lightness: -30%);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.Media .Cover {
|
||||
min-height: 1.2em;
|
||||
min-width: 1.2em;
|
||||
border-radius: $radius;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.Battery label {
|
||||
padding-left: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.AudioSlider {
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
icon {
|
||||
margin-right: .6em;
|
||||
}
|
||||
|
||||
& {
|
||||
margin: 0 1em;
|
||||
}
|
||||
|
||||
trough {
|
||||
background-color: color.adjust($fg, $alpha: -0.8);
|
||||
border-radius: $radius;
|
||||
}
|
||||
|
||||
highlight {
|
||||
background-color: $accent;
|
||||
min-height: .8em;
|
||||
border-radius: $radius;
|
||||
}
|
||||
|
||||
slider {
|
||||
background-color: $fg;
|
||||
border-radius: $radius;
|
||||
min-height: 1em;
|
||||
min-width: 1em;
|
||||
margin: -.2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"strict": true,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "Bundler",
|
||||
// "checkJs": true,
|
||||
// "allowJs": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "astal/gtk3",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
import { App } from "astal/gtk3"
|
||||
import { Variable, GLib, bind } from "astal"
|
||||
import { Astal, Gtk, Gdk } from "astal/gtk3"
|
||||
import Hyprland from "gi://AstalHyprland"
|
||||
import Mpris from "gi://AstalMpris"
|
||||
import Battery from "gi://AstalBattery"
|
||||
import Wp from "gi://AstalWp"
|
||||
import Network from "gi://AstalNetwork"
|
||||
import Tray from "gi://AstalTray"
|
||||
|
||||
function SysTray() {
|
||||
const tray = Tray.get_default()
|
||||
|
||||
return <box className="SysTray">
|
||||
{bind(tray, "items").as(items => items.map(item => (
|
||||
<menubutton
|
||||
tooltipMarkup={bind(item, "tooltipMarkup")}
|
||||
usePopover={false}
|
||||
actionGroup={bind(item, "actionGroup").as(ag => ["dbusmenu", ag])}
|
||||
menuModel={bind(item, "menuModel")}>
|
||||
<icon gicon={bind(item, "gicon")} />
|
||||
</menubutton>
|
||||
)))}
|
||||
</box>
|
||||
}
|
||||
|
||||
function Wifi() {
|
||||
const network = Network.get_default()
|
||||
const wifi = bind(network, "wifi")
|
||||
|
||||
return <box visible={wifi.as(Boolean)}>
|
||||
{wifi.as(wifi => wifi && (
|
||||
<icon
|
||||
tooltipText={bind(wifi, "ssid").as(String)}
|
||||
className="Wifi"
|
||||
icon={bind(wifi, "iconName")}
|
||||
/>
|
||||
))}
|
||||
</box>
|
||||
|
||||
}
|
||||
|
||||
function AudioSlider() {
|
||||
const speaker = Wp.get_default()?.audio.defaultSpeaker!
|
||||
|
||||
return <box className="AudioSlider" css="min-width: 140px">
|
||||
<icon icon={bind(speaker, "volumeIcon")} />
|
||||
<slider
|
||||
hexpand
|
||||
onDragged={({ value }) => speaker.volume = value}
|
||||
value={bind(speaker, "volume")}
|
||||
/>
|
||||
</box>
|
||||
}
|
||||
|
||||
function BatteryLevel() {
|
||||
const bat = Battery.get_default()
|
||||
|
||||
return <box className="Battery"
|
||||
visible={bind(bat, "isPresent")}>
|
||||
<icon icon={bind(bat, "batteryIconName")} />
|
||||
<label label={bind(bat, "percentage").as(p =>
|
||||
`${Math.floor(p * 100)} %`
|
||||
)} />
|
||||
</box>
|
||||
}
|
||||
|
||||
function Media() {
|
||||
const mpris = Mpris.get_default()
|
||||
|
||||
return <box className="Media">
|
||||
{bind(mpris, "players").as(ps => ps[0] ? (
|
||||
<box>
|
||||
<box
|
||||
className="Cover"
|
||||
valign={Gtk.Align.CENTER}
|
||||
css={bind(ps[0], "coverArt").as(cover =>
|
||||
`background-image: url('${cover}');`
|
||||
)}
|
||||
/>
|
||||
<label
|
||||
label={bind(ps[0], "metadata").as(() =>
|
||||
`${ps[0].title} - ${ps[0].artist}`
|
||||
)}
|
||||
/>
|
||||
</box>
|
||||
) : (
|
||||
<label label="Biscuit" />
|
||||
))}
|
||||
</box>
|
||||
}
|
||||
|
||||
|
||||
function Workspaces() {
|
||||
const hypr = Hyprland.get_default();
|
||||
|
||||
return (
|
||||
<box className="Workspaces">
|
||||
{bind(hypr, "focusedWorkspace").as((fw) => {
|
||||
if (!fw) return null;
|
||||
|
||||
// Determine the current chunk of 5 visible workspace buttons
|
||||
const currentChunkStart = Math.floor((fw.id - 1) / 5) * 5 + 1;
|
||||
const visibleIds = Array.from({ length: 5 }, (_, i) => currentChunkStart + i);
|
||||
|
||||
return visibleIds.map((id) => {
|
||||
// Try to get the real workspace, fall back to a dummy one if it doesn't exist
|
||||
const ws =
|
||||
hypr.workspaces.find((w) => w.id === id) ??
|
||||
Hyprland.Workspace.dummy(id, null);
|
||||
|
||||
return (
|
||||
<button
|
||||
className={fw.id === id ? "focused" : ""}
|
||||
onClick={() => ws.focus()}
|
||||
>
|
||||
{id}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
})}
|
||||
</box>
|
||||
);
|
||||
}
|
||||
|
||||
function FocusedClient() {
|
||||
const hypr = Hyprland.get_default();
|
||||
const focused = bind(hypr, "focusedClient");
|
||||
|
||||
return (
|
||||
<box className="FocusedClient" visible={focused.as(Boolean)}>
|
||||
{focused.as(client => {
|
||||
if (!client) return null;
|
||||
|
||||
return (
|
||||
<label
|
||||
label={bind(client, "title").as(title => {
|
||||
return title.length > 40
|
||||
? title.slice(0, 37) + "..."
|
||||
: title;
|
||||
})}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</box>
|
||||
);
|
||||
}
|
||||
function Time({ format = "%H:%M|%a %b %d" }) {
|
||||
const time = Variable<string>("").poll(1000, () =>
|
||||
GLib.DateTime.new_now_local().format(format)!
|
||||
);
|
||||
|
||||
return bind(time).as(str => {
|
||||
const [hm, date] = str.split("|");
|
||||
|
||||
return (
|
||||
<box className="Time">
|
||||
<label className="TimeHM" label={hm} />
|
||||
<label className="TimeDate" label={date} />
|
||||
</box>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export default function Bar(monitor: Gdk.Monitor) {
|
||||
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor
|
||||
|
||||
return <window
|
||||
className="Bar"
|
||||
gdkmonitor={monitor}
|
||||
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
||||
anchor={TOP | LEFT | RIGHT}>
|
||||
<centerbox>
|
||||
<box hexpand halign={Gtk.Align.START}>
|
||||
<Workspaces />
|
||||
<FocusedClient />
|
||||
</box>
|
||||
<box>
|
||||
<Time />
|
||||
</box>
|
||||
<box hexpand halign={Gtk.Align.END} >
|
||||
<SysTray />
|
||||
<Wifi />
|
||||
<AudioSlider />
|
||||
<BatteryLevel />
|
||||
</box>
|
||||
</centerbox>
|
||||
</window>
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.ags.homeManagerModules.default];
|
||||
|
||||
programs.ags = {
|
||||
enable = true;
|
||||
configDir = ./biscuit;
|
||||
|
||||
extraPackages = let
|
||||
agsPkgs = inputs.ags.packages.${system};
|
||||
in
|
||||
with pkgs; [
|
||||
agsPkgs.battery
|
||||
agsPkgs.hyprland
|
||||
agsPkgs.mpris
|
||||
agsPkgs.wireplumber
|
||||
agsPkgs.notifd
|
||||
agsPkgs.apps
|
||||
agsPkgs.network
|
||||
agsPkgs.tray
|
||||
fzf
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
{
|
||||
programs.fastfetch = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
logo = {
|
||||
padding = {
|
||||
top = 2;
|
||||
left = 1;
|
||||
right = 2;
|
||||
};
|
||||
};
|
||||
|
||||
display = {
|
||||
separator = " ";
|
||||
};
|
||||
|
||||
modules = [
|
||||
# Title
|
||||
{
|
||||
type = "title";
|
||||
format = "{#1}╭───────────── {#}{user-name-colored}";
|
||||
}
|
||||
|
||||
# System Information Header
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│ {#}System Information";
|
||||
}
|
||||
{
|
||||
type = "os";
|
||||
key = "│ {#keys} OS";
|
||||
}
|
||||
{
|
||||
type = "kernel";
|
||||
key = "│ {#keys} Kernel";
|
||||
}
|
||||
{
|
||||
type = "uptime";
|
||||
key = "│ {#keys} Uptime";
|
||||
}
|
||||
{
|
||||
type = "packages";
|
||||
key = "│ {#keys} Packages";
|
||||
format = "{all}";
|
||||
}
|
||||
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│";
|
||||
}
|
||||
|
||||
# Desktop Environment
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│ {#}Desktop Environment";
|
||||
}
|
||||
{
|
||||
type = "de";
|
||||
key = "│ {#keys} DE";
|
||||
}
|
||||
{
|
||||
type = "wm";
|
||||
key = "│ {#keys} WM";
|
||||
}
|
||||
{
|
||||
type = "wmtheme";
|
||||
key = "│ {#keys} Theme";
|
||||
}
|
||||
{
|
||||
type = "display";
|
||||
key = "│ {#keys} Resolution";
|
||||
}
|
||||
{
|
||||
type = "shell";
|
||||
key = "│ {#keys} Shell";
|
||||
}
|
||||
{
|
||||
type = "terminalfont";
|
||||
key = "│ {#keys} Font";
|
||||
}
|
||||
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│";
|
||||
}
|
||||
|
||||
# Hardware Information
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│ {#}Hardware Information";
|
||||
}
|
||||
{
|
||||
type = "cpu";
|
||||
key = "│ {#keys} CPU";
|
||||
}
|
||||
{
|
||||
type = "gpu";
|
||||
key = "│ {#keys} GPU";
|
||||
}
|
||||
{
|
||||
type = "memory";
|
||||
key = "│ {#keys} Memory";
|
||||
}
|
||||
{
|
||||
type = "disk";
|
||||
key = "│ {#keys} Disk (/)";
|
||||
folders = "/";
|
||||
}
|
||||
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}│";
|
||||
}
|
||||
|
||||
# Colors
|
||||
{
|
||||
type = "colors";
|
||||
key = "│";
|
||||
symbol = "circle";
|
||||
}
|
||||
|
||||
# Footer
|
||||
{
|
||||
type = "custom";
|
||||
format = "{#1}╰───────────────────────────────╯";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
programs.zoxide.enable = true;
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
fish_vi_key_bindings
|
||||
zoxide init fish | source
|
||||
|
||||
'';
|
||||
shellAliases = myConfig.general.terminal.Aliases;
|
||||
|
||||
plugins = with pkgs.fishPlugins; [
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{myConfig, ...}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
user.name = "${myConfig.general.gitProfile.User}";
|
||||
user.email = "${myConfig.general.gitProfile.Email}";
|
||||
init.defaultBranch = "${myConfig.general.gitProfile.defaultBranch}";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{...}: {
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on && agu"; # avoid needing to press a key twice to turn on the display.
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = 150;
|
||||
on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
||||
on-resume = "brightnessctl -r"; # restore monitor backlight.
|
||||
}
|
||||
{
|
||||
timeout = 150;
|
||||
on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; # turn off keyboard backlight.
|
||||
on-resume = "brightnessctl -rd rgb:kbd_backlight"; # turn on keyboard backlight.
|
||||
}
|
||||
{
|
||||
timeout = 300;
|
||||
on-timeout = "loginctl lock-session"; # lock screen when timeout has passed.
|
||||
}
|
||||
{
|
||||
timeout = 330;
|
||||
on-timeout = "hyprctl dispatch dpms off"; # screen off after 5.5min.
|
||||
on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on and restore brightness on resume.
|
||||
}
|
||||
{
|
||||
timeout = 500;
|
||||
on-timeout = "systemctl suspend"; # suspend PC after 30min.
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
{myConfig, ...}: {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
settings = {
|
||||
"$mod" = "SUPER";
|
||||
"$term" = "kitty --single-instance";
|
||||
"$browser" = "firefox";
|
||||
|
||||
monitor = myConfig.linux.hyprconf.Monitor;
|
||||
|
||||
exec-once = [
|
||||
"[workspace 20 silent] kitty --single-insance --hold fastfetch"
|
||||
"[workspace 20 silent] firefox"
|
||||
"[workspace 1] kitty --single-instance --hold fastfetch"
|
||||
"pkill gjs & ags run"
|
||||
"matugen image /home/${myConfig.general.Username}/.config/nixos/assets/wallpapers/ultrawide-nixos-default.png"
|
||||
"hyprctl setcursor Bibata-Original-Classic 24"
|
||||
"solaar -w hide"
|
||||
];
|
||||
|
||||
general = {
|
||||
gaps_in = 2;
|
||||
gaps_out = 5;
|
||||
border_size = 2;
|
||||
# col.active_border = "#0DB7D4FF";
|
||||
# col.inactive_border = "#31313600";
|
||||
# col = {
|
||||
# "inactive_border" = "rgba(595959aa)";
|
||||
# "active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
|
||||
# };
|
||||
resize_on_border = false;
|
||||
allow_tearing = false;
|
||||
layout = "dwindle";
|
||||
};
|
||||
decoration = {
|
||||
rounding = 0;
|
||||
rounding_power = 2;
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 1.0;
|
||||
|
||||
dim_inactive = true;
|
||||
dim_strength = 0.1;
|
||||
dim_special = 0.8;
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
color = "rgba(1a1a1aee)";
|
||||
};
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
vibrancy = 0.1696;
|
||||
};
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
bezier = [
|
||||
"linear, 0, 0, 1, 1"
|
||||
"md3_standard, 0.2, 0, 0, 1"
|
||||
"md3_decel, 0.05, 0.7, 0.1, 1"
|
||||
"md3_accel, 0.3, 0, 0.8, 0.15"
|
||||
"overshot, 0.05, 0.9, 0.1, 1.1"
|
||||
"crazyshot, 0.1, 1.5, 0.76, 0.92"
|
||||
"hyprnostretch, 0.05, 0.9, 0.1, 1.0"
|
||||
"menu_decel, 0.1, 1, 0, 1"
|
||||
"menu_accel, 0.38, 0.04, 1, 0.07"
|
||||
"easeInOutCirc, 0.85, 0, 0.15, 1"
|
||||
"easeOutCirc, 0, 0.55, 0.45, 1"
|
||||
"easeOutExpo, 0.16, 1, 0.3, 1"
|
||||
"softAcDecel, 0.26, 0.26, 0.15, 1"
|
||||
"md2, 0.4, 0, 0.2, 1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"windows, 1, 3, md3_decel, popin 60%"
|
||||
"windowsIn, 1, 3, md3_decel, popin 60%"
|
||||
"windowsOut, 1, 3, md3_accel, popin 60%"
|
||||
"border, 1, 10, default"
|
||||
"fade, 1, 3, md3_decel"
|
||||
"layersIn, 1, 3, menu_decel, slide"
|
||||
"layersOut, 1, 1.6, menu_accel"
|
||||
"fadeLayersIn, 1, 2, menu_decel"
|
||||
"fadeLayersOut, 1, 0.5, menu_accel"
|
||||
"workspaces, 1, 7, menu_decel, slide"
|
||||
"specialWorkspace, 1, 3, md3_decel, slidevert"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = true;
|
||||
preserve_split = true;
|
||||
};
|
||||
|
||||
master = {
|
||||
new_status = "master";
|
||||
};
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = -1;
|
||||
disable_hyprland_logo = true;
|
||||
};
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
follow_mouse = 1;
|
||||
sensitivity = 0;
|
||||
force_no_accel = true;
|
||||
repeat_delay = 250;
|
||||
repeat_rate = 35;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = false;
|
||||
};
|
||||
|
||||
numlock_by_default = true;
|
||||
};
|
||||
|
||||
gestures = {
|
||||
workspace_swipe = false;
|
||||
};
|
||||
|
||||
binds = {
|
||||
workspace_back_and_forth = true;
|
||||
scroll_event_delay = 0;
|
||||
};
|
||||
|
||||
device = [
|
||||
{
|
||||
name = "epic-mouse-v1";
|
||||
sensitivity = -0.5;
|
||||
}
|
||||
];
|
||||
|
||||
bind =
|
||||
[
|
||||
"$mod, Return, exec, $term"
|
||||
"$mod, Q, killactive,"
|
||||
"$mod, M, exit,"
|
||||
"$mod, E, exec, $fileManager"
|
||||
"$mod, V, togglefloating,"
|
||||
"$mod, R, exec, $menu"
|
||||
"$mod, P, pseudo,"
|
||||
"$mod, B, togglesplit,"
|
||||
"$mod, W, exec, $browser"
|
||||
|
||||
"$mod, H, movefocus, l"
|
||||
"$mod, L, movefocus, r"
|
||||
"$mod, K, movefocus, u"
|
||||
"$mod, J, movefocus, d"
|
||||
|
||||
"$mod SHIFT, K, movewindow, u"
|
||||
"$mod SHIFT, J, movewindow, d"
|
||||
"$mod SHIFT, H, movewindow, l"
|
||||
"$mod SHIFT, L, movewindow, r"
|
||||
|
||||
"$mod CTRL, K, resizeactive, 0 -50"
|
||||
"$mod CTRL, J, resizeactive, 0 50"
|
||||
"$mod CTRL, H, resizeactive, -50 0"
|
||||
"$mod CTRL, L, resizeactive, 50 0"
|
||||
|
||||
"$mod, S, togglespecialworkspace, magic"
|
||||
"$mod SHIFT, S, movetoworkspace, special:magic"
|
||||
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
"$mod, mouse_up, workspace, e-1"
|
||||
|
||||
"$mod, F, fullscreen, 0"
|
||||
|
||||
"$mod, Space, exec, pkill rofi || rofi -show drun"
|
||||
"$mod, C, exec, pkill rofi || rofi -show calc -modi calc -no-show-match -no-sort"
|
||||
]
|
||||
++ (
|
||||
# workspaces
|
||||
builtins.concatLists (builtins.genList (
|
||||
i: let
|
||||
ws = i + 1;
|
||||
in [
|
||||
"$mod, ${toString ws}, workspace, ${toString ws}"
|
||||
"$mod SHIFT, ${toString ws}, movetoworkspace, ${toString ws}"
|
||||
]
|
||||
)
|
||||
9)
|
||||
)
|
||||
++ [
|
||||
"$mod, 0, workspace, 10"
|
||||
"$mod, 0, movetoworkspace, 10"
|
||||
];
|
||||
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
bindel = [
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
",XF86MonBrightnessUp, exec, brightnessctl s 10%+"
|
||||
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
",XF86AudioNext, exec, playerctl next"
|
||||
",XF86AudioPause, exec, playerctl play-pause"
|
||||
",XF86AudioPlay, exec, playerctl play-pause"
|
||||
",XF86AudioPrev, exec, playerctl previous"
|
||||
];
|
||||
env = [
|
||||
"HYPRCURSOR_THEME, Bibata-Original-Classic"
|
||||
"HYPRCURSOR_SIZE, 24"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{...}: {
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{myConfig, ...}: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
themeFile = "kanagawa";
|
||||
settings = {
|
||||
confirm_os_window_close = 0;
|
||||
window_padding_width = 10;
|
||||
|
||||
font_size = myConfig.general.terminal.Size;
|
||||
font_family = myConfig.general.terminal.Font;
|
||||
bold_font = "auto";
|
||||
italic_font = "auto";
|
||||
bold_italic_font = "auto";
|
||||
|
||||
# optimization
|
||||
input_delay = 0;
|
||||
repaint_delay = 2;
|
||||
sync_to_monitor = false;
|
||||
wayland_enable_ime = false;
|
||||
allow_remote_control = true;
|
||||
};
|
||||
extraConfig = "include colors.conf";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{...}: {
|
||||
programs.mangohud = {
|
||||
enable = true;
|
||||
enableSessionWide = true;
|
||||
settings = {
|
||||
toggle_hud = "Shift_R+F12";
|
||||
|
||||
full = true;
|
||||
gpu_temp = true;
|
||||
cpu_temp = true;
|
||||
fps_only = false;
|
||||
|
||||
blacklist = [
|
||||
"pamac-manager"
|
||||
"lact"
|
||||
"ghb"
|
||||
"bitwig-studio"
|
||||
"ptyxis"
|
||||
"yumex"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
[config]
|
||||
# If set to enabled, it will check for updates when you run the matugen command, notifying you that an update is avaiable.
|
||||
# WARNING: Matugen needs to be compiled with the `update-informer` feature for this to work.
|
||||
version_check = false
|
||||
|
||||
[config.wallpaper]
|
||||
# The base command to run for applying the wallpaper, shouldn't have spaces in it.
|
||||
command = "swww"
|
||||
|
||||
# The arguments that will be provided to the command.
|
||||
# Keywords like {{ mode }} or anything that works inside of hooks doesn't work here.
|
||||
# The last argument will be the image path.
|
||||
arguments = ["img", "--transition-type", "center", "--transition-fps", "120"]
|
||||
|
||||
# For example, killing the wallpaper daemon. Usage is like a normal hook.
|
||||
# pre_hook = ""
|
||||
|
||||
[config.custom_keywords]
|
||||
test = "aaaa"
|
||||
|
||||
[templates.name1]
|
||||
# Relative paths will be resolved from the path `config.toml` is in.
|
||||
input_path = "./colors.whatever-extension"
|
||||
output_path = "./a/colors-generated.whatever-extension"
|
||||
|
||||
# This will use a different input path depending on what mode you use.
|
||||
# input_path_modes = { dark = "./colors.whatever-extension", light = "./colors.whatever-extension" }
|
||||
|
||||
# This will compare all of the colors inside the array with the color you set as `compare_to`, and returns the closest color to it.
|
||||
# You can then use `{{closest_color}}` inside templates and hooks.
|
||||
colors_to_compare = [
|
||||
{ name = "black", color = "#000000" },
|
||||
{ name = "red", color = "#ff0000" },
|
||||
{ name = "maroon", color = "#800000" },
|
||||
{ name = "yellow", color = "#ffff00" },
|
||||
{ name = "olive", color = "#808000" },
|
||||
{ name = "lime", color = "#00ff00" },
|
||||
{ name = "green", color = "#008000" },
|
||||
{ name = "aqua", color = "#00ffff" },
|
||||
{ name = "teal", color = "#008080" },
|
||||
{ name = "blue", color = "#0000ff" },
|
||||
{ name = "navy", color = "#000080" },
|
||||
{ name = "fuchsia", color = "#ff00ff" },
|
||||
{ name = "purple", color = "#800080" },
|
||||
]
|
||||
compare_to = "{{colors.primary.default.hex}}"
|
||||
|
||||
# Runs before the template is exported. You can use keywords here,
|
||||
pre_hook = 'echo "source color {{colors.source_color.default.hex}}, source image {{image}}, closest color {{closest_color}}"'
|
||||
# Runs after the template is exported. You can use keywords here.
|
||||
post_hook = 'echo "after gen"'
|
||||
|
||||
# Only hex values
|
||||
# https://m3.material.io/styles/color/advanced/adjust-existing-colors#1cc12e43-237b-45b9-8fe0-9a3549c1f61e
|
||||
# Blend is set to true by default.
|
||||
[config.custom_colors]
|
||||
green = "#00ff00"
|
||||
red = "#ff0000"
|
||||
blue = { color = "#0000ff", blend = false }
|
||||
|
||||
### --- my config
|
||||
[templates.kitty]
|
||||
input_path = '~/.config/nixos/pkgs/matugen/custom/templates/kitty.conf'
|
||||
output_path = '~/.config/kitty/colors.conf'
|
||||
post_hook = "kitty @ set-colors -a -c ~/.config/kitty/colors.conf"
|
||||
|
||||
[templates.ags]
|
||||
input_path = '~/.config/nixos/pkgs/matugen/custom/templates/ags.scss'
|
||||
output_path = '~/.config/nixos/pkgs/ags/biscuit/colors.scss'
|
||||
post_hook = "pkill gjs & ags run ~/.config/nixos/pkgs/ags/biscuit/app.ts & disown (jobs -p) &"
|
||||
@@ -0,0 +1,3 @@
|
||||
$background: {{colors.surface.dark.hex}};
|
||||
$foreground: {{colors.on_surface.dark.hex}};
|
||||
$primary: {{colors.primary.dark.hex}};
|
||||
@@ -0,0 +1,41 @@
|
||||
cursor {{colors.on_surface.default.hex}}
|
||||
cursor_text_color {{colors.on_surface_variant.default.hex}}
|
||||
|
||||
foreground {{colors.on_surface.default.hex}}
|
||||
background {{colors.surface.default.hex}}
|
||||
selection_foreground {{colors.on_secondary.default.hex}}
|
||||
selection_background {{colors.secondary_fixed_dim.default.hex}}
|
||||
url_color {{colors.primary.default.hex}}
|
||||
|
||||
# black
|
||||
color8 #262626
|
||||
color0 #4c4c4c
|
||||
|
||||
# red
|
||||
color1 #ac8a8c
|
||||
color9 #c49ea0
|
||||
|
||||
# green
|
||||
color2 #8aac8b
|
||||
color10 #9ec49f
|
||||
|
||||
# yellow
|
||||
color3 #aca98a
|
||||
color11 #c4c19e
|
||||
|
||||
# blue
|
||||
/* color4 #8f8aac */
|
||||
color4 {{colors.primary.default.hex}}
|
||||
color12 #a39ec4
|
||||
|
||||
# magenta
|
||||
color5 #ac8aac
|
||||
color13 #c49ec4
|
||||
|
||||
# cyan
|
||||
color6 #8aacab
|
||||
color14 #9ec3c4
|
||||
|
||||
# white
|
||||
color15 #e7e7e7
|
||||
color7 #f0f0f0
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.matugen.nixosModules.default];
|
||||
home.file.".config/matugen/config.toml" = {
|
||||
source = builtins.toPath ./custom/config.toml;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
nixovim = inputs.nixovim.packages.${pkgs.system}.default;
|
||||
in {
|
||||
home.packages = [
|
||||
nixovim
|
||||
pkgs.lazygit
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{pkgs, ...}: {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
plugins = with pkgs; [
|
||||
rofi-calc
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{lib, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = lib.concatStrings [
|
||||
"$username"
|
||||
"$hostname"
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_state"
|
||||
"$git_status"
|
||||
"$cmd_duration"
|
||||
"$line_break"
|
||||
"$python"
|
||||
"$character"
|
||||
];
|
||||
|
||||
directory = {
|
||||
style = "blue";
|
||||
};
|
||||
|
||||
character = {
|
||||
success_symbol = "[→](purple)";
|
||||
error_symbol = "[→](red)";
|
||||
vimcmd_symbol = "[←](green)";
|
||||
};
|
||||
|
||||
git_branch = {
|
||||
format = "[$branch]($style)";
|
||||
style = "bright-black";
|
||||
};
|
||||
git_status = {
|
||||
format = "[(*$conflicted$untracked$modified$staged$renamed$deleted) $ahead_behind$stashed]($style)";
|
||||
style = "cyan";
|
||||
conflicted = "";
|
||||
untracked = "";
|
||||
modified = "";
|
||||
staged = "";
|
||||
renamed = "";
|
||||
deleted = "";
|
||||
stashed = "≡";
|
||||
};
|
||||
git_state = {
|
||||
format = "([$state( $progress_current/$progress_total)]($style)) ";
|
||||
style = "bright-black";
|
||||
};
|
||||
|
||||
cmd_duration = {
|
||||
format = "[$duration]($style) ";
|
||||
style = "yellow";
|
||||
};
|
||||
|
||||
python = {
|
||||
format = "[$virtualenv]($style) ";
|
||||
style = "bright-black";
|
||||
};
|
||||
};
|
||||
};
|
||||
# home.file.".config/starship.toml" = {
|
||||
# source = builtins.toPath ./pure.toml;
|
||||
# };
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{...}: {
|
||||
services.swww.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
zoxide
|
||||
];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
programs.zoxide.enable = true;
|
||||
|
||||
programs.zsh = {
|
||||
enableCompletion = false;
|
||||
syntaxHighlighting.enable = false;
|
||||
shellAliases = myConfig.general.terminal.Aliases;
|
||||
history.size = 10000;
|
||||
antidote = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"MichaelAquilina/zsh-autoswitch-virtualenv"
|
||||
"jeffreytse/zsh-vi-mode"
|
||||
"zdharma-continuum/fast-syntax-highlighting kind:defer"
|
||||
"zsh-users/zsh-autosuggestions kind:defer"
|
||||
"zsh-users/zsh-history-substring-search kind:defer"
|
||||
];
|
||||
};
|
||||
initContent = ''
|
||||
# zsh-autocomplete
|
||||
# bindkey -M menuselect '^M' .accept-line # run code when selected completion
|
||||
|
||||
autoload -Uz compinit
|
||||
if [ "$(date +'%j')" != "$(stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)" ]; then
|
||||
compinit
|
||||
else
|
||||
compinit -C
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user