1
0
Fork 0

Change to 19.09 remove unstable

This commit is contained in:
Malte Brandy 2019-10-20 05:28:54 +02:00
parent d0d8fe4ab4
commit e98e7ad857
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
11 changed files with 51 additions and 2300 deletions

View file

@ -6,16 +6,15 @@ let
name = "sleep-nag";
imports = [
"Data.Time.LocalTime"
"Control.Monad"
"Data.Function"
"Control.Concurrent"
"Data.Functor"
];
bins = [ eventd ];
} ''
main = go
where
go = do
tod <- getZonedTime & fmap (localTimeOfDay . zonedTimeToLocalTime)
tod <- getZonedTime <&> localTimeOfDay . zonedTimeToLocalTime
when (todHour tod < 6 || todHour tod >= 23) $ eventc "notification" "kassandra" "-d" ([i|title='Es ist #{todHour tod}:#{todMin tod} Uhr: Zeit ins Bett zu gehen!'|]::String) "-d" "message='Du kannst das hier auch morgen tun!'"
threadDelay 600000000
go

View file

@ -19,31 +19,35 @@ rec {
"white" = "#dddbff";
"brightWhite" = "#ffffff";
};
pkgs = import <nixpkgs> {
};
pkgs = import <nixpkgs> { };
unstable = import <unstable> { };
sources = import ../nix/sources.nix;
unBreak = pkg:
unstable.haskell.lib.overrideCabal pkg (drv: {
pkgs.haskell.lib.overrideCabal pkg (drv: {
broken = false;
doCheck = false;
});
shh = unBreak unstable.haskellPackages.shh;
ghc = unstable.ghc.withPackages
shh = unBreak pkgs.haskellPackages.shh;
ghc = pkgs.ghc.withPackages
(p: [ (unBreak p.shh) p.brittany p.hlint p.ghcid p.cabal-install ]);
haskellList = list: ''["${builtins.concatStringsSep ''", "'' list}"]'';
writeHaskellScript = { name ? "haskell-script", bins ? [ pkgs.coreutils ]
, libraries ? [ ], imports ? [ ] }:
code:
unstable.writers.writeHaskellBin name {
libraries = libraries
++ [ shh unstable.haskellPackages.string-interpolate ];
pkgs.writers.writeHaskellBin name {
libraries = libraries ++ [
shh
pkgs.haskellPackages.string-interpolate
pkgs.haskellPackages.classy-prelude
];
} ''
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import Shh
import qualified Prelude
import ClassyPrelude
import Data.String.Interpolate (i)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
@ -53,14 +57,13 @@ rec {
import qualified Data.Text.Lazy as LT
import qualified Data.Text.Encoding as TE
import qualified Data.Text.Lazy.Encoding as LTE
import System.Environment (getArgs)
${builtins.concatStringsSep "\n" (map (x: "import ${x}") imports)}
-- Load binaries from Nix packages. The dependencies will be captured
-- in the closure.
loadFromBins ${
loadFromBins (${
haskellList (builtins.map toString (bins ++ [ pkgs.coreutils ]))
}
} :: [String])
${code}
'';
@ -68,17 +71,16 @@ rec {
name = "get-niv-path";
bins = [ pkgs.nix ];
imports = [ "System.Console.CmdArgs.Implicit" ];
libraries =
[ unstable.haskellPackages.cmdargs unstable.haskellPackages.text ];
libraries = [ pkgs.haskellPackages.cmdargs pkgs.haskellPackages.text ];
} ''
trimQuotation = pureProc $ LTE.encodeUtf8 . LT.dropAround ('"' ==) . LTE.decodeUtf8 . trim
main = do
[sources, channel] <- getArgs
let expr = [i|(import #{sources}).#{channel}|]
let expr = [i|(import #{sources}).#{channel}|] :: String
nix_build ["-Q", "-E", expr, "--no-out-link"] &> devNull
nix_instantiate ["--eval", "-E", [i|toString #{expr}|]] |> trimQuotation
nix_instantiate ["--eval" :: String, "-E", [i|toString #{expr}|]] |> trimQuotation
'';
home-manager = pkgs.callPackage <home-manager/home-manager> { };
gcRetentionDays = 5;

View file

@ -11,7 +11,7 @@ in rec {
main = do
(configDir:hostname:args) <- getArgs
paths <- concat <$> mapM (getNivAssign configDir) ["nixpkgs", "unstable", "home-manager"]
paths <- concat <$> mapM (getNivAssign $ unpack configDir) ["nixpkgs", "unstable", "home-manager"]
putStrLn [i|Trying to build ${name} config for #{hostname}|]
${commandline}
'';
@ -21,14 +21,14 @@ in rec {
name = "test-system-config";
inherit bins;
} (haskellBody "system" ''
nix $ ["build", "-f", "<nixpkgs/nixos>", "system"] ++ paths ++ ["-I", [i|nixos-config=#{configDir}/hosts/#{hostname}/configuration.nix|], "-o", [i|result-system-#{hostname}|]] ++ args
nix $ ["build", "-f", "<nixpkgs/nixos>", "system"] ++ paths ++ ["-I", [i|nixos-config=#{configDir}/hosts/#{hostname}/configuration.nix|], "-o", [i|result-system-#{hostname}|]] ++ fmap unpack args
'');
test-home-config = writeHaskellScript {
name = "test-home-config";
inherit bins;
} (haskellBody "home" ''
nix $ ["build", "-f", "<home-manager/home-manager/home-manager.nix>"] ++ paths ++ ["--argstr", "confPath", [i|#{configDir}/hosts/#{hostname}/home.nix|], "--argstr", "confAttr", "", "--out-link", [i|result-home-manager-#{hostname}|], "activationPackage"] ++ args
nix $ ["build", "-f", "<home-manager/home-manager/home-manager.nix>"] ++ paths ++ ["--argstr", "confPath", [i|#{configDir}/hosts/#{hostname}/home.nix|], "--argstr", "confAttr", "", "--out-link", [i|result-home-manager-#{hostname}|], "activationPackage"] ++ fmap unpack args
'');
repoSrc = "git@hera.m-0.eu:nixos-config";
@ -40,7 +40,6 @@ in rec {
name = "test-config";
bins = [ test-system-config test-home-config pkgs.git niv pkgs.git-crypt ];
imports = [
"Control.Exception (bracket)"
"System.Directory (withCurrentDirectory)"
"Control.Monad (when, ap)"
"Data.Maybe (listToMaybe)"
@ -52,7 +51,7 @@ in rec {
main = do
path <- pwd |> captureTrim
bump <- (maybe False (== "bump") . listToMaybe) <$> getArgs
bump <- (maybe False (== pack "bump") . listToMaybe) <$> getArgs
bracket checkout (rm "-rf") $ \dir -> do
withCurrentDirectory dir $ do
mapM_ (\x -> git_crypt "unlock" ([i|${configPath}/.git/git-crypt/keys/#{x}|] :: String)) ${

View file

@ -14,6 +14,6 @@ in {
main = do
args <- getArgs
paths <- concat <$> mapM getNivAssign ["home-manager", "nixpkgs", "unstable"]
home_manager $ paths ++ ["switch"] ++ args
home_manager $ paths ++ ["switch"] ++ fmap unpack args
'';
}

View file

@ -16,6 +16,6 @@ in rec {
main = do
paths <- fmap concat . mapM getNivAssign $ ["nixpkgs", "unstable", "home-manager"]
args <- getArgs
nixos_rebuild (paths ++ ["switch"] ++ args)
nixos_rebuild (paths ++ ["switch"] ++ fmap unpack args)
'';
}

View file

@ -131,6 +131,18 @@
"url": "https://github.com/NixOS/nixpkgs-channels/archive/8bf142e001b6876b021c8ee90c2c7cec385fe8e9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"tabnine-vim": {
"branch": "master",
"description": "Vim client for TabNine",
"homepage": "https://tabnine.com/",
"owner": "zxqfl",
"repo": "tabnine-vim",
"rev": "f7be9252afe46fa480593bebdd154278b39baa06",
"sha256": "1jzpsrrdv53gji3sns1xaj3pq8f6bwssw5wwh9sccr9qdz6i6fwa",
"type": "tarball",
"url": "https://github.com/zxqfl/tabnine-vim/archive/f7be9252afe46fa480593bebdd154278b39baa06.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"unstable": {
"branch": "nixos-unstable",
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",

View file

@ -45,33 +45,8 @@ in rec {
zsh-powerlevel10k =
pkgs.callPackage ./powerlevel10k/zsh-powerlevel10k.nix { };
ghcide = (import sources.ghcide { }).ghcide-ghc865;
tasktree = pkgs.callPackage ./tasktree { };
libluv = unstable.callPackage ./libluv { };
libvterm-neovim = unstable.libvterm-neovim.overrideAttrs (attrs: {
version = "2019-08-28";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "libvterm";
rev = "1aa95e24d8f07a396aa80b7cd52f93e2b5bcca79";
sha256 = "0vjd397lqrfv4kc79i5izva4bynbymx3gllkg281fnk0b15vxfif";
};
});
neovim-unwrapped = unstable.neovim-unwrapped.overrideAttrs (attrs: {
version = "nightly-2019-0914";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "8c88d98";
sha256 = "11n0yzk55x9w3hldq7mp07q2fa94ksc20qmh3llq8mj976675i48";
};
buildInputs = [ libvterm-neovim ] ++ attrs.buildInputs ++ [ libluv ];
});
neovim = (unstable.wrapNeovim neovim-unwrapped { }).override {
neovim = unstable.neovim.override {
vimAlias = true;
withPython3 = true;
};
@ -172,7 +147,7 @@ in rec {
inherit (pkgs.gnome3) nautilus;
inherit (pkgs.xorg) xev xbacklight;
inherit (pkgs)
# web
# web
chromium
# communication

View file

@ -1,19 +1,23 @@
n:
n.override {
n.override (let
pkgs = import <nixpkgs> { };
tabnine = (import ../../lib).sources.tabnine-vim;
in {
vimAlias = true;
withPython3 = true;
configure = {
customRC = builtins.readFile ./vimrc;
customRC = ''
set rtp+=${tabnine}
${builtins.readFile ./vimrc}'';
packages.myVimPackage = {
start = builtins.attrValues {
inherit ((import <nixpkgs> { }).vimPlugins)
inherit (pkgs.vimPlugins)
vim-nix vimtex airline rust-vim fugitive vim-trailing-whitespace
vim-airline-themes vim-pandoc vim-pandoc-syntax haskell-vim
vim-autoformat vim-ledger papercolor-theme nerdcommenter vundle;
inherit ((import <unstable> { }).vimPlugins)
vim-autoformat vim-ledger papercolor-theme nerdcommenter vundle
coc-nvim coc-python coc-rls coc-yaml coc-vimtex coc-css coc-json
coc-html coc-git;
coc-html coc-git coc-tabnine;
};
};
};
}
})

View file

@ -1,33 +1,3 @@
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'zxqfl/tabnine-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
set spell spelllang=de,en
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
@ -93,9 +63,7 @@ let g:formatters_cabal = ['my_cabal']
let g:formatdef_my_nix = '"nixfmt"'
let g:formatters_nix = ['my_nix']
if (index(["c"], &filetype) >= 0)
au BufWrite * :Autoformat
endif
au BufWrite * :Autoformat
let g:autoformat_autoindent = 0
let g:autoformat_retab = 0

File diff suppressed because it is too large Load diff

View file

@ -1,44 +0,0 @@
{ pkgs, fetchFromGitHub, defaultCrateOverrides, makeDesktopItem, atk, pango
, gnome3, cairo, gdk_pixbuf, glib, ... }:
((pkgs.callPackage ./Cargo.nix { }).tasktree_0_1_0 { }).override {
crateOverrides = defaultCrateOverrides // {
atk-sys = attr: { buildInputs = [ atk ]; };
pango-sys = attr: { buildInputs = [ pango glib ]; };
gio = attr: { buildInputs = [ glib ]; };
gdk-sys = attr: { buildInputs = [ gdk_pixbuf glib cairo pango ]; };
gtk-sys = attr: {
buildInputs = [ gdk_pixbuf glib cairo pango atk gnome3.gtk ];
};
gdk = attr: { buildInputs = [ cairo gnome3.gtk gdk_pixbuf pango ]; };
gtk = attr: { buildInputs = [ cairo atk gnome3.gtk gdk_pixbuf pango ]; };
tasktree = attrs:
let
desktopItem = makeDesktopItem {
name = "tasktree";
exec = "tasktree";
icon = "tasktree";
comment = "A taskwarrior UI";
desktopName = "Tasktree";
genericName = "Tasktree";
categories = "Office;";
};
version = "abb312f";
in {
src = fetchFromGitHub {
rev = version;
owner = "maralorn";
repo = "tasktree";
sha256 = "139xjvi7b62k3075b4md9hdkb1xafhhiyz2yhbb96d73j1gkqs77";
};
depsSha256 = "14acvigygrrqyvxra2n01vpadc3mcf8981jrggpvwfbz58jrsa7h";
cargoSha256 = "14acvigygrrqyvxra2n01vpadc3mcf8981jrggpvwfbz58jrsa7h";
postInstall = ''
mkdir -p $out/share/applications
ln -s ${desktopItem}/share/applications/* $out/share/applications/
rm $out/lib/link
'';
buildInputs = [ cairo atk gnome3.gtk gdk_pixbuf pango ];
};
};
}