summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--default.nix54
-rw-r--r--flake.nix23
-rw-r--r--nix/sources.json4
-rw-r--r--pkgs/default.nix48
4 files changed, 81 insertions, 48 deletions
diff --git a/default.nix b/default.nix
index 02d46e1..7fe02b6 100644
--- a/default.nix
+++ b/default.nix
@@ -1,52 +1,14 @@
-{ pkgs ? import sources.nixpkgs { }
+{ pkgs ? import sources.nixpkgs {
+ overlays = [
+ (import "${sources.sensors}/pkgs")
+ (import "${sources.sh}/pkgs")
+ (import ./pkgs)
+ ];
+ }
, sources ? import ./nix/sources.nix
}:
let
- haskellPackages = pkgs.haskellPackages.override {
- overrides = self: super: {
- astatusbar = (self.callCabal2nix "astatusbar" ./. { }).overrideAttrs (oldAttrs: {
- nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ];
- postInstall = oldAttrs.postInstall or "" + ''
- exe=${oldAttrs.pname}
- installShellCompletion --cmd $exe \
- --bash <($out/bin/$exe --bash-completion-script $out/bin/$exe) \
- --fish <($out/bin/$exe --fish-completion-script $out/bin/$exe) \
- --zsh <($out/bin/$exe --zsh-completion-script $out/bin/$exe)
- '';
- });
- sensors = pkgs.haskell.lib.dontCheck (self.callCabal2nix "sensors" sources.sensors { });
- sh = pkgs.haskell.lib.dontCheck (self.callCabal2nix "sh" sources.sh { });
- statvfs = pkgs.haskell.lib.markUnbroken (super.statvfs.overrideAttrs (oldAtts: {
- patches = [
- (pkgs.writers.writeText "statvfs.patch" ''
- diff --git a/Setup.hs b/Setup.hs
- index 7cf9bfd..54f57d6 100644
- --- a/Setup.hs
- +++ b/Setup.hs
- @@ -3,4 +3,4 @@ module Main (main) where
- import Distribution.Simple
-
- main :: IO ()
- -main = defaultMainWithHooks defaultUserHooks
- +main = defaultMainWithHooks autoconfUserHooks
- '')
- ];
- }));
- # XXX we don't need to depend on patched X11 anymore
- X11 = (self.callCabal2nix "X11"
- (pkgs.fetchFromGitHub {
- owner = "aforemny";
- repo = "X11";
- rev = "70d7a6fba00d4ffe65db90cd3a2e0883ca690a88";
- hash = "sha256-PsRtqaTyo+z8uPpsr7G3a0WF3Wh1NTWumu0rFlkLJMM=";
- })
- { }).overrideAttrs (oldAttrs: {
- preConfigure = oldAttrs.preConfigure or "" + ''
- ${pkgs.autoconf}/bin/autoreconf
- '';
- });
- };
- };
+ inherit (pkgs) haskellPackages;
in
rec {
inherit haskellPackages;
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..aa62dab
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,23 @@
+{
+ description = "A very basic flake";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs?ref=release-25.05";
+ sh.url = "git+ssh://git@code.nomath.org/~/sh?ref=main";
+ sensors.url = "git+ssh://git@code.nomath.org/~/sensors?ref=main";
+ };
+
+ outputs = { self, nixpkgs, sensors, sh }: {
+
+ packages.x86_64-linux.astatusbar = (import ./. {
+ sources = {
+ nixpkgs = nixpkgs;
+ sh = sh;
+ sensors = sensors;
+ };
+ }).astatusbar;
+
+ packages.x86_64-linux.default = self.packages.x86_64-linux.astatusbar;
+
+ };
+}
diff --git a/nix/sources.json b/nix/sources.json
index db8a77a..57b333a 100644
--- a/nix/sources.json
+++ b/nix/sources.json
@@ -14,13 +14,13 @@
"sensors": {
"branch": "main",
"repo": "git@code.nomath.org:~/sensors",
- "rev": "73fd306b757c5f288f7de6bb2d3adaf7a7cf501e",
+ "rev": "0fe8c4f15f033c7536f2d4176999d9a64199587f",
"type": "git"
},
"sh": {
"branch": "main",
"repo": "git@code.nomath.org:~/sh",
- "rev": "3ea4e6459333409c60f66a5745bb472d136da741",
+ "rev": "32efed2f63389fab5176e160358471913d5208df",
"type": "git"
}
}
diff --git a/pkgs/default.nix b/pkgs/default.nix
new file mode 100644
index 0000000..0258557
--- /dev/null
+++ b/pkgs/default.nix
@@ -0,0 +1,48 @@
+self: super: {
+ haskell = super.haskell // {
+ packageOverrides = self.lib.composeExtensions super.haskell.packageOverrides ( let
+ inherit (self) pkgs;
+ in
+ self: super: {
+ astatusbar = (self.callCabal2nix "astatusbar" ./.. { }).overrideAttrs (oldAttrs: {
+ nativeBuildInputs = oldAttrs.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ];
+ postInstall = oldAttrs.postInstall or "" + ''
+ exe=${oldAttrs.pname}
+ installShellCompletion --cmd $exe \
+ --bash <($out/bin/$exe --bash-completion-script $out/bin/$exe) \
+ --fish <($out/bin/$exe --fish-completion-script $out/bin/$exe) \
+ --zsh <($out/bin/$exe --zsh-completion-script $out/bin/$exe)
+ '';
+ });
+ statvfs = pkgs.haskell.lib.markUnbroken (super.statvfs.overrideAttrs (oldAtts: {
+ patches = [
+ (pkgs.writers.writeText "statvfs.patch" ''
+ diff --git a/Setup.hs b/Setup.hs
+ index 7cf9bfd..54f57d6 100644
+ --- a/Setup.hs
+ +++ b/Setup.hs
+ @@ -3,4 +3,4 @@ module Main (main) where
+ import Distribution.Simple
+
+ main :: IO ()
+ -main = defaultMainWithHooks defaultUserHooks
+ +main = defaultMainWithHooks autoconfUserHooks
+ '')
+ ];
+ }));
+ # XXX we don't need to depend on patched X11 anymore
+ X11 = (self.callCabal2nix "X11"
+ (pkgs.fetchFromGitHub {
+ owner = "aforemny";
+ repo = "X11";
+ rev = "70d7a6fba00d4ffe65db90cd3a2e0883ca690a88";
+ hash = "sha256-PsRtqaTyo+z8uPpsr7G3a0WF3Wh1NTWumu0rFlkLJMM=";
+ })
+ { }).overrideAttrs (oldAttrs: {
+ preConfigure = oldAttrs.preConfigure or "" + ''
+ ${pkgs.autoconf}/bin/autoreconf
+ '';
+ });
+ });
+ };
+}