Compare commits

...

5 commits

Author SHA1 Message Date
Bruno BELANYI 4a86d0bb44 project: add README 2021-10-08 14:42:46 +02:00
Bruno BELANYI dbc10b5066 git: add ignore file 2021-10-08 14:42:46 +02:00
Bruno BELANYI 49658de1d8 nix: add direnv integration 2021-10-08 14:42:46 +02:00
Bruno BELANYI 7c6a5e58cc project: add LICENSE 2021-10-08 14:42:46 +02:00
Bruno BELANYI a968e4f761 nix: add flake 2021-10-08 14:42:46 +02:00
6 changed files with 238 additions and 0 deletions

7
.envrc Normal file
View file

@ -0,0 +1,7 @@
use_flake() {
watch_file flake.nix
watch_file flake.lock
eval "$(nix print-dev-env)"
}
use flake

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
# Nix files
/result
/.pre-commit-config.yaml
# Qt files
/Makefile
/.qmake.stash

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

14
README.md Normal file
View file

@ -0,0 +1,14 @@
# `dragger`
Drag files from CLI, without the need to open a GUI.
## Usage
Simply issue the command:
```bash
dragger [FILES...]
```
`dragger` will initiate a drag-and-drop operation for all files and directories
provided as arguments.

69
flake.lock Normal file
View file

@ -0,0 +1,69 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "master",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1633329294,
"narHash": "sha256-0LpQLS4KMgxslMgmDHmxG/5twFlXDBW9z4Or1iOrCvU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee084c02040e864eeeb4cf4f8538d92f7c675671",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1631170176,
"narHash": "sha256-RLN/kur2Kpxt0cJp0Fms8ixuGpT8IHX0OpeQ8u8f0X4=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "3ed0e618cebc1ff291c27b749cf7568959cac028",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "master",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}

120
flake.nix Normal file
View file

@ -0,0 +1,120 @@
{
description = "A CLI drag-and-drop tool";
inputs = {
flake-utils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
ref = "master";
};
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixpkgs-unstable";
};
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{ self
, flake-utils
, nixpkgs
, pre-commit-hooks
}:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in
rec {
apps = {
dragger = flake-utils.lib.mkApp { drv = packages.dragger; };
};
checks = {
pre-commit = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
clang-format = {
enable = true;
name = "clang-format";
entry = "${pkgs.clang-tools}/bin/clang-format -style=file -i";
types = [ "text" "c++" ];
language = "system";
};
nixpkgs-fmt = {
enable = true;
};
};
};
};
defaultApp = apps.dragger;
defaultPackage = packages.dragger;
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ ]
++ defaultPackage.nativeBuildInputs
++ defaultPackage.buildInputs
;
inherit (checks.pre-commit) shellHook;
};
packages = {
inherit (pkgs) dragger;
};
}) // {
overlay = final: prev: {
dragger = with final; stdenv.mkDerivation {
pname = "dragger";
version = "0.1.0";
src = self;
buildInputs = [
libsForQt5.qt5.qtbase
];
nativeBuildInputs = [
libsForQt5.qt5.wrapQtAppsHook
];
configurePhase = ''
qmake
'';
installPhase = ''
mkdir -p $out/bin
cp dragger $out/bin
'';
meta = with lib; {
description = "A CLI drag-and-drop tool";
homepage = "https://gitea.belanyi.fr/ambroisie/dragger";
license = licenses.mit;
maintainers = [ ambroisie ];
platforms = platforms.all;
};
};
};
};
}