Check nixpkgs/pkgs/build-support/trivial-builders.nix for more information about:
- runCommand / runCommandCC
- writeTextFile / writeTextDir
- writeScript / writeScriptBin
- writeShellScript / writeshellScriptBin
- writeShellApplication
- ...
{ | |
description = "A nixos cloudinit base image without nixos-infect"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs"; | |
}; | |
outputs = { self, nixpkgs }: | |
let | |
system = "x86_64-linux"; |
import com.intellij.coverage.CoverageExecutor | |
import com.intellij.execution.ExecutorRegistry | |
import com.intellij.execution.RunManager | |
import com.intellij.execution.RunnerAndConfigurationSettings | |
import com.intellij.execution.application.ApplicationConfiguration | |
import com.intellij.execution.application.ApplicationConfigurationType | |
import com.intellij.execution.executors.DefaultDebugExecutor | |
import com.intellij.execution.executors.DefaultRunExecutor | |
import com.intellij.execution.junit.JUnitConfiguration | |
import com.intellij.execution.junit.JUnitConfigurationType |
function Get-ScoopRoot { | |
$scoopdir = & { | |
$env:SCOOP, (scoop config 'rootPath'), "$env:USERPROFILE\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1 | |
} 6>$null | |
$scoopdir | |
} | |
function Get-ScoopPackageVersions { | |
param ( | |
[Parameter(Position = 1, Mandatory = $true)] |
# Adapted from https://github.com/bennofs/nix-index/blob/master/command-not-found.sh | |
command_not_found_handle () { | |
if [ -n "${MC_SID-}" ] || ! [ -t 1 ]; then | |
>&2 echo "$1: command not found" | |
return 127 | |
fi | |
echo -n "searching nix-index..." | |
ATTRS=$(@nix-locate@ --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$1") |
# Module for configuring libvirt with static NixOS networking | |
# instead of using libvirt managed bridge. | |
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.virtualisation.libvirtd.networking; | |
v6Enabled = cfg.ipv6.network != null; | |
v6PLen = toInt (elemAt (splitString "/" cfg.ipv6.network) 1); |
Check nixpkgs/pkgs/build-support/trivial-builders.nix for more information about:
I wanted to write a module that generates multiple systemd services and timers to scrub some zfs pools at certain intervals. The default scrub config does not support individual scrub intervals for each pool.
I want the config to look like this:
{
services.zfs-auto-scrub = {
tank = "Sat *-*-* 00:00:00";
Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?
Well... not quite. I managed to get it to run... but not well.
exec startlxde |
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
################################################################################ | |
# System |