Compare commits

..

2 commits

Author SHA1 Message Date
6cac9efb08
flake.nix: init yazi
Some checks failed
deploy systems / deploy (push) Has been cancelled
flake check / check (push) Successful in 4m18s
fmt check / check (push) Successful in 1m14s
2024-01-17 13:34:21 -05:00
811fcca228
home: init yazi 2024-01-17 13:34:08 -05:00
5 changed files with 240 additions and 73 deletions

View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1704549352, "lastModified": 1705439375,
"narHash": "sha256-fUwtVfjpkEtpQE2xwCTIgtmJzJSegFvNKsoZABDMvX4=", "narHash": "sha256-C3LAdGResLyo7bdd92bP7bOURC/qf12I0yf2GqiwQQI=",
"owner": "Aylur", "owner": "Aylur",
"repo": "ags", "repo": "ags",
"rev": "dcb24f887efc3d0dbf291c75da05b19221bfdee4", "rev": "1813f51a16de3079bbf0c77a9175865b25781bbe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -91,11 +91,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1703087360, "lastModified": 1704875591,
"narHash": "sha256-0VUbWBW8VyiDRuimMuLsEO4elGuUw/nc2WDeuO1eN1M=", "narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "b709d63debafce9f5645a5ba550c9e0983b3d1f7", "rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -162,11 +162,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1704152458, "lastModified": 1704982712,
"narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "88a2cd8166694ba0b6cb374700799cec53aef527", "rev": "07f6395285469419cf9d078f59b5b49993198c00",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -190,6 +190,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -197,11 +215,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704498488, "lastModified": 1705446327,
"narHash": "sha256-yINKdShHrtjdiJhov+q0s3Y3B830ujRoSbHduUNyKag=", "narHash": "sha256-n7FCuAR2BI1SvLjF6eFc8VE6WLZCMlbToyfqU2ihbkU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "51e44a13acea71b36245e8bd8c7db53e0a3e61ee", "rev": "16cefa78cc801911ebd4ff1faddc6280ab3c9228",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -219,11 +237,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1704647751, "lastModified": 1705499018,
"narHash": "sha256-w2Tg80tZKn9eIzcOs1SlIYvYiqb7I7t516+QMwmkzkY=", "narHash": "sha256-qPtVOlhcUm6zVXu6m/4MVuoEQYDvZbl3OAZQyMIKEh0=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "9f2bde925bde09b4820a2cef369e9ddd930a746b", "rev": "307dd8f511ab51dbf0900d16f29d66db8b619158",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -239,11 +257,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704501043, "lastModified": 1705365088,
"narHash": "sha256-ZjaDk2zx2210KQgzbNmx7Ang1kkxIFdfN1tWGjK/gVc=", "narHash": "sha256-G7+AbC2wRhwpZEcKmjpGNoYUp4vX9QRp6OcCEZUnBgw=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-plugins", "repo": "hyprland-plugins",
"rev": "23708e7ad859d02902b58abae518abc5c11b4172", "rev": "d26370cf2dddd2675ae3f4eef2dbf0ebec1a3c53",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -279,7 +297,11 @@
}, },
"hyprlang": { "hyprlang": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1704287638, "lastModified": 1704287638,
@ -302,11 +324,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1703024852, "lastModified": 1705251288,
"narHash": "sha256-mVJ/99zkqpqDDs68jYIVYyQH6NBgciKnUg8AfWyXSAM=", "narHash": "sha256-TwCR7tZvrjsvz6SmgjWYOne7Qz7J2jn4Cr4Er0Yj+LA=",
"owner": "viperML", "owner": "viperML",
"repo": "nh", "repo": "nh",
"rev": "37b0d469a328a5b5969eacdf137f1e6b86c75a1d", "rev": "36eba281576afe0f67e5aafb4e7a414f256dba31",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -318,14 +340,14 @@
"nix-gaming": { "nix-gaming": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1704590450, "lastModified": 1705434512,
"narHash": "sha256-9wUJ0irPrkukEUiqjXQev961l0sa0vgNlu9SW4GDV+E=", "narHash": "sha256-bQJjtlHWU5aOnEtbZfMRuqXvHd5ufQEVATDY0gN4ZCA=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "7a393401bd9212a5635e82dede0198d3e9602d41", "rev": "e2abe296c5fb4673207e0c2b45b12507629970e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -341,11 +363,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704596958, "lastModified": 1705282324,
"narHash": "sha256-BK3Ohsz7m8X6qVKFxDtr8KVcHipfr5hYE9PDIJevHbQ=", "narHash": "sha256-LnURMA7yCM5t7et9O2+2YfGQh0FKAfE5GyahNDDzJVM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "f46800ac5a6e9f892fe36e50821c5d85794ecc62", "rev": "49aaeecf41ae0a0944e2c627cb515bcde428a1d1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -406,11 +428,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1704290814, "lastModified": 1705033721,
"narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -438,11 +460,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1704194953, "lastModified": 1705133751,
"narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -454,27 +476,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1702645756, "lastModified": 1704842529,
"narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1704161960,
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "63143ac2c9186be6d9da6035fa22620018c85932", "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -484,13 +490,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1704194953, "lastModified": 1705316053,
"narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -500,13 +506,29 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": {
"locked": {
"lastModified": 1701174899,
"narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1704645857, "lastModified": 1705499802,
"narHash": "sha256-YRFry+uleoeDKs0kr039eVCN5XSCOuUbgbyKMJRXeFY=", "narHash": "sha256-zOLnIFP2NUKG9Ny6rw0xmcxLdUGUTtKffW3R0t/TXzw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "e72bc8a4fff841c6a131fe40471e4ae401f31096", "rev": "0482c9dbc4e0f18340a6efe2c52b77800435fc68",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -527,9 +549,35 @@
"nh": "nh", "nh": "nh",
"nix-gaming": "nix-gaming", "nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_5",
"nur": "nur", "nur": "nur",
"sops-nix": "sops-nix" "sops-nix": "sops-nix",
"yazi": "yazi"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"yazi",
"flake-utils"
],
"nixpkgs": [
"yazi",
"nixpkgs"
]
},
"locked": {
"lastModified": 1701224160,
"narHash": "sha256-qnMmxNMKmd6Soel0cfauyMJ+LzuZbvmiDQPSIuTbQ+M=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "4a080e26d55eaedb95ab1bf8eeaeb84149c10f12",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
} }
}, },
"sops-nix": { "sops-nix": {
@ -540,11 +588,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1704596510, "lastModified": 1705356877,
"narHash": "sha256-tupdwwg1WeX2hNMOQrvtyafTaTVty0QC/gQp7yaYJic=", "narHash": "sha256-274jL1cH64DcXUXebVMZBRUsTs3FvFlPIPkCN/yhSnI=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "f5fbcc0f50e7fc60c4f806fa7a09abccf0826d8a", "rev": "87755331580fdf23df7e39b46d63ac88236bf42c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -583,6 +631,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": { "utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -637,11 +700,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704400467, "lastModified": 1704659450,
"narHash": "sha256-IsEAKBCorRlN53FwFAMbyGLRsPVu/ZrWEJtCwykPds8=", "narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "1c802128f6cc3db29a8ef01552b1a22f894eeefd", "rev": "6a5de92769d5b7038134044053f90e7458f6a197",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -649,6 +712,26 @@
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"type": "github" "type": "github"
} }
},
"yazi": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_6",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1705509964,
"narHash": "sha256-gFMFoZYFfMHibW+28xqgQWKojOzz5tEJtGEIHmkxmZY=",
"owner": "sxyazi",
"repo": "yazi",
"rev": "d41cd5684e03eaa80e9201a114ad51f966bb56b7",
"type": "github"
},
"original": {
"owner": "sxyazi",
"repo": "yazi",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -2,14 +2,13 @@
description = "snowflake"; description = "snowflake";
inputs = { inputs = {
nixpkgs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
url = "github:nixos/nixpkgs/nixos-unstable";
};
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
ags.url = "github:Aylur/ags"; ags.url = "github:Aylur/ags";
nix-gaming.url = "github:fufexan/nix-gaming"; nix-gaming.url = "github:fufexan/nix-gaming";
attic.url = "github:zhaofengli/attic"; attic.url = "github:zhaofengli/attic";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
yazi.url = "github:sxyazi/yazi";
hyprland-plugins = { hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins"; url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland"; inputs.hyprland.follows = "hyprland";

View file

@ -7,6 +7,7 @@
./git ./git
./lazygit ./lazygit
./direnv ./direnv
./yazi
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -25,7 +26,6 @@
dig dig
tailspin tailspin
nitch nitch
joshuto
]; ];
services.gpg-agent = { services.gpg-agent = {

47
home/yazi/default.nix Normal file
View file

@ -0,0 +1,47 @@
{
config,
pkgs,
...
}: {
xdg.configFile."yazi/init.lua".source = ./init.lua;
# imports = [./keymap.nix];
home.packages = [pkgs.exiftool];
programs.yazi = {
enable = true;
package = pkgs.yazi;
enableNushellIntegration = true;
settings = {
manager = {
ratio = [1 3 2];
sort_by = "natural";
sort_reverse = false;
sort_dir_first = true;
show_hidden = true;
show_symlink = true;
linemode = "size";
};
preview = {
cache_dir = "${config.xdg.cacheHome}";
max_height = 900;
max_width = 600;
};
open.rules = [
{
mime = "image/*";
use = ["image"];
}
];
opener = {
image = [
{
exec = ''imv "$@" '';
block = true;
for = "linux";
}
];
};
log.enable = false;
};
};
}

38
home/yazi/init.lua Normal file
View file

@ -0,0 +1,38 @@
function Manager:render(area)
self.area = area
local chunks = ui.Layout()
:direction(ui.Layout.HORIZONTAL)
:constraints({
ui.Constraint.Ratio(MANAGER.ratio.parent, MANAGER.ratio.all),
ui.Constraint.Ratio(MANAGER.ratio.current, MANAGER.ratio.all),
ui.Constraint.Ratio(MANAGER.ratio.preview, MANAGER.ratio.all),
})
:split(area)
local bar = function(c, x, y)
return ui.Bar(
ui.Rect { x = math.max(0, x), y = math.max(0, y), w = math.min(1, area.w), h = math.min(1, area.h) },
ui.Bar.TOP
):symbol(c)
end
return ya.flat {
-- Borders
ui.Border(area, ui.Border.ALL):type(ui.Border.ROUNDED),
ui.Bar(chunks[1], ui.Bar.RIGHT),
ui.Bar(chunks[3], ui.Bar.LEFT),
bar("", chunks[1].right - 1, chunks[1].y),
bar("", chunks[1].right - 1, chunks[1].bottom - 1),
bar("", chunks[2].right, chunks[2].y),
bar("", chunks[2].right, chunks[1].bottom - 1),
-- Parent
Parent:render(chunks[1]:padding(ui.Padding.xy(1))),
-- Current
Current:render(chunks[2]:padding(ui.Padding.y(1))),
-- Preview
Preview:render(chunks[3]:padding(ui.Padding.xy(1))),
}
end