trying flakes and restructuring slowly

This commit is contained in:
2021-04-29 04:13:34 +05:30
parent c67dc7dd34
commit 58cfa66af5
9 changed files with 153 additions and 39 deletions

View File

@@ -1,17 +1,16 @@
{lib,stdenv,fetchFromGitHub}:
stdenv.mkDerivation rec{
name = "customscripts";
src = ./scripts;
src = fetchFromGitHub {
owner = "idcretard";
repo = "custom-scripts";
rev = "a996a52831316cc2c282904352654bd20c82f7bd";
sha256 = "sha256-nw21YmcmQMF8NADnuHOc7eF2Yaj/r/1mYBn77fYK7s8=";
};
unpackPhase = ":";
installPhase = ''
mkdir -p $out/bin
cp -r $src/* $out/bin
for x in $out/bin/*;do chmod +x "$x";done
'';
# src = fetchFromGitHub {
# owner = "idcretard";
# repo = "custom-scripts";
# rev = "86eaba74a01c8bafd8c81885eddbe9cd6f381e64";
# sha256 = "1g1z3mlp7h2ig1rmgabsbhcdnpgy65yki0dj3pr100jw202i6jqq";
# };
}

View File

@@ -4,37 +4,5 @@
environment.systemPackages = with pkgs; [
(callPackage ./customscripts.nix {})
(callPackage ./mpd_discord_richpresence.nix {})
(dwm.overrideAttrs (oldAttrs: rec {src = ./dwm;}))
(st.overrideAttrs (oldAttrs: rec {src = ./st;}))
(dmenu.overrideAttrs (oldAttrs: rec {
configFile = writeText "config.def.h" (builtins.readFile ./dmenu/config.def.h);
postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h";
}))
(kbd.overrideAttrs (oldAttrs: rec{
buildInputs = oldAttrs.buildInputs ++ [ gzip ];
colemak-dh = writeText "colemak-dh.map" (builtins.readFile ./colemak-dh.map);
postInstall = "${oldAttrs.postInstall}\n cp ${colemak-dh} $out/share/keymaps/i386/colemak/colemak-dh.map\n gzip $out/share/keymaps/i386/colemak/colemak-dh.map";
}))
(picom.overrideAttrs (oldAttrs: rec{
version = "Next";
src = fetchFromGitHub {
owner = "yshui";
repo = "picom";
rev = "v${version}";
sha256 = "0asp2hg1jx909kl7i876mcx00vwg9w2swr9i6d786iwgs247dc9i";
fetchSubmodules = true;
};
}))
ncmpcpp
];
nixpkgs.overlays = [
( self: super:
{
ncmpcpp = super.ncmpcpp.override {
visualizerSupport = true;
clockSupport = true;
};
}
)
];
}

60
flake.lock generated Normal file
View File

@@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1619345332,
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1619464443,
"narHash": "sha256-R7WAb8EnkIJxxaF6GTHUPytjonhB4Zm0iatyWoW169A=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"stable": "stable"
}
},
"stable": {
"locked": {
"lastModified": 1619486598,
"narHash": "sha256-ZEvJ+uItcKLQ9uSjGbQFE6Euu9w1Y98x0TWydXIgHAI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d4e7af972158a14ebdd9c828b1c2e07e2ce7ef1c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-20.09",
"repo": "nixpkgs",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@@ -0,0 +1,27 @@
{
inputs = {
stable.url = "github:nixos/nixpkgs/nixos-20.09";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = inputs@{self, nixpkgs, stable, flake-utils,... }:
let
system = "x86_64-linux";
in
{
overlays = {
overridesandshit = import ./overlays/overridesandshit.nix;
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = builtins.attrValues self.overlays;
};
nixosConfigurations.nixchod = nixpkgs.lib.nixosSystem {
system = "${system}";
modules = [
./configuration.nix
{ nixpkgs.pkgs = self.pkgs; }
];
};
};
}

View File

@@ -0,0 +1,47 @@
final: prev: {
dmenu = prev.dmenu.overrideAttrs (oldAttrs: rec {
configFile = prev.writeText "config.def.h" (builtins.readFile ./dmenu/config.def.h);
postPatch = "${oldAttrs.postPatch}\n cp ${configFile} config.def.h";
});
ncmpcpp = prev.ncmpcpp.override {
visualizerSupport = true;
clockSupport = true;
};
dwm = prev.dwm.overrideAttrs (oldAttrs: rec {
src = prev.fetchFromGitHub {
owner = "natto1784";
repo = "dwm";
rev = "cd69bb00b0ecd941cdb5d048df029f3b762eea8c";
sha256 = "sha256-dZyF7GnVJZzzAy8DO2pqCoIj7t1vZLdfhHm1cJKXah0=";
};
});
st = prev.st.overrideAttrs (oldAttrs: rec {
src = prev.fetchFromGitHub {
owner = "natto1784";
repo = "st";
rev = "0cd1e394e6d07c5f605ae23070c40de9690bafb1";
sha256 = "sha256-EY5Amz16Drc4i0uEAYTPEHcGex0s3pzHDqfDp4Z5OGY=";
};
});
kbd = prev.kbd.overrideAttrs (oldAttrs: rec{
buildInputs = oldAttrs.buildInputs ++ [ prev.gzip ];
colemak-dh = prev.writeText "colemak-dh.map" (builtins.readFile ./colemak-dh.map);
postInstall = "${oldAttrs.postInstall}\n cp ${colemak-dh} $out/share/keymaps/i386/colemak/colemak-dh.map\n gzip $out/share/keymaps/i386/colemak/colemak-dh.map";
});
picom = prev.picom.overrideAttrs (oldAttrs: rec{
version = "Next";
src = prev.fetchFromGitHub {
owner = "yshui";
repo = "picom";
rev = "v${version}";
sha256 = "0asp2hg1jx909kl7i876mcx00vwg9w2swr9i6d786iwgs247dc9i";
fetchSubmodules = true;
};
});
}

View File

@@ -44,6 +44,12 @@
feh
sxiv
mpv
dwm
dmenu
st
kbd
picom
ncmpcpp
];
programs.steam.enable = true;
nix = {

7
test.nix Normal file
View File

@@ -0,0 +1,7 @@
self: super: {
ncmpcpp = super.ncmpcpp.override {
visualizerSupport = true;
clockSupport = true;
};
}